Dengan melampirkan lingkungan ke grup, proxy di lingkungan tersebut dapat dirutekan melalui nama host dalam grup. Tindakan ini memicu operasi yang berjalan lama yang dapat memerlukan waktu beberapa menit untuk diselesaikan. Sebaiknya tunggu satu atau dua menit sebelum melanjutkan ke langkah berikutnya. Sementara itu, Anda dapat memeriksa status operasi seperti sebelumnya.
Buat lingkungan prod baru di lingkungan pengembangan lokal Anda:
Di Apigee di VS Code, posisikan kursor Anda di atas folder environments di bagian Apigee, lalu klik .
Wizard Buat lingkungan akan terbuka.
Masukkan prod untuk nama lingkungan, lalu tekan Enter.
Lingkungan telah dibuat.
Luaskan folder lingkungan prod di bagian Apigee untuk melihat isinya.
Arahkan kursor ke file deployments.json di bagian Apigee, lalu klik .
Wizard Deployments akan terbuka.
Pilih proxy API helloworld untuk menambahkannya ke deployment, lalu klik OK.
File deployments.json akan dibuka di editor. File telah diupdate untuk menyertakan proxy API helloworld dalam array deployment proxies, seperti yang ditunjukkan di bawah:
Ulangi langkah sebelumnya hingga state disetel ke FINISHED yang menunjukkan bahwa deployment arsip telah selesai.
Jalankan perintah berikut untuk melihat semua deployment arsip di lingkungan prod:
gcloud beta apigee archives list --environment=prod
Berikut adalah contoh respons:
Using Apigee organization 'prod'
ARCHIVE ID ENVIRONMENT DEPLOYED AT LABELS OPERATION STATUS
vrytwbhso558oil53m prod 2021-04-20 21:20:53 release=052021.1 Deployed
Selamat! Anda telah berhasil mempromosikan arsip API ke lingkungan produksi Apigee.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 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!"]]