Auf dieser Seite erfahren Sie, wie Sie Probleme mit Cloud Location Finder beheben.
Die API gibt einen 403-Fehler zurück
Das folgende Problem tritt auf, wenn:
- Cloud Location Finder ist in Ihrem Projekt nicht aktiviert
- Sie haben keine Berechtigung für eine Ressource
Cloud Location Finder ist in Ihrem Projekt nicht aktiviert
{
"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"
}
]
}
]
}
}
Um dieses Problem zu beheben, aktivieren Sie die Cloud Location Finder API in Ihrem Projekt. Eine Anleitung dazu finden Sie in der Kurzanleitung.
Sie haben keine Berechtigung für eine Ressource
{
"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"
}
}
]
}
}
Um dieses Problem zu beheben, fügen Sie die Rolle cloudlocationfinder.viewer Projekten mit Ressourcen hinzu, auf die Sie in einer Abfrage verweisen möchten. Eine Anleitung dazu finden Sie in der Kurzanleitung.
Die API gibt einen 400-Fehler zurück
Das folgende Problem tritt auf, wenn eine Abfrage ungültig ist:
$ 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": [
...
}
Sehen Sie sich die Fehlermeldung an, um das Problem zu beheben. Informationen zur Abfragesyntax und zur zulässigen Syntax finden Sie in der REST API-Referenz.