Previous topic

The nova.api.ec2.cloud Module

Next topic

The nova.api.ec2.faults Module

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.api.ec2.ec2utils Module

camelcase_to_underscore(str)
dict_from_dotted_str(items)

parse multi dot-separated argument into dict. EBS boot uses multi dot-separated arguments like BlockDeviceMapping.1.DeviceName=snap-id Convert the above into {‘block_device_mapping’: {‘1’: {‘device_name’: snap-id}}}

ec2_id_to_glance_id(context, ec2_id)
ec2_id_to_id(ec2_id)

Convert an ec2 ID (i-[base 16 number]) to an instance id (int)

get_availability_zone_by_host(services, host)
get_ip_info_for_instance(context, instance)

Return a dictionary of IP information for an instance

get_ip_info_for_instance_from_nw_info(nw_info)
glance_id_to_ec2_id(context, glance_id, image_type='ami')
glance_id_to_id(context, glance_id)

Convert a glance id to an internal (db) id.

id_to_ec2_id(instance_id, template='i-%08x')

Convert an instance ID (int) to an ec2 ID (i-[base 16 number])

id_to_ec2_snap_id(instance_id)

Convert an snapshot ID (int) to an ec2 snapshot ID (snap-[base 16 number])

id_to_ec2_vol_id(instance_id)

Convert an volume ID (int) to an ec2 volume ID (vol-[base 16 number])

id_to_glance_id(context, image_id)

Convert an internal (db) id to a glance id.

image_ec2_id(image_id, image_type='ami')

Returns image ec2_id using id and three letter type.

image_type(image_type)

Converts to a three letter image type.

aki, kernel => aki ari, ramdisk => ari anything else => ami