У меня есть этот код 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, кажется, там. Я не уверен, что еще мне нужно проверить. Кто-нибудь может подсказать, где может быть проблема?
list_buckets
неправильно настроен на устройстве. После настройки я смог выполнить операцию.