如何使用boto3的export_image?
How to use boto3's export_image?
似乎 EC2 客户端缺少 export_image
功能,即使它 listed in the EC2 docs.
import boto3
session = boto3.Session(profile_name=my_aws_profile)
client = session.client('ec2')
client.export_image() # MISSING!
AttributeError: 'EC2' object has no attribute 'export_image'
我错过了什么吗? (除了函数的参数?)
对我有用:
>>> import boto3
>>> ec2 = boto3.client('ec2')
>>> ec2.export_image()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/client.py", line 386, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/client.py", line 677, in _make_api_call
request_dict = self._convert_to_request_dict(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/client.py", line 725, in _convert_to_request_dict
request_dict = self._serializer.serialize_to_request(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/validate.py", line 293, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "DiskImageFormat"
Missing required parameter in input: "ImageId"
Missing required parameter in input: "S3ExportLocation"
>>> boto3.__version__
'1.17.76'
似乎 EC2 客户端缺少 export_image
功能,即使它 listed in the EC2 docs.
import boto3
session = boto3.Session(profile_name=my_aws_profile)
client = session.client('ec2')
client.export_image() # MISSING!
AttributeError: 'EC2' object has no attribute 'export_image'
我错过了什么吗? (除了函数的参数?)
对我有用:
>>> import boto3
>>> ec2 = boto3.client('ec2')
>>> ec2.export_image()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/client.py", line 386, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/client.py", line 677, in _make_api_call
request_dict = self._convert_to_request_dict(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/client.py", line 725, in _convert_to_request_dict
request_dict = self._serializer.serialize_to_request(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/botocore/validate.py", line 293, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "DiskImageFormat"
Missing required parameter in input: "ImageId"
Missing required parameter in input: "S3ExportLocation"
>>> boto3.__version__
'1.17.76'