Was this helpful?

 

API Platform Base Path: https://api.enterprise.apigee.com/v1/o/{org_name}

API Resource Path: /apis/{api_name}/revisions/{revision_number}/deployments?action=deploy&env={environment_name}&basepath={/basepath}

Description: Pushes an API to an environment (typically 'test' or 'prod') for execution

Verb: POST
Auth: Basic Auth
Media types:
application/octet-stream

 

Overview:

This call deploys a specific revision of an API proxy to the specified environment.

By default every organization on the API Platform is provisioned with two environments--test and prod.

Each environment has a unique network address.

To get a list of available environments in your organization, use the GET organization method to list environments.

API proxies cannot be invoked until they have been deployed to an environment.

Apigee provides a deployment tool and sample scripts on GitHub.

Sample Request:
$ curl -X POST \
https://api.enterprise.apigee.com/v1/o/{org_name}/apis/{api_name}/revisions/{revision_number}/deployments?"action=deploy&env=prod&basepath=/" \
-u myname:mypass 
Query Parameters:
Name Description Default Required?
env The name of the environment to which the revision of the API proxy should be deployed. (Usually 'test' or 'prod'.) N/A Yes
basepath This setting adds an additional 'deployment basepath' to the basepath configured in the API proxy definition. To leave the basepath unmodified (that is, to use only the proxy basepath) , use the empty value '/'. N/A Yes
action The action to be taken against the specified revision of the API proxy. Supported values are 'deploy' and 'undeploy' N/A Yes
override Forces deployment of the new revision by overriding conflict checks between revisions. N/A No
dryrun When set to 'true', performs a mock deployment, enabling you to see the result of the pending deployment without disrupting the deployed revision N/A Yes
Sample Response:
{
  "aPIProxy" : "weatherapi",
  "configuration" : {
    "basePath" : "/",
    "steps" : [ ]
  },
  "environment" : "prod",
  "name" : "64",
  "organization" : "apifactory",
  "revision" : "64",
  "server" : [ {
    "status" : "deployed",
    "type" : [ "message-processor" ],
    "uUID" : "3a9f88bb-b485-47bb-a072-92dbefe8bc14"
  }, {
    "status" : "deployed",
    "type" : [ "message-processor" ],
    "uUID" : "8a4549fe-ceff-44cf-967f-ab4a500a0479"
  }, {
    "status" : "deployed",
    "type" : [ "router" ],
    "uUID" : "3341eda0-fa82-4dcb-bbf1-5cf77dc03efc"
  }, {
    "status" : "deployed",
    "type" : [ "router" ],
    "uUID" : "c0b782f2-ccb6-4984-a0c0-0ac1db60a039"
  }, {
    "status" : "deployed",
    "type" : [ "router" ],
    "uUID" : "38f80c53-a22b-4427-ab95-a178482daa6b"
  }, {
    "status" : "deployed",
    "type" : [ "router" ],
    "uUID" : "28d847a2-5bfd-404d-985d-33d079d691d9"
  }, {
    "status" : "deployed",
    "type" : [ "router" ],
    "uUID" : "26467f86-e529-4135-b012-120e274755d3"
  }, {
    "status" : "deployed",
    "type" : [ "router" ],
    "uUID" : "807be0c7-dcc7-4be4-9d1e-30d26fa5519c"
  } ],
  "state" : "deployed"
Response Payload Elements:
 
 
 
 
 
 
 
 
 
Name Description
aPIProxy The name of the API proxy
configuration The basepath for this deployment (appended to the basepath defined in the Proxy Endpoint if any)
steps Any policy steps attached to the API proxy
environment The environment where the API proxy is deployed ('test' or 'prod')
name The revision name (always a number)
organization The API provider's Apigee organization name
revision The number of the revision
server A set of servers deployed in support of the API proxy (primarily for Apigee support)
state The state of the API proxy, either 'deployed' or 'undeployed'
Errors
{
  "code" : "distribution.DeploymentPathConflict",
  "message" : "Path /weather conflicts with existing deployment path for revision 64 of the APIProxy weatherapi in organization apifactory",
  "contexts" : [ ]
}


{
  "code" : "distribution.RevisionNotDeployed",
  "message" : "Revision 65 of APIProxy weatherapi is not deployed to the environment prod in the organization apifactory",
  "contexts" : [ ]
}

 

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)