Cloud Endpoints menggunakan Pengelolaan Layanan untuk mengelola API Anda. Saat Anda men-deploy dokumen OpenAPI menggunakan perintah gcloud endpoints services
deploy, perintah tersebut menggunakan Pengelolaan Layanan untuk membuat layanan terkelola untuk API Anda.
Jika Anda menghapus layanan terkelola menggunakan perintah gcloud endpoints services delete, Pengelolaan Layanan tidak akan langsung menghapus layanan terkelola. Pengelolaan Layanan menonaktifkan layanan terkelola selama 30 hari, sehingga Anda memiliki waktu untuk memulihkannya jika diperlukan. Setelah 30 hari,
Pengelolaan Layanan akan menghapus layanan terkelola secara permanen.
Saat layanan terkelola dalam status dinonaktifkan, Pengelolaan Layanan
tidak mengizinkan pembuatan layanan terkelola lain dengan nama yang sama.
Untuk memulihkan layanan terkelola:
Pastikan Google Cloud CLI (gcloud) diberi otorisasi untuk mengakses data dan layanan Anda di Google Cloud:
gcloud auth login
Pulihkan layanan terkelola dan tetapkan ke projectGoogle Cloud tempat layanan tersebut awalnya dibuat. Ganti
[SERVICE_NAME] dengan nama layanan terkelola Anda.
gcloudendpointsservicesundelete[SERVICE_NAME]
Pemecahan masalah
Jika perintah gcloud endpoints services undelete gagal dengan error izin
yang mirip dengan:
ERROR: (gcloud.endpoints.services.undelete) User [EMAIL] does not have permission to access service
Jalankan gcloud auth login dan pastikan untuk memilih akun pengguna yang memiliki izin untuk mengakses project tempat layanan terkelola berada.
Pastikan Anda telah diberi peran IAM Service Management Administrator (roles/servicemanagement.admin).
[[["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-08-18 UTC."],[[["\u003cp\u003eCloud Endpoints uses Service Management to manage APIs, and deploying an OpenAPI document creates a managed service.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a managed service through \u003ccode\u003egcloud\u003c/code\u003e disables it for 30 days, allowing for restoration, after which it is permanently deleted.\u003c/p\u003e\n"],["\u003cp\u003eWhile disabled, a managed service's name cannot be reused, preventing the creation of a new service with the same name.\u003c/p\u003e\n"],["\u003cp\u003eTo restore a managed service, use the command \u003ccode\u003egcloud endpoints services undelete [SERVICE_NAME]\u003c/code\u003e, ensuring you have the correct permissions.\u003c/p\u003e\n"],["\u003cp\u003eTroubleshooting permission errors during restoration involves verifying user account authorization and ensuring the Service Management Administrator IAM role is granted.\u003c/p\u003e\n"]]],[],null,["# Restoring a managed service\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/restore-managed-service \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nCloud Endpoints uses Service Management to manage your API. When\nyou deployed your OpenAPI document by using the `gcloud endpoints services\ndeploy` command, the command used Service Management to create a\nmanaged service for your API.\n\nIf you deleted a managed service by using the `gcloud endpoints services delete`\ncommand, Service Management doesn't immediately delete the managed\nservice. Service Management disables the managed service for 30 days,\nwhich allows you time to restore it if you need to. After 30 days,\nService Management permanently deletes the managed service.\n\nWhile the managed service is in the disabled state, Service Management\ndoesn't allow the creation of another managed service with the same name.\n\nTo restore a managed service:\n\n1. Make sure that the Google Cloud CLI (`gcloud`) is authorized to access your data\n and services on Google Cloud:\n\n gcloud auth login\n\n2. Restore the managed service and assign it to the\n Google Cloud project that it was originally created in. Replace\n `[SERVICE_NAME]` with the name of your managed service.\n\n gcloud endpoints services undelete [SERVICE_NAME]\n\nTroubleshooting\n---------------\n\nIf the `gcloud endpoints services undelete` command fails with a permission\nerror similar to: \n\n```\nERROR: (gcloud.endpoints.services.undelete) User [EMAIL] does not have permission to access service\n```\n\n\u003cbr /\u003e\n\n- Run `gcloud auth login` and make sure to choose a user account that has\n permission to access the project that the managed service is in.\n\n- Make sure you have been granted the Service Management Administrator IAM role\n (`roles/servicemanagement.admin`).\n\nWhat's next\n-----------\n\n- [Roles that control access to services](/endpoints/docs/frameworks/api-access-overview#roles_that_control_access_to_services).\n\n- [Granting, changing, and revoking access to resources](/iam/docs/granting-changing-revoking-access#grant_access).\n\n- See the\n [`gcloud` reference](/sdk/gcloud/reference)\n for more information on the `gcloud` commands used on this page."]]