NOTE: Some aspects of this product are in Beta. The hybrid installation options are GA. To join the Beta program, reach out to your Apigee representative.

Deploying an API proxy

You cannot invoke an API proxy until it has been deployed. After you create a new API proxy or make a change to an existing one, you can deploy it to your cluster.

When you create a new revision of an API proxy without changing its base path, then deploy it to an environment in which it's already deployed, the previous version is undeployed and the new revision is deployed in its place.

Deploy an API proxy revision as described in the following sections.

Apigee UI

To deploy an API proxy in the Apigee UI:

  1. Sign in to the Apigee UI.
  2. Select Develop > API Proxies.

    The UI diplays a list of API proxies and their deployment status:

    A list of API proxies displays that includes
      the name, status, traffic over 24 hours, author, and time last modified.

  3. From the Environment drop-down list, select the environment to which you want to deploy the API proxy.
  4. Click the API proxy that you want to deploy.

    The UI displays the API Proxies Overview tab. This view includes the Deployments, Proxy Endpoints, and Target Endpoints sections:

    API proxy details including the deployment status per environment,
      the proxy endpoint details, and the target endpoint details.

    If this is a new API proxy that you have not deployed before (or an API proxy that you have undeployed), the Revision column shows Not deployed.

  5. In the Revision column, expand the drop-down selector.

    If this is a new API proxy that has never been deployed before, the drop-down list displays only 1 and Undeploy:

    For API proxies with multiple revisions, the drop-down list displays all revisions that you can choose from as well as Undeploy.

    Deployments section of the API proxy details with 
      the drop-down menu selected for the test environment.

  6. Select the revision that you want to deploy from the drop-down list.

    The UI prompts you to confirm the deployment:

    Deployments section of the API proxy details
      with revision 3 selected for the prod environment.

  7. Click Deploy.

    The UI begins the process of deploying the selected revision. Position the cursor over the Details link in the Status column to view the status of the deployment. If there are one or more revisions already deployed, you can monitor the status of their undeployment, as shown in the following figure. For more information, see Zero-downtime deployment.

    Deploy my-new-proxy to test environment confirmation

    When deployment is complete, the Status details indicates that the revision is fully deployed:

    Deployment status showing Revision 18 deployed 75% and revision 17 25%

    Note that deployment is not an instantaneous process. Apigee's eventually consistent deployment model means that a new deployment will be rolled out to the cluster over a short period of time and not immediately. For more information, see About deployment.

    For information on what the status indicators mean and how to check the status, see see Viewing deployment status.

    Deployment status showing Revision 18 fully deployed

Alternatively, you can deploy the current revision you are editing in the Develop tab. When you do this, Apigee creates a new revision for you.

  1. Click the Deploy to: env_name drop-down list

    Deployment drop-down enabling you to deploy or undeploy the current revision to each environment

    The UI displays a list of environments. In the Revision column, the UI lists the currently deployed revision (or "‑‑" if none).

  2. Click Deploy revision to deploy the revision that you most recently edited.

    The UI prompts you to confirm the deployment.

  3. Click Deploy.

    The UI begins the process of deploying the selected revision.

Apigee API

The following sections provide examples of using the Apigee API to deploy API proxy revisions and list the deployments for your organization.

See also Viewing deployment status.

Deploying an API proxy revision using the API

To deploy an API proxy revision, use the following API call:

curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/apis/$API/revisions/$REV/deployments" \
  -X POST \
  -H "Authorization: Bearer $TOKEN"

Where $TOKEN is set to your OAuth 2.0 access token, as described in Obtaining an OAuth 2.0 access token. For information about the curl options used in this example, see Using curl. For a description of the environment variables used, see Setting environment variables for Apigee API requests.

The following shows an example of the response output. In this example, revision 1 of the helloworld API proxy was deployed successfully to the test environment:

{
  "environment": "test",
  "apiProxy": "helloworld",
  "revision": "1",
  "deployStartTime": "1559149080457"
}

For more information, see Deploy API proxy revision API.

Listing deployments using the API

To list all deployments of API proxies and shared flows for your organization, enter the following API call:

curl "https://apigee.googleapis.com/v1/organizations/$ORG/deployments" \
  -X GET
  -H "Authorization: Bearer $TOKEN"

Where $TOKEN is set to your OAuth 2.0 access token, as described in Obtaining an OAuth 2.0 access token. For information about the curl options used in this example, see Using curl. For a description of the environment variables used, see Setting environment variables for Apigee API requests.

The following provides an example of the response. In this example, there are three API proxies deployed, including helloworld which was deployed in the previous section.

{
  "deployments": [
    {
      "environment": "test",
      "apiProxy": "helloworld",
      "revision": "1",
      "deployStartTime": "1559149080457"
    },
    {
      "environment": "test",
      "apiProxy": "weather",
      "revision": "1",
      "deployStartTime": "1558620435217"
    },
    {
      "environment": "test",
      "apiProxy": "testproxy",
      "revision": "2",
      "deployStartTime": "1558635113086"
    }
  ]
}

gcloud

The following sections provide examples of using gcloud alpha apigee CLI commands to deploy API proxy revisions and list the deployments for your organization.

See also Viewing deployment status.

For more information and a description of the environment variables used in the examples, see Getting started using gcloud with Apigee.

Deploying an API proxy revision using the gcloud CLI

To deploy an API proxy revision, use the following gcloud command:

gcloud alpha apigee apis deploy $REV --api=$API --environment=$ENV

The following shows an example of the response output. In this example, revision 1 of the helloworld API proxy was deployed successfully to the test environment:

Using Apigee organization `my-org`
apiProxy: helloworld
deployStartTime: '1598032332802'
environment: test
revision: '1'

For more information, see Deploy API proxy revision CLI.

Listing deployments using the gcloud CLI

To list all deployments of API proxies and shared flows for your organization, use the following gcloud command:

gcloud alpha apigee deployments list

The following provides an example of the response. In this example, there are three API proxies deployed, including helloworld which was deployed in the previous section.

Using Apigee organization `my-org`
 - apiProxy: helloworld
   deployStartTime: 1598032332802
   environment: test
   revision: 1
 - apiProxy: weather
   deployStartTime: 1558620435217
   environment: test
   revision: 1
 - apiProxy: testproxy
   deployStartTime: 1558635113086
   environment: test
   revision: 2

For more information, see List deployments CLI.