전역 엔드포인트를 통한 호출에서는 멀티 리전 엔드포인트를 사용하여 생성된 리소스에 액세스할 수 없습니다. 마찬가지로 멀티 리전 엔드포인트를 통한 호출에서는 전역 엔드포인트를 사용하여 생성된 리소스에 액세스할 수 없습니다.
리소스 위치 제한
조직 정책 관리자는 리소스 위치 제약조건을 만들어 Cloud Translation - Advanced 리소스에 사용 가능한 리전을 제한할 수 있습니다. 이렇게 하면 Cloud Translation - Advanced 사용자가 특정 위치에만 리소스를 만들 수 있습니다.
전역 API 엔드포인트 사용 제한
조직 정책 관리자는 리전 엔드포인트 사용을 강제하기 위해 constraints/gcp.restrictEndpointUsage 조직 정책 제약 조건을 사용하여 전역 API 엔드포인트에 대한 요청을 차단할 수 있습니다. 자세한 내용은 엔드포인트 사용 제한을 참고하세요.
엔드포인트 지정
다음 예시에서는 멀티 리전 엔드포인트를 사용하는 텍스트 번역을 보여줍니다. 클라이언트 라이브러리를 사용하는 경우 API 엔드포인트를 클라이언트 옵션의 일부로 설정합니다. 일부 예시를 보려면 Cloud Natural Language API 가이드에서 클라이언트 라이브러리를 사용하여 위치 설정을 참조하세요.
REST
요청 데이터를 사용하기 전에 다음을 바꿉니다.
PROJECT_NUMBER_OR_ID: Google Cloud 프로젝트의 숫자 또는 영숫자 ID
ENDPOINT: 데이터가 있는 위치를 결정하는 리전 엔드포인트입니다. 예를 들면 translate-eu.googleapis.com입니다.
LOCATION: 이 작업을 실행할 리전입니다. 리전 엔드포인트의 대륙 경계 내에 있는 리전을 선택해야 합니다. 예를 들어 translate-eu.googleapis.com 엔드포인트를 사용하는 경우 europe-west1과 같은 유럽 리전을 지정해야 합니다.
HTTP 메서드 및 URL:
POST https://ENDPOINT/v3/projects/PROJECT_NUMBER_OR_ID/locations/LOCATION:translateText
[[["이해하기 쉬움","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,["# Global and multi-regional endpoints\n===================================\n\nCloud Translation - Advanced offers a global endpoint as well as EU and US\nmulti-regional endpoints:\n\n- `translate.googleapis.com` (global)\n- `translate-eu.googleapis.com`\n- `translate-us.googleapis.com`\n\nIf you use a multi-regional endpoint, your data at-rest and machine learning\nprocessing stays within the continental boundaries of the EU or US. These\nmulti-regional endpoints are important if your data's location must be\ncontrolled to comply with local regulatory requirements.\n\nIf you don't specify an endpoint, Cloud Translation - Advanced uses the global\nendpoint by default.\n\nGlobal versus multi-regional endpoints\n--------------------------------------\n\nWhen using a multi-regional endpoint, there are some difference when compared to\nusing the global endpoint:\n\n- Text translations that use custom AutoML models are not supported. You can use only the pre-trained NMT model.\n- Features that are not GA (still in [Preview](/products#product-launch-stages)) are not supported.\n- Calls through the global endpoint cannot access resources that were created by using a multi-regional endpoint. Similarly, calls through a multi-regional endpoint cannot access resources that were created by using the global endpoint.\n\nRestricting resource locations\n------------------------------\n\nOrganization policy administrators can restrict the regions available for\nCloud Translation - Advanced resources by [creating a resource locations\nconstraint](/resource-manager/docs/organization-policy/defining-locations). If\nset, Cloud Translation - Advanced users would be able to create resources only in a\nparticular location.\n\nRestricting global API endpoint usage\n-------------------------------------\n\nTo help enforce the use of regional endpoints, organization policy\nadministrators can use the `constraints/gcp.restrictEndpointUsage` organization\npolicy constraint to block requests to the global API endpoint. For more\ninformation, see [Restricting endpoint\nusage](/assured-workloads/docs/restrict-endpoint-usage).\n\nSpecify an endpoint\n-------------------\n\nThe following example shows a text translation that uses a multi-regional\nendpoint. If you use the client libraries, set the API endpoint as part of the\nclient options. For some examples, see [Setting the location using client\nlibraries](/natural-language/docs/locations#setting_the_location_using_client_libraries)\nin the Cloud Natural Language API guide. \n\n### REST\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_NUMBER_OR_ID\u003c/var\u003e: the numeric or alphanumeric ID of your Google Cloud project\n- \u003cvar translate=\"no\"\u003eENDPOINT\u003c/var\u003e: Regional endpoint, which determines where your data resides. For example, `translate-eu.googleapis.com`.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Region where you want to run this operation. You must pick a region inside the continental boundary of the regional endpoint. For example, if you use the `translate-eu.googleapis.com` endpoint, specify a region in Europe such as `europe-west1`.\n\n\nHTTP method and URL:\n\n```\nPOST https://ENDPOINT/v3/projects/PROJECT_NUMBER_OR_ID/locations/LOCATION:translateText\n```\n\n\nRequest JSON body:\n\n```\n{\n \"model\": \"projects/PROJECT_NUMBER_OR_ID/locations/LOCATION/models/general/base\",\n \"sourceLanguageCode\": \"en\",\n \"targetLanguageCode\": \"de\",\n \"contents\": [\"Come here!\"]\n}\n```\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\ncurl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: PROJECT_NUMBER_OR_ID\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d @request.json \\\n \"https://ENDPOINT/v3/projects/PROJECT_NUMBER_OR_ID/locations/LOCATION:translateText\"\n```\n\n#### PowerShell\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\"; \"x-goog-user-project\" = \"PROJECT_NUMBER_OR_ID\" }\n\nInvoke-WebRequest `\n -Method POST `\n -Headers $headers `\n -ContentType: \"application/json; charset=utf-8\" `\n -InFile request.json `\n -Uri \"https://ENDPOINT/v3/projects/PROJECT_NUMBER_OR_ID/locations/LOCATION:translateText\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"translations\": [\n {\n \"translatedText\": \"Komm her!\",\n \"model\": \"projects/PROJECT_NUMBER_OR_ID/locations/LOCATION/models/general/base\"\n }\n ]\n}\n```\n\n\u003cbr /\u003e"]]