Asegúrate de que el grupo de entornos se haya creado antes de continuar. Puedes verificar el estado de tu grupo nuevo mediante una solicitud como la siguiente:
Adjuntar un entorno al grupo hace que los proxies de ese entorno se puedan enrutar a través de los nombres de host en el grupo. Esto activa una operación de larga duración que puede tardar varios minutos en completarse. Te recomendamos que esperes uno o dos minutos antes de continuar con el siguiente paso. Mientras tanto, puedes verificar el estado de la operación como antes.
Crea un entorno de producción nuevo en tu entorno de desarrollo local:
En Apigee VS Code, posiciona el cursor sobre la carpeta entornos en la sección Apigee y haz clic en .
Se abrirá el asistente de creación de entornos.
Ingresa prod como nombre del entorno y presiona Intro.
Se crea el entorno.
Expande la carpeta del entorno prod de la sección Apigee para ver su contenido.
Coloca el cursor sobre el archivo deployments.json en la sección de API y haz clic en .
Se abrirá el asistente de implementaciones.
Selecciona el proxy de API helloworld para agregarlo a la implementación y haz clic en OK.
El archivo deployments.json se abre en el editor. El archivo se actualizó para incluir el proxy de la API helloworld en el array de implementación proxies, como se muestra a continuación:
A continuación, se proporciona un ejemplo de la respuesta.
Using Apigee organization dev
Waiting for operation [$OPERATION_ID] to complete...⠹
Ejecuta el siguiente comando para verificar el estado de la operación y reemplaza $OPERATION_ID por el ID de la operación que se mostró en la llamada anterior:
Repite el paso anterior hasta que state se configure como FINISHED, lo que indica que el repositorio de archivos está completo.
Ejecuta el siguiente comando para ver todas las implementaciones de archivo en el entorno prod:
gcloud beta apigee archives list --environment=prod
A continuación, se proporciona un ejemplo de la respuesta.
Using Apigee organization 'prod'
ARCHIVE ID ENVIRONMENT DEPLOYED AT LABELS OPERATION STATUS
vrytwbhso558oil53m prod 2021-04-20 21:20:53 release=052021.1 Deployed
¡Felicitaciones! Promocionaste correctamente tu archivo de API a un entorno de producción de Apigee.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThis page details the process of promoting an API proxy configuration archive to a production environment in Apigee or Apigee hybrid.\u003c/p\u003e\n"],["\u003cp\u003eThe process includes creating a new "prod" environment in your Apigee organization and attaching it to a runtime instance and environment group.\u003c/p\u003e\n"],["\u003cp\u003eA new "prod" environment is then set up in the local development environment using Apigee in VS Code.\u003c/p\u003e\n"],["\u003cp\u003eAn archive of the API proxy configuration is deployed to the newly created "prod" environment within the Apigee organization using the \u003ccode\u003egcloud\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe procedure uses the \u003ccode\u003egcloud\u003c/code\u003e command to monitor the status of the long-running archive deployment operation, which involves checking the state until it reaches \u003ccode\u003eFINISHED\u003c/code\u003e, as well as listing out the existing archives.\u003c/p\u003e\n"]]],[],null,["# Step 8: Promote an archive to production\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\u003cbr /\u003e\n\n|\n| **Preview\n| --- Archive deployment**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nIn this step, you'll promote an archive of your API proxy configuration to a production environment in your Apigee organization.\n\n1. Follow the steps in [Create an environment](https://cloud.google.com/apigee/docs/api-platform/get-started/install-cli#create-environment) to perform the following:\n 1. Create a new **prod** environment in your Apigee organization, enabling **Archive** as the deployment type. Use the [UI](https://cloud.google.com/apigee/docs/api-platform/fundamentals/environments-working-with#creating-a-new-environment-in-the-ui) or [API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/create).\n 2. Attach the environment to a runtime instance using the [Instances attachment API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.instances.attachments).\n\n\n This command triggers a long-running operation. Ensure that the environment has been attached to the runtime before continuing.\n 3. Create an environment group if you do not already have one using the [Create environment groups API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.envgroups/create).\n\n\n Ensure that the environment group has been created before continuing. You can check the status of your new group using a\n request like the following: \n\n ```\n curl -i -H \"$AUTH\" -H \"Content-Type:application/json\" \\\n \"https://apigee.googleapis.com/v1/organizations/$PROJECT_ID/environments/ENVIRONMENT_NAME\"\n ```\n 4. Attach the new environment to the environment group using the [Environment group attachment API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.envgroups.attachments).\n\n Attaching an environment to the group makes the proxies in that environment\n routable via the hostnames in the group. This triggers a long-running operation that can take several minutes to complete. We recommend that you wait a minute or two before continuing to the next step. In the meantime you can check the status of the operation as before.\n2. Create a new **prod** environment in your local development environment:\n 1. In Apigee in VS Code, position your cursor over the **environments** folder in the Apigee section and click .\n\n \u003cbr /\u003e\n\n The Create environment wizard opens.\n 2. Enter **prod** for the environment name and press **\u003ckbd\u003eEnter\u003c/kbd\u003e** .\n\n The environment is created.\n 3. Expand the **prod** environment folder in the Apigee section to view its contents.\n 4. Position your cursor over the **deployments.json** file in the Apigee section and click .\n\n The Deployments wizard opens.\n\n \u003cbr /\u003e\n\n 5. Select the **helloworld** API proxy to add it to the deployment and click **OK** .\n\n The `deployments.json` file is opened in the editor. The file has been updated to include the `helloworld` API proxy in the `proxies` deployment array, as shown below: \n\n ```\n {\n \"proxies\": [\n \"helloworld\"\n ],\n \"sharedflows\": []\n }\n ```\n3. Deploy an archive of your API proxy configuration to the `prod` environment in your Apigee organization.\n 1. In the **Terminal** tab in Apigee VS Code, navigate to the **myapigeeworkspace** directory. \n\n ```\n cd myapigeeworkspace\n ```\n 2. Run the following command: \n\n ```\n gcloud beta apigee archives deploy --environment=prod --labels=release=052021.1\n ```\n\n\n The following provides an example of the response: \n\n ```\n Using Apigee organization dev\n Waiting for operation [$OPERATION_ID] to complete...⠹\n ```\n 3. Run the following command to check the status of the operation, replacing \u003cvar translate=\"no\"\u003e$OPERATION_ID\u003c/var\u003e with the operation ID returned in the previous call: \n\n ```\n gcloud beta apigee operations describe $OPERATION_ID\n ```\n\n\n The following provides an example of the response. Note that `state` is set to `IN_PROGRESS`. \n\n ```\n Using Apigee organization 'prod'\n done: true\n metadata:\n '@type': type.googleapis.com/google.cloud.apigee.v1.OperationMetadata\n operationType: INSERT\n state: IN_PROGRESS\n targetResourceName: uri\n name: organizations/prod/operations/$OPERATION_ID\n organization: prod\n response:\n '@type': type.googleapis.com/google.cloud.apigee.v1.CanaryEvaluation\n control: 1-5-0-20210319-071117-ghq74\n endTime: '2021-03-20T06:15:44.329363950Z'\n metricLabels:\n env: test\n location: us-central1\n name: uri\n startTime: '2021-03-20T06:14:44.306534584Z'\n treatment: 1-5-0-20210319-190954-if0wk\n verdict: NONE\n uuid: $OPERATION_ID\n ```\n 4. Repeat the previous step until `state` is set to `FINISHED` indicating that the archive depoloyment is complete.\n 5. Run the following command to view all archive deployments in the `prod` environment: \n\n ```\n gcloud beta apigee archives list --environment=prod\n ```\n\n\n The following provides an example of the response: \n\n ```\n Using Apigee organization 'prod'\n ARCHIVE ID ENVIRONMENT DEPLOYED AT LABELS OPERATION STATUS\n vrytwbhso558oil53m prod 2021-04-20 21:20:53 release=052021.1 Deployed\n ```\n\n\u003cbr /\u003e\n\n**Congratulations!** You've successfully promoted your API archive to an Apigee production environment!"]]