Created
February 27, 2013 06:56
-
-
Save siroken3/5045806 to your computer and use it in GitHub Desktop.
botocoreのパラメータの渡し方、毎回探すのでメモ(BlockDeviceMapping.n.Ebs.SnapshotId なパラメータとか)
see http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-RegisterImage.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import botocore.session | |
| session = botocore.session.get_session() | |
| ec2 = session.get_service('ec2') | |
| op = ec2.get_operation('RegisterImage') | |
| ep = ec2.get_endpoint('us-east-1') | |
| bd = [{"device_name":"/dev/sda", "ebs":{ "snapshot_id":"snap-XXXXXXX", "volume_size":10}}] | |
| op.call( | |
| ep, | |
| name='NAME', | |
| description='TEST', | |
| architecture='x86_64', | |
| kernel_id='aki-b4aa75dd', | |
| root_device_name='/dev/sda1', | |
| block_device_mappings=bd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment