Obtenir le nom du service et l'ID de configuration

Pour déployer votre document OpenAPI, exécutez la commande gcloud endpoints services deploy. La première fois que vous déployez votre document OpenAPI, la commande gcloud appelle une API Service Management pour créer un service géré, en utilisant le nom spécifié dans le champ host de votre document OpenAPI. Service Management attribue automatiquement un ID de configuration, composé d'un horodatage suivi d'un numéro de révision. Par exemple, 2017-02-13r0 :

Si vous déployez à nouveau la configuration de votre service le même jour, Service Management incrémente le numéro de révision dans l'ID de configuration. Si vous déployez à nouveau votre configuration de service un autre jour, Service Management attribue un nouvel horodatage à l'ID de configuration et réinitialise le numéro de révision à 0.

Cloud Endpoints utilise Service Management pour stocker les configurations de service. Service Management ne stocke que les 100 dernières configurations de service.

Cette page explique comment afficher le nom de votre service et les identifiants de configuration.

Google Cloud console

  1. In the Google Cloud console, go to the Endpoints > Services page for your project.

    Go to the Endpoints Services page

  2. If you have more than one API, select an API from the list.
  3. Click the Deployment history tab.
  4. 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

  1. Enter the following to display the project IDs for your Google Cloud projects:
    gcloud projects list
  2. 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
  3. Get a list of services in your project:
    gcloud endpoints services list
  4. 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.

Étapes suivantes