def import_key_pair(url, verb, headers, version, key_name, public_key_material): params = {} params['Action'] = 'ImportKeyPair' params['Version'] = version params['KeyName'] = key_name params['PublicKeyMaterial'] = public_key_material return requestify.make_request(url, verb, headers, params)
def update_delete_on_termination_flag(url, verb, headers, version, volume_id, delete_on_termination): params = {} params['Action'] = 'UpdateDeleteOnTerminationFlag' params['Version'] = version params['VolumeId'] = volume_id params['DeleteOnTermination'] = str(delete_on_termination) return requestify.make_request(url, verb, headers, params)
def describe_volumes(url, verb, headers, version, volume_ids=None, max_results=-1, next_token="", detail=True): params = {} params['Action'] = 'DescribeVolumes' params['Version'] = version if not volume_ids == None: i = 1 for volume_id in volume_ids: params["VolumeId." + str(i)] = volume_id i += 1 if not max_results == -1: params['MaxResults'] = max_results if not next_token == "": params['NextToken'] = next_token params['Detail'] = str(detail) return requestify.make_request(url, verb, headers, params)
def get_password_data(url, verb, headers, version, instance_id): params = {} params['Action'] = 'GetPasswordData' params['Version'] = version params['InstanceId'] = instance_id return requestify.make_request(url, verb, headers, params)
def run_instances(url, verb, headers, version, image_id, instance_type_id, blocks = None, instance_count = -1, subnet_id = "", private_ip_address = "", security_group_ids = None, key_name = ""): params = {} params['Action'] = 'RunInstances' params['Version'] = version params['ImageId'] = image_id params['InstanceTypeId'] = instance_type_id if not blocks == None: i=1 for block in blocks : if not block == None : params['BlockDeviceMapping.' + str(i) + '.DeviceName'] = block['device_name'] params['BlockDeviceMapping.' + str(i) + '.DeleteOnTermiantion'] = block['delete_on_termination'] params['BlockDeviceMapping.' + str(i) + '.VolumeSize'] = block['volume_size'] i+=1 if not instance_count == -1 : params['InstanceCount'] = instance_count if not subnet_id == "" : params['SubnetId'] = subnet_id if not private_ip_address == "": params['PrivateIpAddress'] = private_ip_address if not security_group_ids == None : i=1 for security_group_id in security_group_ids : params['SecurityGroupId.' + str(i)] = security_group_id i+=1 if not key_name == "" : params['KeyName'] = key_name return requestify.make_request(url, verb, headers, params)
def update_delete_on_termination_flag(url, verb, headers, version, volume_id, delete_on_termination): params = {} params['Action'] = 'UpdateDeleteOnTerminationFlag' params['Version'] = version params['VolumeId'] = volume_id params['DeleteOnTermination'] = str(delete_on_termination) return requestify.make_request(url, verb, headers, params)
def detach_volume(url, verb, headers, version, volume_id, instance_id = ""): params = {} params['Action'] = 'DetachVolume' params['Version'] = version params['VolumeId'] = volume_id if not instance_id == "" : params['InstanceId'] = instance_id return requestify.make_request(url, verb, headers, params)
def detach_volume(url, verb, headers, version, volume_id, instance_id=""): params = {} params['Action'] = 'DetachVolume' params['Version'] = version params['VolumeId'] = volume_id if not instance_id == "": params['InstanceId'] = instance_id return requestify.make_request(url, verb, headers, params)
def attach_volume(url, verb, headers, version, instance_id, volume_id, device): params = {} params['Action'] = 'AttachVolume' params['Version'] = version params['InstanceId'] = instance_id params['VolumeId'] = volume_id params['Device'] = device return requestify.make_request(url, verb, headers, params)
def attach_volume(url, verb, headers, version, instance_id, volume_id, device): params = {} params['Action'] = 'AttachVolume' params['Version'] = version params['InstanceId'] = instance_id params['VolumeId'] = volume_id params['Device'] = device return requestify.make_request(url, verb, headers, params)
def reboot_instances(url, verb, headers, version, instance_ids): params = {} params['Action'] = 'RebootInstances' params['Version'] = version if not instance_ids == None: i=1 for instance_id in instance_ids: params['InstanceId.' + str(i)] = instance_id i+=1 return requestify.make_request(url, verb, headers, params)
def terminate_instances(url, verb, headers, version, instance_ids): params = {} params['Action'] = 'TerminateInstances' params['Version'] = version if instance_ids != None: i=1 for instance_id in instance_ids: params['InstanceId.' + str(i)] = instance_id i+=1 return requestify.make_request(url, verb, headers, params)
def create_volume(url, verb, headers, version, snapshot_id = "", size = -1): params = {} params['Action'] = 'CreateVolume' params['Version'] = version if not snapshot_id == "" : params['SnapshotId'] = snapshot_id if not size == -1 : params['Size'] = str(size) return requestify.make_request(url, verb, headers, params)
def create_volume(url, verb, headers, version, snapshot_id="", size=-1): params = {} params['Action'] = 'CreateVolume' params['Version'] = version if not snapshot_id == "": params['SnapshotId'] = snapshot_id if not size == -1: params['Size'] = str(size) return requestify.make_request(url, verb, headers, params)
def describe_instance_types(url, verb, headers, version, instance_type_ids = None): params = {} params['Action'] = 'DescribeInstanceTypes' params['Version'] = version if not instance_type_ids == None: i=1 for instance_type_id in instance_type_ids: params['InstanceTypeId.' + str(i)] = instance_type_id i+=1 return requestify.make_request(url, verb, headers, params)
def describe_images(url, verb, headers, version, image_ids=None): params = {} params['Action'] = 'DescribeImages' params['Version'] = version if not image_ids == None: i = 1 for image_id in image_ids: params['ImageId.' + str(i)] = image_id i = i + 1 return requestify.make_request(url, verb, headers, params)
def describe_snapshots(url, verb, headers, version, snpashot_ids = None, max_results = -1, next_token = "", detail = True): params = {} params['Action'] = 'DescribeSnapshots' params['Version'] = version if not snpashot_ids == None : i=1 for snapshot_id in snpashot_ids : params["SnapshotId." + str(i)] = snapshot_id i+=1 if not max_results == -1 : params['MaxResults'] = max_results if not next_token == "" : params['NextToken'] = next_token params['Detail'] = str(detail) return requestify.make_request(url, verb, headers, params)
def describe_volumes(url, verb, headers, version, volume_ids = None, max_results = -1, next_token = "", detail = True): params = {} params['Action'] = 'DescribeVolumes' params['Version'] = version if not volume_ids == None : i=1 for volume_id in volume_ids : params["VolumeId." + str(i)] = volume_id i+=1 if not max_results == -1 : params['MaxResults'] = max_results if not next_token == "" : params['NextToken'] = next_token params['Detail'] = str(detail) return requestify.make_request(url, verb, headers, params)
def delete_volume(url, verb, headers, version, volume_id): params = {} params['Action'] = 'DeleteVolume' params['Version'] = version params['VolumeId'] = volume_id return requestify.make_request(url, verb, headers, params)
def show_delete_on_termination_flag(url, verb, headers, version, volume_id): params = {} params['Action'] = 'ShowDeleteOnTerminationFlag' params['Version'] = version params['VolumeId'] = volume_id return requestify.make_request(url, verb, headers, params)
def delete_snapshot(url, verb, headers, version, snapshot_id): params = {} params['Action'] = 'DeleteSnapshot' params['Version'] = version params['SnapshotId'] = snapshot_id return requestify.make_request(url, verb, headers, params)
def delete_volume(url, verb, headers, version, volume_id): params = {} params['Action'] = 'DeleteVolume' params['Version'] = version params['VolumeId'] = volume_id return requestify.make_request(url, verb, headers, params)
def show_delete_on_termination_flag(url, verb, headers, version, volume_id): params = {} params['Action'] = 'ShowDeleteOnTerminationFlag' params['Version'] = version params['VolumeId'] = volume_id return requestify.make_request(url, verb, headers, params)
def create_snapshot(url, verb, headers, version, volume_id): params = {} params['Action'] = 'CreateSnapshot' params['Version'] = version params['VolumeId'] = volume_id return requestify.make_request(url, verb, headers, params)
def describe_key_pairs(url, verb, headers, version): params = {} params['Action'] = 'DescribeKeyPairs' params['Version'] = version return requestify.make_request(url, verb, headers, params)
def delete_key_pair(url, verb, headers, version, key_name): params = {} params['Action'] = 'DeleteKeyPair' params['Version'] = version params['KeyName'] = key_name return requestify.make_request(url, verb, headers, params)