Deploy to Proxies using PAPI

This article provides information about how to manage application deployments to on demand proxies by making calls to the
API Key Deployments
resource for the Portal API (PAPI). You manage application deployments by deploying, undeploying, and redeploying applications.
For more information about the PAPI, see Portal API (PAPI).
In this article:
Verify the Prerequisites
Before you can manage application deployments by making calls to PAPI, ensure that you have met the following prerequisites:
  • You have retrieved a valid OAuth 2.0 access token.
  • You have installed the REST Management API (restman) on your proxy.
    For more information, see the Rest Management API section in the CA API Gateway documentation.
  • You have the latest Portal Integration bundle installed on your proxy.
    For more information about this bundle, see Upgrade API Developer Portal.
Retrieve the Application Deployment Type Setting for a Proxy
You can retrieve the application deployment type setting (on_demand or automatic) a proxy.
Issue a GET call to the following Proxies resource in the PAPI:
https://<papi_host>:<papi_port>/<tenantid>/deployments/0.1/proxies/{proxyUuid}/deployment-type
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/0.1/proxies/39ae7b23-abba-4c6c-b057-b2ce97a76eb9/deployment-type
Example response:
{ "api": "AUTOMATIC", "application": "ON_DEMAND" }
Set or Update the Application Deployment Type for a Proxy
Issue a PUT call to the following Proxies resource in the PAPI, specifying
applications
as the entity and including a payload:
https://<papi_host>:<papi_port>/<tenantid>/deployments/0.1/proxies/{proxyUuid}/deployment-type/{entity}
Payload to set or update to automatic:
{ "api": "AUTOMATIC" }
Payload to set or update to on-demand:
{ "application": "ON_DEMAND" }
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/0.1/proxies/39ae7b23-abba-4c6c-b057-b2ce97a76eb9/deployment-type/applications
Retrieve a List of the Proxies to Which an Application is Deployed
You can retrieve the list of the proxies to which the application is deployed and the application’s deployment details, including the status, message, where the API key is deployed, and the application deployment type.
Issue a GET call to the following API Key Deployments resource in the PAPI:
https://<papi_host>:<papi_port>/<tenantid>/deployments/1.0/api-keys/{apiKey}/proxies
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/1.0/api-keys/l73b86486b0b324d2ba32c7a54b55bc796/proxies
Example response:
[ { "applicationUuid": "ecbeb32f-710c-4dba-aa75-5e1fc52a9f8d", "apiKey": "l73b86486b0b324d2ba32c7a54b55bc796", "proxyUuid": "39ae7b23-abba-4c6c-b057-b2ce97a76eb9", "proxyName": "stageProxy", "lastTimeDeployed": 1585246140165, "status": "PENDING_DEPLOYMENT" } { "applicationUuid": "ecbeb32f-710c-4dba-aa75-5e1fc52a9f8d", "apiKey": "l73b86486b0b324d2ba32c7a54b55bc796", "proxyUuid": "0efddbdd-c3dc-43ce-8a64-6c0e1b0e1c68", "proxyName": "devProxy", "lastTimeDeployed": 1585250760192, "status": "PENDING_UNDEPLOYMENT" } { "applicationUuid": "ecbeb32f-710c-4dba-aa75-5e1fc52a9f8d", "apiKey": "l73b86486b0b324d2ba32c7a54b55bc796", "proxyUuid": "ce306f56-6cff-40cd-8d05-2c03a0c0a656", "proxyName": "ran_proxy_otk4.4", "lastTimeDeployed": 1585257888085, "status": "DEPLOYED" } ]
Retrieve a Specific Application Deployment to a Proxy
You can retrieve a specific application deployment to a proxy, including the status and message.
Issue a GET call to the following API Key Deployments resource in the PAPI:
https://<papi_host>:<papi_port>/<tenantid>/deployments/1.0/api-keys/{apiKey}/proxies/{proxyUuid}
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/1.0/api-keys/l73b86486b0b324d2ba32c7a54b55bc796/proxies/39ae7b23-abba-4c6c-b057-b2ce97a76eb9
Example response:
[ { "applicationUuid": "ecbeb32f-710c-4dba-aa75-5e1fc52a9f8d", "apiKey": "l73b86486b0b324d2ba32c7a54b55bc796", "proxyUuid": "39ae7b23-abba-4c6c-b057-b2ce97a76eb9", "proxyName": "t1-proxy1", "lastTimeDeployed": 1585246140165, "status": "DEPLOYED" } ]
Deploy an Application to Proxies
Issue a POST call to the following API Key Deployments resource in the PAPI, which orchestrates and triggers the deployment process to the specific proxy:
https://<papi_host>:<papi_port>/<tenantid>/deployments/1.0/api-keys/{apiKey}/proxies
Example payload:
{ "proxyUuid": "39ae7b23-abba-4c6c-b057-b2ce97a76eb9" }
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/1.0/api-keys/l7023d322ee34740d0878bb75914c308a7/proxies -d ‘{ “proxyUuid”: “39ae7b23-abba-4c6c-b057-b2ce97a76eb9" }’
Redeploy an Application to Proxies
Issue a PUT call to the following API Key Deployments resource in the PAPI:
https://<papi_host>:<papi_port>/<tenantid>/deployments/1.0/api-keys/{apiKey}/proxies
Example payload:
{ "status": "PENDING_DEPLOYMENT" }
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/1.0/api-keys/l7023d322ee34740d0878bb75914c308a7/proxies -d ‘{ “status”: “PENDING_DEPLOYMENT" }’
Redeploy an Application to a Specific Proxy
Issue a PUT call to the following API Key Deployments resource in the PAPI:
https://<papi_host>:<papi_port>/<tenantid>/deployments/1.0/api-keys/{apiKey}/proxies/{proxyUuid}
Example payload:
{ "message": "string" "status": "PENDING_DEPLOYMENT" }
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/1.0/api-keys/l7023d322ee34740d0878bb75914c308a7/proxies/39ae7b23-abba-4c6c-b057-b2ce97a76eb9
Undeploy an Application from a Specific Proxy
Issue a DELETE call to the following API Key Deployments resource in the PAPI:
https://<papi_host>:<papi_port>/<tenantid>/deployments/1.0/api-keys/{apiKey}/proxies/{proxyUuid}
After the application is deleted from the proxy, the deployment itself is deleted.
You can undeploy
and
delete the application from the proxy by issuing a DELETE request to this endpoint.
Example request:
curl -H 'Authorization: Bearer cde69bcc-3bed-44e0-af5b-c33fcb9020d5' \ https://apim-ssg-apim-uswest-prod.app.prod.w2.dev.ca.com:443/atenant/deployments/1.0/api-keys/8f6bc46c-a131-4388-b654-1e2b599b0ee9/proxies/39ae7b23-abba-4c6c-b057-b2ce97a76eb9