我有以下Python代码:
cos = ibm_boto3.client('s3',
verify=False,
ibm_api_key_id=api_key,
ibm_service_instance_id=service_instance_id,
ibm_auth_endpoint=auth_endpoint,
config=Config(signature_version='oauth'),
endpoint_url=service_endpoint)
response = cos.list_buckets(IBMServiceInstanceId=service_instance_id)
print('Response %s' % response)
它给了我这个错误(注意。一些跟踪已被删除):
Traceback (most recent call last):
File "/venv/lib/python3.7/site-packages/ibm_botocore/model.py", line 588, in resolve_shape_ref
shape_name = member_traits.pop('shape')
KeyError: 'shape'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "listing.py", line 21, in <module>
response2 = cos.list_buckets(IBMServiceInstanceId=service_instance_id)
File "/venv/lib/python3.7/site-packages/ibm_botocore/model.py", line 187, in members
shape_members[name] = self._resolve_shape_ref(shape_ref)
File "/venv/lib/python3.7/site-packages/ibm_botocore/model.py", line 164, in _resolve_shape_ref
return self._shape_resolver.resolve_shape_ref(shape_ref)
File "/venv/lib/python3.7/site-packages/ibm_botocore/model.py", line 591, in resolve_shape_ref
"Invalid model, missing shape reference: %s" % shape_ref)
ibm_botocore.model.InvalidShapeReferenceError: Invalid model, missing shape reference: OrderedDict([('location', 'header'), ('locationName', 'Ibm-Service-Instance-Id')])
我检查了形状,并且list_buckets似乎在那里。我不确定还需要检查什么。任何人都可以建议问题所在吗?
答案 0 :(得分:0)
list_buckets
在设备上的配置不正确。配置完成后,我便可以执行该操作。