Cloud Endpoints는 OpenAPI 문서의 host 필드에 서비스 이름으로 구성된 이름을 사용합니다.
API 서비스 이름은 Google Cloud에서 고유해야 합니다. Endpoints는 DNS 호환 이름을 사용하여 서비스를 식별하므로 API의 도메인 이름 또는 하위 도메인 이름을 서비스 이름으로 사용하는 것이 좋습니다. 이 방법을 따르면 Endpoints 서비스 페이지에 표시되는 서비스 이름이 API에 대한 요청에 사용된 이름과 일치하게 됩니다. 또한 서비스 이름과 도메인 이름이 같은 경우 API 사용자를 위한 Cloud Endpoints 포털을 만들 수 있습니다. Endpoints의 서비스 이름 요구사항은 다음과 같습니다.
도메인 이름 최대 길이는 253자(영문)입니다.
도메인 이름은 소문자로 시작해야 합니다.
점으로 구분된 도메인 이름의 각 섹션은 다음과 같은 요구사항을 충족해야 합니다.
소문자로 시작해야 합니다.
대시로 끝나서는 안 됩니다.
나머지 문자는 소문자, 숫자 또는 대시일 수 있습니다.
최대 길이는 63자입니다.
사용자 고유의 커스텀 도메인(예: example.com)을 등록하거나 Google에서 관리하는 도메인을 사용할 수 있습니다.
Google에서 관리하는 도메인 사용
Google은 cloud.goog 및 appspot.com 도메인을 소유하고 관리합니다.
Google에서 관리하는 도메인을 사용하려면 Google Cloud 프로젝트 ID를 서비스 이름의 일부로 사용해야 합니다. Google Cloud 프로젝트에는 전역에서 고유한 프로젝트 ID가 있으므로 이 요구사항은 고유한 서비스 이름을 갖도록 보장합니다.
사용되는 도메인 이름은 API를 호스팅할 백엔드에 따라 결정됩니다.
App Engine 가변형 환경에서 호스팅되는 API의 경우 appspot.com 도메인을 사용해야 하고, 서비스 이름은 다음 형식(여기서 YOUR_PROJECT_ID는 Google Cloud 프로젝트 ID)을 따라야 합니다.
YOUR_PROJECT_ID.appspot.com
App Engine에 API를 배포하면 YOUR_PROJECT_ID.appspot.com 형식의 이름을 가진 DNS 항목이 자동으로 생성됩니다.
Compute Engine, Google Kubernetes Engine, Kubernetes에서 호스팅되는 API의 경우 cloud.goog 도메인을 사용해야 하고, 서비스 이름은 다음 형식(여기서 YOUR_API_NAME은 API 이름)을 따라야 합니다.
Google에서 관리하는 도메인을 사용하지 않으려면 사용 권한이 있는 커스텀 도메인(예: myapi.mycompany.com)을 사용할 수 있습니다.
API 구성을 배포하기 전에 도메인의 소유권 확인 단계를 따르세요.
info.title
info.title 필드는 API의 사용자 친화적인 이름입니다. Google Cloud 콘솔의 Endpoints > 서비스 페이지에는 info.title 필드에 구성한 텍스트가 표시됩니다. Google Cloud 프로젝트별로 API가 2개 이상 있으면 페이지를 처음 열 때 API 이름이 목록에 표시됩니다. API의 이름을 클릭하면 API의 측정항목, 배포 기록, 기타 정보가 표시된 또 다른 페이지가 열립니다.
info.version
Google Cloud 콘솔의 Endpoints > 서비스 페이지에 API의 버전 번호가 표시됩니다. API 구성을 처음으로 배포하기 전에 다음을 수행하세요.
info.version 필드의 버전 번호를 해당 API 버전으로 설정합니다(예: 1.0).
OpenAPI 사양에서 operationId 필드는 선택사항이지만, Endpoints에서는 내부적으로 작업을 식별하는 데 이 ID를 사용하므로 필수 항목입니다. operationId에 사용하는 문자열은 API 내에서 고유해야 합니다. 이름 지정에 관한 가이드는 OpenAPI 사양에서 operationId에 관한 설명을 참조하세요.
[[["이해하기 쉬움","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 supports APIs described using version 2.0 of the OpenAPI specification, allowing configuration of features like authentication and quotas within an OpenAPI document.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints uses specific fields within the OpenAPI document, including \u003ccode\u003ehost\u003c/code\u003e, \u003ccode\u003einfo.title\u003c/code\u003e, \u003ccode\u003einfo.version\u003c/code\u003e, and \u003ccode\u003eoperationId\u003c/code\u003e, for service identification and display within the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ehost\u003c/code\u003e field determines the service name, which must be unique on Google Cloud and is recommended to match the API's domain or subdomain name for consistency and potential use with Cloud Endpoints Portal.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003einfo.title\u003c/code\u003e field provides a user-friendly name for the API, displayed in the Endpoints Services page, and \u003ccode\u003einfo.version\u003c/code\u003e specifies the API's version number.\u003c/p\u003e\n"],["\u003cp\u003eAlthough optional in the OpenAPI Specification, \u003ccode\u003eoperationId\u003c/code\u003e is required by Endpoints for internal operation identification, and its value must be unique within the API.\u003c/p\u003e\n"]]],[],null,["# Configuring Cloud Endpoints\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/configure-endpoints \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nCloud Endpoints supports APIs that are described using version 2.0 of\nthe [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md).\nYou describe the API [surface](/endpoints/docs/openapi/glossary#surface) and\nconfigure Endpoints features such as\n[authentication rules](/endpoints/docs/openapi/authentication-method) or\n[quotas](/endpoints/docs/openapi/quotas-overview) in an\n[OpenAPI document](/endpoints/docs/openapi/glossary#open_api_doc).\n\nEndpoints makes special use of the following required fields in\nyour OpenAPI document:\n\n- `host`\n- `info.title`\n- `info.version`\n- `operationId`\n\nThis page provides information about how Endpoints uses the\npreceding fields. With this information, you can finish preparing your OpenAPI\ndocument for [deployment](/endpoints/docs/openapi/deploy-endpoints-config).\n\nPrerequisites\n-------------\n\nAs a starting point, this page assumes that you have:\n\n- A [Google Cloud project](/resource-manager/docs/creating-managing-projects).\n- Basic knowledge of [OpenAPI](/endpoints/docs/openapi/openapi-overview).\n- An OpenAPI document in the format described in the [Swagger basic structure](https://swagger.io/docs/specification/2-0/basic-structure/) documentation.\n\n`host`\n------\n\nCloud Endpoints uses the name you configure in the `host` field of your OpenAPI document as the name of your service.\n\nThe name of your API service must be unique on Google Cloud. Because\nEndpoints uses DNS-compatible names to identify services, we\nrecommend that you use your API's domain name or subdomain name as the service\nname. With this approach, the service name that appears on the **Endpoints\nServices** page matches the name used in requests to your API.\nEndpoints has the following requirements for the service name:\n\nYou can either register your own custom domain (such as `example.com`), or\nyou can use a domain managed by Google.\n\n### Use a domain managed by Google\n\nGoogle owns and manages the `cloud.goog` and the `appspot.com` domains. If you want to use a domain managed by Google, you must use your Google Cloud project ID as part of the service name. Because Google Cloud projects have a globally unique project ID, this requirement ensures that you have a unique service name.\n\n\u003cbr /\u003e\n\nThe domain name that you use depends on the backend that hosts your API:\n\n- For APIs that are hosted on the App Engine flexible environment, you must\n use the `appspot.com` domain, and the service name must be in the following\n format, where \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e is your\n Google Cloud project ID:\n\n ```\n YOUR_PROJECT_ID.appspot.com\n ```\n\n When you deploy your API to App Engine, a DNS entry with a name in\n the format \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e`.appspot.com` is created\n automatically.\n- For APIs that are hosted on Compute Engine, Google Kubernetes Engine, or\n Kubernetes, you must use the `cloud.goog` domain, and the service name must\n be in the following format, where \u003cvar translate=\"no\"\u003eYOUR_API_NAME\u003c/var\u003e is\n the name of your API:\n\n ```\n YOUR_API_NAME.endpoints.YOUR_PROJECT_ID.cloud.goog\n ```\n\n To use this domain as the API's domain name, read\n [Configuring DNS on the `cloud.goog` domain](/endpoints/docs/openapi/cloud-goog-dns-configure).\n\n### Use a custom domain\n\nIf you don't want to use a domain managed by Google, you can use a custom domain\n(for example, `myapi.mycompany.com`) that you are authorized to use.\nBefore you deploy the API configuration, follow the steps in\n[Verify ownership of the domain](/endpoints/docs/openapi/verify-domain-name).\n\n`info.title`\n------------\n\nThe `info.title` field is a user-friendly name for your API. The\n**Endpoints** \\\u003e **Services** page in the Google Cloud console displays the\ntext that you configure in the `info.title` field. If you have more than\none API per Google Cloud project, the API name is displayed in a list when you\nfirst open the page. You can click on the API name to open another page\nthat displays the API's metrics, deployment history, and other information.\n\n`info.version`\n--------------\n\nThe **Endpoints** \\\u003e **Services** page in the Google Cloud console displays the\nversion number for your API. Before deploying your API configuration for the\nfirst time:\n\n- Set the version number in the `info.version` field to the applicable\n API version,for example, `1.0`.\n\n- Set the `basePath` field to the major version number, for example, `/v1`.\n\nFor additional information on versioning your API, see\n[API lifecycle management](/endpoints/docs/openapi/lifecycle-management).\n\n`operationId`\n-------------\n\nAlthough the `operationId` is an optional field in the OpenAPI Specification,\nEndpoints requires this field because it is used for internal\nidentification of the operation. The string that you use for the `operationId`\nmust be unique within your API. See the description for\n[`operationId`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operation-object)\nin the OpenAPI Specification for guidance on naming.\n\nWhat's next\n-----------\n\n- [Deploying the Endpoints configuration](/endpoints/docs/openapi/deploy-endpoints-config)\n- [Deploying the API backend](/endpoints/docs/openapi/deploy-api-backend)\n- [Configuring authentication](/endpoints/docs/openapi/authentication-method)"]]