Cloud Location Finder 문제 해결

이 페이지에서는 Cloud Location Finder 문제를 해결하는 방법을 보여줍니다.

API에서 403 오류가 반환됨

다음 문제는 다음과 같은 경우에 발생합니다.

프로젝트에서 Cloud Location Finder가 사용 설정되어 있지 않음

{
  "error": {
    "code": 403,
    "message": "Cloud Location Finder API has not been used in project PROJECT_ID before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudlocationfinder.googleapis.com/overview?project=PROJECT_ID then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "SERVICE_DISABLED",
        "domain": "googleapis.com",
        "metadata": {
          "activationUrl": "https://console.developers.google.com/apis/api/cloudlocationfinder.googleapis.com/overview?project=PROJECT_ID",
          "serviceTitle": "Cloud Location Finder API",
          "service": "cloudlocationfinder.googleapis.com",
          "containerInfo": "PROJECT_ID",
          "consumer": "projects/PROJECT_ID"
        }
      },
      {
        "@type": "type.googleapis.com/google.rpc.LocalizedMessage",
        "locale": "en-US",
        "message": "Cloud Location Finder API has not been used in project PROJECT_ID before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudlocationfinder.googleapis.com/overview?project=PROJECT_ID then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
      },
      {
        "@type": "type.googleapis.com/google.rpc.Help",
        "links": [
          {
            "description": "Google developers console API activation",
            "url": "https://console.developers.google.com/apis/api/cloudlocationfinder.googleapis.com/overview?project=PROJECT_ID"
          }
        ]
      }
    ]
  }
}

이 문제를 해결하려면 프로젝트에서 Cloud Location Finder API를 사용 설정하세요. 자세한 내용은 빠른 시작을 참고하세요.

리소스에 대한 권한이 없습니다.

{
  "error": {
    "code": 403,
    "message": "Permission 'cloudlocationfinder.cloudLocations.list' denied on resource '//cloudlocationfinder.googleapis.com/projects/PROJECT_ID/locations/global' (or it may not exist).",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "IAM_PERMISSION_DENIED",
        "domain": "cloudlocationfinder.googleapis.com",
        "metadata": {
          "resource": "projects/PROJECT_ID/locations/global",
          "permission": "cloudlocationfinder.cloudLocations.list"
        }
      }
    ]
  }
}

이 문제를 해결하려면 쿼리에서 참조할 리소스가 있는 프로젝트에 cloudlocationfinder.viewer 역할을 추가합니다. 자세한 내용은 빠른 시작을 참고하세요.

API에서 400 오류가 반환됨

쿼리가 유효하지 않으면 다음 문제가 발생합니다.

$ curl -H "Authorization: Bearer $(gcloud auth print-access-token)" 'https://cloudlocationfinder.googleapis.com/v1/projects/PROJECT_ID/locations/global/cloudLocations?filter=cloud_location_type=FAKE_LOCATION'
{
  "error": {
    "code": 400,
    "message": "Bad usage: Invalid enum name \"FAKE_LOCATION\" for type `cloud.reliability.cloudlocationfinder.storage.CloudLocation.CloudLocationType`.",
    "status": "INVALID_ARGUMENT",
    "details": [
...
}

이 문제를 해결하려면 오류 메시지를 검토하세요. 쿼리 구문 및 허용되는 구문에 관한 안내는 REST API 참조를 참고하세요.