Untuk men-deploy dokumen OpenAPI, Anda menjalankan perintah
gcloud endpoints services deploy. Saat pertama kali Anda men-deploy dokumen OpenAPI, perintah gcloud akan memanggil Service Management API untuk membuat layanan terkelola menggunakan nama yang Anda tentukan di kolom host dokumen OpenAPI.
Service Management secara otomatis menetapkan ID konfigurasi, yang
terdiri dari stempel tanggal yang diikuti dengan nomor revisi. Contoh:
2017-02-13r0
Jika Anda men-deploy konfigurasi layanan lagi pada hari yang sama, Service Management akan menaikkan nomor revisi di ID konfigurasi. Jika Anda men-deploy konfigurasi layanan lagi pada hari lain, Service Management akan menetapkan stempel tanggal baru ke ID konfigurasi dan mereset nomor revisi ke 0.
Endpoints menggunakan Pengelolaan Layanan untuk menyimpan konfigurasi layanan. Pengelolaan Layanan hanya menyimpan 100 konfigurasi layanan terbaru.
Halaman ini menjelaskan cara melihat nama layanan dan ID konfigurasi Anda.
Google Cloud console
- In the Google Cloud console, go to the Endpoints > Services page for your project.
- If you have more than one API, select an API from the list.
- Click the Deployment history tab.
The service name is displayed between the API name and the tabs, near the top-left side of the page. In the Service configuration deployments list, the configuration ID is displayed along with the date and the email address of the principal who deployed the configuration. The Service configuration deployments list displays the latest 100 configuration deployments. The most recent configuration is displayed at the top of the list.
gcloud
- Enter the following to display the project IDs for your
Google Cloud projects:
gcloud projects list
- Using the applicable project ID from the previous step, set the default
project to the one that your API is in:
gcloud config set project YOUR_PROJECT_ID
- Get a list of services in your project:
gcloud endpoints services list
- Using the applicable service name from the previous step, get a list of
configuration IDs for the service:
gcloud endpoints configs list --service=YOUR_SERVICE_NAME
For more information on the preceding commands, see the gcloud reference.
Langkah berikutnya
- Pelajari cara men-deploy dokumen OpenAPI.
- Pelajari Service Management API.