Die Dienstkonfiguration wird mit dem Befehl gcloud endpoints services deploy bereitgestellt. Wenn Sie Ihre Dienstkonfiguration zum ersten Mal bereitstellen, ruft der Befehl gcloud eine Dienstverwaltungs-API auf, um einen verwalteten Dienst unter Verwendung des Namens zu erstellen, den Sie im Feld name Ihrer YAML-Datei der Dienstkonfiguration angegeben haben. Service Management weist automatisch eine Konfigurations-ID zu, die aus einem Datumsstempel und einer Überarbeitungsnummer besteht. Beispiel: 2017-02-13r0.
Wenn Sie die Dienstkonfiguration am selben Tag noch einmal bereitstellen, erhöht Service Management die Überarbeitungsnummer in der Konfigurations-ID. Wird die Dienstkonfiguration an einem anderen Tag neu bereitgestellt, weist Service Management der Konfigurations-ID einen neuen Datumsstempel zu und setzt die Überarbeitungsnummer auf 0 zurück.
Endpoints verwendet Service Management zum Speichern von Dienstkonfigurationen. Service Management speichert nur die letzten 100 Dienstkonfigurationen.
Auf dieser Seite wird beschrieben, wie Sie den Namen Ihres Diensts und die zugehörige Konfigurations-ID abrufen.
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.
Weitere Informationen
- Weitere Informationen zum Bereitstellen einer Dienstkonfiguration
- Service Management API