import boto3
client = boto3.Session(profile_name='Sandbox').client('redshift')
response = client.create_tags(ResourceName='arn:aws:redshift:us-east-1:123456:snapshot:situation',
Tags=[ {'Key': 'k1', 'Value': 'v1'},{'Key': 'k2', 'Value': 'v2'}])
打印響應獲得一個錯誤,同時使用紅移博託
錯誤:
File "sai.py", line 5, in <module>
response = client.create_tags(ResourceName='arn:aws:redshift:us-east-1:123456:snapshot:situation',Tags=[ {'Key': 'k1', 'Value': 'v1'},{'Key': 'k2', 'Value': 'v2'}])
File "/Library/Python/2.7/site-packages/botocore/client.py", line 253, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Library/Python/2.7/site-packages/botocore/client.py", line 543, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CreateTags operation: The format of the provided snapshot identifier is invalid.
你能正確地格式化你的問題嗎? – kaveh
此外,閱讀錯誤消息給你一些線索。 – kaveh
kaven,你可以檢查標籤參數,它說我給無效標識符? 但在create_tag(資源名稱=「」字串「」,標籤=「」「) 然後爲什麼它被示出快照標識符無效?@kaveh –