View
Apigee Edge documentation.
Develop and test your programmable API proxies using Apigee in VS Code. Then, deploy an archive of your API proxy configuration environment to your Apigee integration test and production environment as described in the following sections.
Before you can deploy an archive, you must enable archive deployment in your Apigee environment.
Enable archive deployment as described in the following sections.
In the Google Cloud console, go to the Apigee > Environments page.
Select Archive under Deployment type.
To enable archive deployment when creating an environment using the API, set deploymentType to ARCHIVE in the request body.
For example:
curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments" \
-X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-type: application/json" \
-d
'{
"name": "integration-test",
"description": "Integration test environment",
"displayName" : "Integration test",
"deploymentType" : "ARCHIVE"
}'
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 environment variables you can use, see
Setting
environment variables for Apigee API requests.
The following provides an example of the response:
{
"name": "organizations/$ORG/operations/11b1ad1c-2371-473d-bcd4-f621f8d98ef7",
"metadata": {
"@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
"operationType": "INSERT",
"targetResourceName": "organizations/$ORG/environments/integration-test",
"state": "IN_PROGRESS"
}
}You can check the status of the operation. For example:
curl https://apigee.googleapis.com/v1/organizations/$ORG/operations/11b1ad1c-2371-473d-bcd4-f621f8d98ef7 / -H "Authorization: Bearer $TOKEN"
The following provides an example of the response. Note that the state of the operation is FINISHED and the state of the
environment is set to ACTIVE.
{
"name": "organizations/$ORG/operations/11b1ad1c-2371-473d-bcd4-f621f8d98ef7",
"metadata": {
"@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
"operationType": "INSERT",
"targetResourceName": "organizations/$ORG/environments/integration-test",
"state": "FINISHED"
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.apigee.v1.Environment",
"name": "integration-test",
"description": "Integration test environment",
"createdAt": "1615553880084",
"lastModifiedAt": "1615553881911",
"displayName": "Integration test",
"state": "ACTIVE",
"deploymentType": "ARCHIVE"
}
}For more information about the API, see Create environments API.
To deploy an archive to an Apigee environment use the following gcloud command:
gcloud beta apigee archives deploy \
--environment=$ENV \
[--organization=$ORG] \
[--source=$SOURCE] \
[--labels $KEY=$VALUE[,$KEY2=$VALUE2,$KEY3=$VALUE3,...]]
You must specify the Apigee environment in which you want to deploy the archive using the --environment flag. The Apigee environment must be
enabled for archive deployments.
For more information, see gcloud beta apigee archives deploy.
By default, the archive is deployed:
gcloud.
To view the current gcloud configuration, run gcloud config list. To specify the organization, use the --organization flag.
src/main/apigee root directory of the archive is in a location other than the
current working directory, use the --source flag to specify the location of the
root directory of the archive. See also
Understanding the structure of an Apigee workspace.
Optionally, you can add up to 64 custom label key/value pairs to an archive deployment
using the --labels flag. For example, you might want to label an archive with a build number. The labels will display
when you list archive deployments. Key values must adhere to the following guidelines:
[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
Behind the scenes, the gcloud command performs the following steps when deploying to Apigee on Google Cloud:
src/main/apigee Apigee workspace directory. For more information,
see Understanding the structure of an Apigee workspace.
The following example creates a zip archive of src/main/apigee in the current directory and deploys it to the specified
Apigee environment:
gcloud beta apigee archives deploy --environment=$ENV
The following example shows how you can specify an organization that is not associated with the current active project configured for gcloud:
gcloud beta apigee archives deploy --environment=$ENV --organization=$ORG
The following example creates a zip archive of the src/main/apigee directory under myarchive and deploys it to the specified Apigee environment:
gcloud beta apigee archives deploy --environment=$ENV --source=/myarchive
The following example adds the status and build_id labels to the archive deployment:
gcloud beta apigee archives deploy --environment=$ENV --labels=status=released,build=210315
The following provides an example of the response:
Using Apigee organization 'myorg' Waiting for operation [b64c2665-b5ac-43cc-9e2d-232e8895c2ed] to complete...done.
To check the archive deployment status, use the gcloud alpha apigee operations command.
The following example shows the archive deployment status for the operation with revision ID 439fa3f7-6aa4-42ad-8b12-3ca912c75d5c is IN_PROGRESS.
gcloud alpha apigee operations describe b64c2665-b5ac-43cc-9e2d-232e8895c2ed
The following provides an example of the response. Note that state is set to IN_PROGRESS.
Using Apigee organization 'myorg'
done: true
metadata:
'@type': type.googleapis.com/google.cloud.apigee.v1.OperationMetadata
operationType: INSERT
state: IN_PROGRESS
targetResourceName: uri
name: organizations/myorg/operations/b64c2665-b5ac-43cc-9e2d-232e8895c2ed
organization: myorg
response:
'@type': type.googleapis.com/google.cloud.apigee.v1.CanaryEvaluation
control: 1-5-0-20210319-071117-ghq74
endTime: '2021-03-20T06:15:44.329363950Z'
metricLabels:
env: test
location: us-central1
name: uri
startTime: '2021-03-20T06:14:44.306534584Z'
treatment: 1-5-0-20210319-190954-if0wk
verdict: NONE
uuid: b64c2665-b5ac-43cc-9e2d-232e8895c2edAfter the operation completes, the state is set to FINISHED.
List all archive deployments in an environment as described in the following sections.
To list all archive deployments in Apigee on Google Cloud, use the following gcloud command:
gcloud beta apigee archives list --environment=$ENV
You must specify the Apigee environment in which you want to view archive deployments using the --environment flag.
The Apigee environment must be Viewing details for an archive deployment.
For more information, see gcloud beta apigee archives list.
The following provides an example of the response:
Using Apigee organization 'myorg' ARCHIVE ID ENVIRONMENT DEPLOYED AT LABELS OPERATION STATUS pzfbs8uidbdv224joz myorg 2021-03-10 11:21:29 status=released,build=210315 Deployed fb4r8log2gm63r3gtu myorg 2021-03-05 13:40:30 vrytwbhso558oil53m myorg 2021-03-03 21:20:53
To list the archive deployments in an environment, issue a GET request to the following API:
https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments.
For example:
curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments" \ -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 environment variables you can use, see
Setting
environment variables for Apigee API requests.
The following provides an example of the response:
{
"archiveDeployments": [
{
"name": "organizations/myorg/environments/integration-test/archiveDeployments/pzfbs8uidbdv224joz",
"labels": {
"status": "released",
"build": "210315"
},
"createdAt": "1615821232451727",
"updatedAt": "1615821232451727",
"operation": "organizations/apigee-docs-c/operations/b64c2665-b5ac-43cc-9e2d-232e8895c2ed"
},
{
"name": "organizations/myorg/environments/integration-test/archiveDeployments/fb4r8log2gm63r3gtu",
"createdAt": "1615819281858447",
"updatedAt": "1615819281858447",
"operation": "organizations/apigee-docs-c/operations/71549b9c-4493-41b6-9838-c0ad5b1b3181"
},
{
"name": "organizations/myorg/environments/integration-test/archiveDeployments/vrytwbhso558oil53m",
"createdAt": "1615578337832207",
"updatedAt": "1615578337832207",
"operation": "organizations/apigee-docs-c/operations/a2eb50b5-f276-4de4-96a3-72fac3d4c05e"
}
]
}
View details for an archive deployment as described in the following sections.
To view details for an archive deployment in Apigee on Google Cloud, use the following gcloud command:
gcloud beta apigee archives describe $ID --environment=$ENV
You must specify the following:
--environment flag.
The Apigee environment must be enabled for archive deployments.
For more information, see gcloud beta apigee archives describe.
For example:
gcloud apigee archives describe pzfbs8uidbdv224joz --environment=$ENV
The following provides an example of the response:
Using Apigee organization 'myorg' createdAt: '1615578337832207' labels: status: 'released' build: '210315' name: organizations/myorg/environments/$ENV/archiveDeployments/pzfbs8uidbdv224joz operation: organizations/myorg/operations/b64c2665-b5ac-43cc-9e2d-232e8895c2ed operationStatus: Deployed updatedAt: '1615821232451727'
To view details for an archive deployment, issue a GET request to the following API:
https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments/$ID.
You must pass the ID of the archive deployment revision. To view the list of archive deployment revision IDs for an Apigee environment, see Listing all archive deployments in an environment.
For example:
curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments/pzfbs8uidbdv224joz" \ -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 environment variables you can use, see
Setting
environment variables for Apigee API requests.
The following provides an example of the response:
{
"name": "organizations/myorg/environments/integration-test/archiveDeployments/pzfbs8uidbdv224joz",
"labels": {
"status": "released",
"build": "210315"
},
"createdAt": "1615578337832207",
"updatedAt": "1615821232451727",
"operation": "organizations/apigee-docs-c/operations/b64c2665-b5ac-43cc-9e2d-232e8895c2ed"
}
Update labels for an archive deployment as described in the following sections.
To update labels for an archive deployment in Apigee on Google Cloud, use the following gcloud command:
gcloud beta apigee archives update [$ID] --environment=$ENV [--update-labels=$KEY=$VALUE[,$KEY2=$VALUE2...$KEYn=$VALUEn]], [--clear-labels | --remove-labels=$KEY[,$KEY2...$KEYn]]
You must specify the following:
--environment flag.
The Apigee environment must be enabled for archive deployments.| Flag | Description |
|---|---|
--clear-labels |
Removes all labels. If --update-labels is also specified, --clear-labels is applied first.
Cannot be specified if |
--remove-labels |
Removes the specified labels. If --update-labels is also specified, it is applied first.
Cannot be specified if |
--update-labels |
Update the labels. If a label exists, its value
is modified; otherwise, a new label is created.
Combine with --remove-labels or --clear-labels flags to remove a subset or all labels, respectively, before updating labels. |
For more information, see gcloud beta apigee archives update.
For example:
gcloud apigee archives update pzfbs8uidbdv224joz --environment=$ENV \ --clear-labels --update-labels=status=released,build=210315,tier=1
The following provides an example of the response:
Using Apigee organization `myorg` createdAt: 2020-04-04T04:04:04.004Z labels: status: released, build: 210315, tier: 1 name: organizations/apigee-docs-c/environments/dev/archiveDeployments/pzfbs8uidbdv224joz operation: organizations/apigee-docs-c/operations/bf587121-8b5c-4897-9d8f-9b1ef0cb06ca updatedAt: '1633450432067431'
To update labels for an archive deployment in Apigee on Google Cloud, issue a PATCH request to the following API:
https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments/$ID.
You must pass the ID of the archive deployment revision. To view the list of archive deployment revision IDs for an Apigee environment, see Listing all archive deployments in an environment.
Pass all of the labels you want to add to the archive in the request body. The labels that you pass overwrite the current set of labels, so you can remove labels by omitting them from the request body or remove all labels by passing an empty list.
For example:
curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments/$ID" \
-X PATCH \
-H "Authorization: Bearer $TOKEN" \
-d '{
"labels": {
"status" : "released",
"build" : "210315"
}
}'
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 environment variables you can use, see
Setting
environment variables for Apigee API requests.
The following provides an example of the response:
{
"name": "organizations/myorg/environments/integration-test/archiveDeployments/pzfbs8uidbdv224joz",
"labels": {
"status": "released",
"build": "210315"
},
"createdAt": "1615578337832207",
"updatedAt": "1615821232451727",
"operation": "organizations/apigee-docs-c/operations/b64c2665-b5ac-43cc-9e2d-232e8895c2ed"
}
To delete an Apigee environment with archive deployments:
mkdir -p /$TEMP/archive/src/main/apigee/environments/$ENV
deployments.json file to the directory. For example:
touch /$TEMP/archive/src/main/apigee/environments/$ENV/deployments.json
deployments.json to include an empty proxies array, as shown below.
{
"proxies" : []
}$TEMP/archive folder.
cd $TEMP/archive
gcloud beta apigee archives deploy --environment=$ENV
Delete a revision of an archive deployment as described in the following section.
To delete a revision of an archive deployment in Apigee on Google Cloud, use the following gcloud command:
gcloud beta apigee archives delete $ID --environment=$ENV
You must specify the following:
--environment flag.
The Apigee environment must be enabled for archive deployments.For example:
gcloud apigee archives delete fb4r8log2gm63r3gtu --environment=dev
The following provides an example of the response:
Archive deployment revision "fb4r8log2gm63r3gtu" deleted
To delete a revision of an archive deployment in Apigee on Google Cloud, issue a DELETE request to the following API:
https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments/$ID.
You must pass the ID of the archive deployment revision that you want to delete. To view the list of archive deployment revision IDs for an environment, see Listing all archive deployments in an environment.
For example:
curl "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/archiveDeployments/$ID" \ -X DELETE \ -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 environment variables you can use, see
Setting
environment variables for Apigee API requests.
The following provides an example of the response:
{}Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-09 UTC.