<s> import time <EOL> from pprint import pprint <EOL> from libcloud . backup . types import BackupTargetJobStatusType <EOL> from libcloud . backup . types import Provider as BackupProvider <EOL> from libcloud . backup . providers import get_driver as get_backup_driver <EOL> from libcloud . compute . providers import get_driver as get_compute_driver <EOL> from libcloud . compute . types import Provider as ComputeProvider <EOL> backup_driver = get_backup_driver ( <EOL> BackupProvider . DIMENSIONDATA ) ( '<STR_LIT:username>' , '<STR_LIT>' ) <EOL> compute_driver = get_compute_driver ( <EOL> ComputeProvider . DIMENSIONDATA ) ( '<STR_LIT:username>' , '<STR_LIT>' ) <EOL> nodes = compute_driver . list_nodes ( ) <EOL> selected_node = nodes [ <NUM_LIT:0> ] <EOL> print ( '<STR_LIT>' ) <EOL> new_target = backup_driver . create_target_from_node ( selected_node ) <EOL> print ( '<STR_LIT>' ) <EOL> job = backup_driver . create_target_job ( new_target ) <EOL> print ( '<STR_LIT>' ) <EOL> while True : <EOL> if job . status != BackupTargetJobStatusType . RUNNING : <EOL> break <EOL> else : <EOL> job = backup_driver . get_target_job ( job . id ) <EOL> print ( '<STR_LIT>' % ( job . progress ) ) <EOL> time . sleep ( <NUM_LIT:20> ) <EOL> print ( '<STR_LIT>' % ( job . status ) ) <EOL> print ( '<STR_LIT>' ) <EOL> recovery_points = backup_driver . list_recovery_points ( new_target ) <EOL> pprint ( recovery_points ) </s>
