def start(name, call=None):
 if (call != 'action'):
  raise SaltCloudSystemExit('The start action must be called with -a or --action.')
 data = show_instance(name, call='action')
 if (data.get('status') == 'active'):
  return {'success': True, 'action': 'start', 'status': 'active', 'msg': 'Machine is already running.'}
 ret = query(droplet_id=data['id'], command='actions', args={'type': 'power_on'}, http_method='post')
 return {'success': True, 'action': ret['action']['type'], 'state': ret['action']['status']}

def start ( name , call = None ) : if ( call != 'action' ) : raise SaltCloudSystemExit ( 'The start action must be called with -a or --action.' ) data = show_instance ( name , call = 'action' ) if ( data . get ( 'status' ) == 'active' ) : return { 'success' : True , 'action' : 'start' , 'status' : 'active' , 'msg' : 'Machine is already running.' } ret = query ( droplet_id = data [ 'id' ] , command = 'actions' , args = { 'type' : 'power_on' } , http_method = 'post' ) return { 'success' : True , 'action' : ret [ 'action' ] [ 'type' ] , 'state' : ret [ 'action' ] [ 'status' ] }
start a machine by name cli example: .