我创建了一个谷歌云项目并启用了谷歌云密钥管理服务(KMS(API。我创建了两个钥匙圈。 keyring1
位于us-east1
,keyring2
位于global
。我创建了以下 java 程序来列出区域中的密钥环:
GoogleCredential credential = GoogleCredential.getApplicationDefault();
credential = credential.createScoped(CloudKMSScopes.all());
String keyRingPath = "projects/<<projectId>>/locations/global";
CloudKMS kms = new CloudKMS.Builder(httpTransport, jsonFactory, credential).setApplicationName("CloudKMS snippets").build();
ListKeyRingsResponse response = kms.projects().locations().keyRings().list(keyRingPath).execute();
System.out.println(response.getKeyRings());
我收到以下禁止错误:
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "This API is not acessible from your region.",
"reason" : "forbidden"
} ],
"message" : "This API is not acessible from your region.",
"status" : "PERMISSION_DENIED"
}
我是一名从事云KMS工作的工程师。
不幸的是,在各个国家/地区提供此服务有很多复杂性,我们没有关于何时或是否推出任何特定国家/地区的具体时间表。
任何对特定国家/地区的可用性感兴趣的人都应该与我们联系,看看是否有任何信息可用,并帮助我们确定优先级。
我正在尝试从印度调用云KMS API。看起来云 KMS 尚未在所有位置都可用。云 KMS 服务尚未在印度提供。单击此处了解提供云 KMS 的国家/地区列表。这就是为什么我收到This API is not acessible from your region.
错误的原因