[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\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."]]