Python boto3 rds modify_db_snapshot_属性不执行任何操作
我想在rds快照上设置restore属性,这样我就可以从另一个帐户访问它们,下面是实现这一点的代码:Python boto3 rds modify_db_snapshot_属性不执行任何操作,python,amazon-rds,boto3,Python,Amazon Rds,Boto3,我想在rds快照上设置restore属性,这样我就可以从另一个帐户访问它们,下面是实现这一点的代码: params = dict(DBSnapshotIdentifier=snapshot_identifier, AttributeName=attribute_name) if remove: params['ValuesToRemove'] = [str(value)] else: params['Va
params = dict(DBSnapshotIdentifier=snapshot_identifier,
AttributeName=attribute_name)
if remove:
params['ValuesToRemove'] = [str(value)]
else:
params['ValuesToAdd'] = [str(value)]
response = self.client.modify_db_snapshot_attribute(**params)
当我运行该代码时,检查前后的属性以及响应值:
DBSnapshotAttributesResult {u'DBSnapshotIdentifier': 'test-api-db-restore01-snapshot-2016-04-01', u'DBSnapshotAttributes': [{u'AttributeName': 'restore', u'AttributeValues': []}]}
{u'DBSnapshotAttributesResult':{u'DBSnapshotIdentifier':'test-api-db-restore01-snapshot-2016-04-01',u'DBSnapshotAttributes':[{u'AttributeName':'restore',u'AttributeValue':[]}
DBSnapshotAttributesResult {u'DBSnapshotIdentifier': 'test-api-db-restore01-snapshot-2016-04-01', u'DBSnapshotAttributes': [{u'AttributeName': 'restore', u'AttributeValues': []}]}
我没有收到任何错误-只是之后的状态与之前相同。发生了什么?我如何使其工作?这在botocore的更新中得到修复在执行客户端之前显示参数值如何。修改\u db\u snapshot\u属性()?参数:{'ValuesToAdd':['ACCOUNT\u ID'],“DBSnapshotIdentifier”:“test-api-db-restore01-snapshot-2016-04-01”,“AttributeName”:“restore”}请检查特定帐户ID是否具有“RestoreDBInstanceFromDBSnapshot”的权限。如果“ValuesToAdd”中的“all”有效,请使用AWS控制台尝试共享快照选项。确保帐户ID是有效的AWS ID。