Cloud Endpoints uses Google's Service Management to manage your API. When
you deployed your OpenAPI document using the
gcloud endpoints services
deploy command, the command used Service Management to create a
managed service for your API.
If you deleted a managed service using the
gcloud endpoints services delete
command, Service Management doesn't immediately delete the managed
service. Service Management disables the managed service for 30 days,
which allows you time to restore it if you need to. After 30 days,
Service Management permanently deletes the managed service.
While the managed service is in the disabled state, Service Management doesn't allow the creation of another managed service with the same name.
To restore a managed service:
Make sure that the Cloud SDK (gcloud) is authorized to access your data and services on Google Cloud Platform:
gcloud auth login
Restore the managed service:
gcloud endpoints services undelete [SERVICE_NAME]
This command restores the managed service and assigns it to the GCP project that it was originally created in.
gcloud endpoints services undelete command fails with a permission
error similar to:
ERROR: (gcloud.endpoints.services.undelete) User [EMAIL] does not have permission to access service
gcloud auth loginand make sure to choose a user account that has permission to access the project that the managed service is in.
Make sure you have been granted the Service Management Administrator IAM role (roles/servicemanagement.admin).
For information on the Service Management Administrator IAM role, see Roles that control access to services.
For information on how to grant IAM roles to a user, see Granting, changing, and revoking access to resources.
For information on the
gcloudcommands used on this page, see the gcloud reference page.
For information on Service Management, see Creating and deleting managed services.