プロジェクトで Service Management API と Service Control API を有効にします。
プロジェクトで Cloud Billing を有効にします。サービスを Service Infrastructure と統合するには、Service Control API、Cloud Logging API、Cloud Monitoring API など、いくつかの有料の Google Cloud プロダクトを利用します。
Service Management API は、サービス管理用の宣言型モデルを使用します。
サービスが作成されたら、サービスの目的の状態に到達するために不変のサービス構成とサービス ロールアウトを push する必要があります。サービス構成は、Cloud Billing、Cloud Logging、Cloud Monitoring、Identity and Access Management を含むサービスをサポートする Google Cloud インフラストラクチャ サービスを構成するために使用します。
[[["わかりやすい","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 UTC。"],[],[],null,["# Managing Service Lifecycles\n\nThis page describes how to manage the lifecycles of\n[managed services](/service-infrastructure/docs/glossary#managed) using the Google Cloud CLI\n[`gcloud endpoints services`](https://cloud.google.com/sdk/gcloud/reference/endpoints/services)\ncommands.\n\nFor advanced use cases, you can use the Service Management API\nto manage services programmatically. For more information, see\n[Getting Started with the Service Management\nAPI](/service-infrastructure/docs/service-management/getting-started)\n\nIntroduction\n------------\n\nA [managed service](/service-infrastructure/docs/service-management/reference/rest/v1/services)\nis a simple resource that logically represents a service integrated with Service\nInfrastructure, such as Gmail API and Spanner API. A managed service itself\nhas only two immutable properties, a *service name* and a *producer project* ,\nbut the implementation of a managed service can provide a wide range of\nfunctionality. For example, [Cloud Storage API](/storage/docs) provides\nplanet-scale object storage for millions of developers and enterprises.\n\nA managed service has a set of\n[service consumers](/service-infrastructure/docs/service-management/reference/rest/v1/services.consumers),\na history of immutable\n[service configurations](/service-infrastructure/docs/service-management/reference/rest/v1/services.configs),\nand a history of immutable\n[service rollouts](/service-infrastructure/docs/service-management/reference/rest/v1/services.rollouts).\nThe service configurations referenced by the latest service rollout represents\nthe current state of the service, which covers all aspects of the service, from\nthe display name to metrics definitions to rate limits. For the specification,\nsee\n[`google.api.Service`](https://github.com/googleapis/googleapis/blob/master/google/api/service.proto#L73).\n\nWe will describe how to create and manage your service lifecycles in this page.\nFor more information about the service management, see\n[How-to Guides](/service-infrastructure/docs/how-to).\n\nCreating a service\n------------------\n\nTo create a service, you need to complete the following steps.\n\n1. Install and initialize\n [gcloud CLI](https://cloud.google.com/sdk/docs/initializing) on your\n computer.\n\n2. Create a dedicated producer project to host your service. A dedicated\n project provides the best security and isolation for your service.\n It also allows you to transfer the ownership of your service to another\n team or even another company.\n\n3. Enable the Service Management API and Service Control API for your project.\n\n4. Enable Cloud Billing for your project. To integrate your service with\n Service Infrastructure, you will depend on several paid Google Cloud\n products, including the Service Control API, Cloud Logging API, and\n Cloud Monitoring API.\n\n5. Prepare a simple service configuration yaml file for your service\n as follows:\n\n # Filename: endpointsapis.yaml\n type: google.api.Service\n config_version: 3\n # Update the next line to use your own service name.\n name: endpointsapis.appspot.com\n # Update the next line to use your own producer project id.\n producer_project_id: endpointsapis\n\n6. Run `gcloud` command to create your service by deploying a blank service\n configuration:\n\n gcloud endpoints services deploy endpointsapis.yaml\n\nThe service creation process takes about a minute. After that, you should be\nable to see your service listed on the\n[Endpoints](https://console.cloud.google.com/endpoints?project=_) page\nin Google Cloud console.\n\nListing services\n----------------\n\nTo list services in a project, you can use the following command: \n\n gcloud endpoints services list --project endpointsapis\n\nDescribing a service\n--------------------\n\nTo describe a service and its configuration, you can use the following command: \n\n gcloud endpoints services describe endpointsapis.appspot.com\n\nDeleting a service\n------------------\n\nIf you no longer need a service, you can delete it using the following command: \n\n gcloud endpoints services delete endpointsapis.appspot.com\n\nNOTE: Every service has a mandatory 30-day deletion retention.\n\nUndeleting a service\n--------------------\n\nYou can undelete a service within its retention window using the following\ncommand: \n\n gcloud endpoints services undelete endpointsapis.appspot.com\n\nNext steps\n----------\n\nThe Service Management API uses a declarative model for service management.\nAfter the service is created, you need to push immutable service\nconfigurations and service rollouts to reach the desired state\nof your service. Your service configurations are used to configure\nGoogle Cloud infrastructure services to support your service,\nincluding Cloud Billing, Cloud Logging, Cloud Monitoring, and\nIdentity and Access Management.\n\nFor more information about service configurations, see\n[Managing Service Configurations](/service-infrastructure/docs/manage-config).\nFor more information about service rollouts, see\n[Managing Service Rollouts](/service-infrastructure/docs/rollout)."]]