Cloud Endpoints에서는 Extensible Service Proxy(ESP) 및 Service Management를 사용하여 API를 관리합니다. gcloud endpoints services deploy 명령어로 서비스 구성을 배포할 때 이 명령어는 Service Management를 사용하여 API의 관리형 서비스를 만들었습니다.
API를 삭제하려면 다음 안내를 따르세요.
ESP 및 API 백엔드가 실행 중인 인스턴스를 삭제합니다.
API용으로 만든 관리형 서비스를 삭제합니다.
이러한 태스크를 모두 수행하는 가장 쉬운 방법은 API가 있는 Google Cloud 프로젝트를 삭제하는 것입니다. Google Cloud 프로젝트를 보존하려면 인스턴스와 관리형 서비스를 삭제해야 합니다.
인스턴스 삭제
Compute Engine
gcloud compute instances delete 명령어를 사용합니다. 이러한 방식으로 인스턴스를 삭제하면 인스턴스가 종료되고 인스턴스 목록에서 삭제됩니다. 인스턴스에 연결된 모든 리소스(예: 영구 디스크 및 고정 IP 주소)는 해제됩니다.
Endpoints 서비스 페이지와 로그 탐색기 페이지의 생성된 API 로그에 있는 데이터가 필요하지 않으면 API의 관리형 서비스를 삭제할 수 있습니다. 이렇게 하면 Google Cloud Console에서 데이터가 삭제됩니다.
관리형 서비스를 삭제하려면 다음 단계를 따르세요.
gcloud CLI(gcloud)에 Google Cloud의 데이터 및 서비스에 액세스할 수 있는 권한이 있는지 확인합니다.
gcloud auth login
다음을 입력하여 Google Cloud 프로젝트의 프로젝트 ID를 표시합니다.
gcloud projects list
이전 단계의 해당 프로젝트 ID를 사용하여 기본 Google Cloud 프로젝트를 애플리케이션이 있는 프로젝트로 설정합니다.
gcloudconfigsetproject[YOUR_PROJECT_ID]
Google Cloud 프로젝트에서 모든 관리형 서비스의 이름을 가져옵니다.
gcloud endpoints services list
Service Management에서 서비스를 삭제합니다. SERVICE_NAME은 삭제할 서비스 이름으로 바꿉니다.
gcloud endpoints services delete SERVICE_NAME
gcloud endpoints services delete를 실행해도 관리형 서비스가 즉시 삭제되지는 않습니다. Service Management에서 30일 동안 관리형 서비스가 사용 중지되므로 필요한 경우 복원할 수 있습니다. 30일 이후에는 Service Management에서 관리형 서비스가 영구적으로 삭제됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eCloud Endpoints utilizes the Extensible Service Proxy (ESP) and Service Management to oversee your API, which is initially set up via the \u003ccode\u003egcloud endpoints services deploy\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eDeleting an API involves either removing the Google Cloud project entirely or specifically deleting the instance hosting ESP and the API backend, along with the associated managed service.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine instances can be deleted using the \u003ccode\u003egcloud compute instances delete\u003c/code\u003e command, while GKE clusters can be deleted using the \u003ccode\u003egcloud container clusters delete\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eManaged services for APIs can be deleted via \u003ccode\u003egcloud endpoints services delete\u003c/code\u003e, which disables the service for a 30-day grace period before permanent deletion.\u003c/p\u003e\n"],["\u003cp\u003eIf you do not want to lose any data, you do not have to delete the Managed Service.\u003c/p\u003e\n"]]],[],null,["# Deleting an API and API instances\n\n[OpenAPI](/endpoints/docs/openapi/deleting-an-api-and-instances \"View this page for the Cloud Endpoints OpenAPI docs\") \\| gRPC\n\n\u003cbr /\u003e\n\nCloud Endpoints uses the\n[Extensible Service Proxy (ESP)](/endpoints/docs/grpc/glossary#extensible_service_proxy)\nand Service Management to manage your API. When you deployed your\nservice configuration by using the `gcloud endpoints services deploy` command, the\ncommand used Service Management to create a managed service for your API.\n\nTo delete your API you need to:\n\n- Delete the instance that ESP and your API backend is running on.\n- Delete the managed service that was created for your API.\n\nThe easiest way to do both of these tasks is to delete the Google Cloud\nproject that your API is in. If you want to preserve your\nGoogle Cloud project, then you need to delete the instance and the managed\nservice.\n| **Note:** If you encounter issues with Google Cloud project deletion, refer to the [troubleshooting](/resource-manager/docs/troubleshooting-project-deletion) section for resolution.\n\nDeleting instances\n------------------\n\n### Compute Engine\n\nUse the [`gcloud compute instances delete`](/sdk/gcloud/reference/compute/instances/delete)\ncommand. When you delete an instance in this way, the instance shuts down and\nis removed from the list of instances, and all resources attached to the\ninstance are released, such as persistent disks and any static IP addresses.\n\nTo delete an instance, use the following command: \n\n```transact-sql\ngcloud compute instances delete [INSTANCE_NAME] --zone = [ZONE]\n```\n\nFor more information on deleting Compute Engine instances, see the\n[Compute Engine documentation](/compute/docs/instances/stopping-or-deleting-an-instance).\n\n### GKE\n\nTo delete a GKE cluster with the Google Cloud CLI: \n\n```transact-sql\ngcloud container clusters delete [NAME] --zone [ZONE]\n```\n\nReplace `[NAME]` with the name of your cluster and\n`[ZONE]` with the compute zone that the cluster is in.\n\nFor more information on deleting a GKE cluster, see the\n[GKE documentation](/kubernetes-engine/docs/how-to/deleting-a-cluster).\n\nDeleting the managed service\n----------------------------\n\nIf you don't need the data on the **Endpoints Services** page and in the\n**Produced API** log on the **Logs Explorer** page, you can delete the managed\nservice for your API, which removes the data from the Google Cloud console.\n\nTo delete the managed service:\n\n1. Make sure that the gcloud CLI (`gcloud`) is authorized to access your\n data and services on Google Cloud:\n\n gcloud auth login\n\n2. Enter the following to display the project IDs for your Google Cloud\n projects:\n\n gcloud projects list\n\n3. Using the applicable project ID from the previous step, set the default\n Google Cloud project to the one that your application is in:\n\n gcloud config set project [YOUR_PROJECT_ID]\n\n4. Obtain the name of all managed services in your Google Cloud project:\n\n gcloud endpoints services list\n\n5. Delete the service from Service Management. Replace\n \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e with the name of the service you want\n to remove.\n\n ```\n gcloud endpoints services delete SERVICE_NAME\n ```\n\n Running `gcloud endpoints services delete` doesn't immediately delete the\n managed service. Service Management disables the managed service for\n 30 days, which allows you time to restore it if you need to. After 30 days,\n Service Management permanently deletes the managed service.\n\nWhat's next\n-----------\n\n- To restore a managed service, see\n [Restoring a managed service](/endpoints/docs/grpc/restore-managed-service).\n\n- For information on the `gcloud` commands used on this page, see the\n [gcloud reference](/sdk/gcloud/reference).\n\n- For information on Service Management, see\n [Creating and deleting managed services](/service-infrastructure/docs/create-services)."]]