出于某种原因,我似乎无法更新us-central1
区域中的键。我的IAM同时具有更新和列表角色,我使用以下代码:
import google.cloud.kms as kms
self.client = kms.KeyManagementServiceClient()
name = 'client-1'
key_path = self.client.crypto_key_path(config.PROJECT, config.KMS_LOCATION, config.KMS_RING, name)
update_mask = {'paths': ['rotation_period', 'next_rotation_time']}
self.client.update_crypto_key({
'name': key_path,
'rotation_period': {'seconds': 0},
'next_rotation_time': {'seconds': 0}
}, update_mask)
它给了我以下错误:
google.api_core.exceptions.NotFound: 404 The request concerns location 'us-central1' but was sent to location 'global'. Either Cloud KMS is not available in 'us-central1' or the request was misrouted.
奇怪的是,列表和get工作正常。我也看到了一个解决方案,他们改变了客户端的传输参数,但我似乎找不到正确的地址
提前谢谢
这是一个bug,我们正在https://github.com/googleapis/gapic-generator/issues/3066跟踪它
同时,该错误的原因是当第一个参数是
dict
时,UpdateCryptoKey无法正确计算区域。如果它是一个resources_pb2.CryptoKey
,那么它可以正常工作。例如:希望这能让你在解决这个问题的同时解决这个问题。对给您带来的不便表示歉意,并感谢您的耐心等待
相关问题 更多 >
编程相关推荐