import boto
import boto.ec2
region = boto.ec2.regioninfo.RegionInfo(name="AmazonEC2", endpoint="<cloudstack_management_server_ip>")
conn = boto.connect_ec2(aws_access_key_id="<cloudstack_api_key>", aws_secret_access_key="<cloudstack_secret_key>", is_secure=False, region=region, port=7080, path="/awsapi", api_version="2012-08-15")
# run an instanceinstanceinstance
instance = conn.run_instances('<image-id>', min_count=1, max_count=1) #
# response of the command (contains list of instances, owner of the instances etc. )
vars(instance)
# list attribute values of one of the instances launchedvarslaunched
vars(instance.instances[0])
# list details of the security group that the launched instances belong tovarsto
vars(instance.groups)
|