This article explains the steps to deploy API Proxy from API Manager to Hybrid (On-Premises) / CloudHub using REST APIs.
Please refer to the knowledge article "How to generate your Authorization Bearer token for Anypoint Platform".
By using the Authorization Token from Step 1, execute the below API
curl -H "Authorization: Bearer AUTH_TOKEN" https://anypoint.mulesoft.com/accounts/api/me
Below is the sample output snippet from the above API call, "id" field contains the Organization ID value.
"organization": {
"name": "user.name",
"id": "xxxx-yyyy-zzzzz-vvvv"
}
Note: Values in the above snippet output are masked. Use it as a reference only
By using the Authorization Token and Organization ID from Step 1 & 2, execute the below API call
curl -H "Authorization: Bearer AUTH_TOKEN" https://anypoint.mulesoft.com/accounts/api/organizations/ORG_ID/environments
Below is the output snippet from the above API call, "id" field contains the environment ID value:
{
"id": "xxxxxxxxxxxxx",
"name": "TestEnv",
"organizationId": "xxxx-yyyy-zzzzz-vvvv",
"isProduction": true
}
Note: Values in the above snippet output are masked. Use it as a reference only
Retrieve the API Id from the API Manager UI as shown below:
To deploy the API Proxy execute the below API using the POST method
curl -H "Authorization: Bearer AUTH_TOKEN" https://anypoint.mulesoft.com/proxies/xapi/v1/organizations/<ORG_ID>/environments/<ENV_ID>/apis/<API_ID>/deployments
For Hybrid Deployment pass the below body as JSON format
-d '{
"gatewayVersion": "4.3.0", <--- Version of the Mule runtime
"targetId": 8724539, <--- Id of the Mule server
"targetName": "430-server", <-- Name of the server
"targetType": "server", <--- Type of the env eg., Server, Server Group etc
"type": "HY", <--- Type of Deployment: HY for Hybrid, CH for Cloudhub
"environmentId": "<ENV_ID>", <--- ID of the Environment same as in Step3
"environmentName": "Test" <----- Name of the Environment
}'
For CloudHub Deployment pass the below body as JSON format
-d '{ "applicationName": "Tickets-app", <--- Name of the application
"environmentName": "Sandbox", <--- Name of the Environment
"environmentId": "<ENV_ID>", <----- ID of the Environment same as in Step3
"type":"CH", <---- Type of Deployment: HY for Hybrid, CH for Cloudhub
"overwrite": true, <--- flag to confirm overriding, if application with that name exist
"gatewayVersion":"4.3.0" <--- Version of the Mule runtime
}'
001116781

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.