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)

ec2_instance_id_to_uuid(context, ec2_id)
ec2_snap_id_to_uuid(ec2_id)

Get the cooresponding UUID for the given ec2-id.

ec2_vol_id_to_uuid(ec2_id)

Get the cooresponding UUID for the given ec2-id.

get_availability_zone_by_host(services, host)
get_int_id_from_snapshot_uuid(context, snapshot_uuid)
get_int_id_from_volume_uuid(context, volume_uuid)
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)
get_snapshot_uuid_from_int_id(context, int_id)
get_volume_uuid_from_int_id(context, int_id)
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(snapshot_id)

Get or create an ec2 volume ID (vol-[base 16 number]) from uuid.

id_to_ec2_vol_id(volume_id)

Get or create an ec2 volume ID (vol-[base 16 number]) from uuid.

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