Python API,调用代码大致如下:
req = models.RunInstancesRequest()
(其他参数略)
tags={
'Key1': 'Value1',
'Key2': 'Value2'
}
tag_spec = models.TagSpecification()
tag_spec.ResourceType = 'instance'
tag_spec.Tags = []
for key in tags:
tag = models.Tag()
tag.Key = key
tag.Value = tags[key]
tag_spec.Tags.append(tag)
req.TagSpecification = tag_spec
response = client.RunInstances(req)
调用时报错:
tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: [TencentCloudSDKException] code:InvalidParameterValue message:参数`TagSpecification`中`{'ResourceType': 'instance', 'Tags': [{'Key
': 'Key1', 'Value': 'Value1'}, {'Key': 'Key2', 'Value': 'Value2'}]}`不合规范
请问“符合规范”的TagSpecification应当如何指定?
相似问题