<s> from kamaki . cli . config import Config <EOL> from kamaki . clients import astakos , cyclades , ClientError <EOL> from kamaki . clients . utils import https <EOL> https . patch_with_certs ( '<STR_LIT>' ) <EOL> cnf = Config ( ) <EOL> CLOUD = cnf . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> URL = cnf . get_cloud ( CLOUD , '<STR_LIT:url>' ) <EOL> TOKEN = cnf . get_cloud ( CLOUD , '<STR_LIT>' ) <EOL> identity_client = astakos . CachedAstakosClient ( URL , TOKEN ) <EOL> computeURL = identity_client . get_endpoint_url ( <EOL> cyclades . CycladesComputeClient . service_type ) <EOL> compute_client = cyclades . CycladesComputeClient ( computeURL , TOKEN ) <EOL> volumeURL = identity_client . get_endpoint_url ( <EOL> cyclades . CycladesBlockStorageClient . service_type ) <EOL> volume_client = cyclades . CycladesBlockStorageClient ( volumeURL , TOKEN ) <EOL> srv = compute_client . get_server_details ( <NUM_LIT> ) <EOL> flv = compute_client . get_flavor_details ( srv [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] ) <EOL> new_volume = volume_client . create_volume ( <EOL> size = flv [ '<STR_LIT>' ] , server_id = srv [ '<STR_LIT:id>' ] , display_name = '<STR_LIT>' ) <EOL> print '<STR_LIT>' , volume_client . get_volume_details ( new_volume [ '<STR_LIT:id>' ] ) [ '<STR_LIT:status>' ] <EOL> import time <EOL> print '<STR_LIT>' <EOL> time . sleep ( <NUM_LIT:10> ) <EOL> print '<STR_LIT>' , volume_client . get_volume_details ( new_volume [ '<STR_LIT:id>' ] ) [ '<STR_LIT:status>' ] <EOL> volume_client . delete_volume ( new_volume [ '<STR_LIT:id>' ] ) <EOL> print '<STR_LIT>' , volume_client . get_volume_details ( new_volume [ '<STR_LIT:id>' ] ) [ '<STR_LIT:status>' ] </s>
