<s> """<STR_LIT>""" <EOL> import click <EOL> import SoftLayer <EOL> from SoftLayer . CLI import environment <EOL> from SoftLayer . CLI import exceptions <EOL> from SoftLayer . CLI import formatting <EOL> from SoftLayer . CLI import helpers <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ environment . pass_env <EOL> def rescue ( env , identifier ) : <EOL> """<STR_LIT>""" <EOL> vsi = SoftLayer . VSManager ( env . client ) <EOL> vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , '<STR_LIT>' ) <EOL> if not ( env . skip_confirmations or <EOL> formatting . confirm ( "<STR_LIT>" ) ) : <EOL> raise exceptions . CLIAbort ( '<STR_LIT>' ) <EOL> vsi . rescue ( vs_id ) <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . option ( '<STR_LIT>' , <EOL> default = None , <EOL> help = "<STR_LIT>" ) <EOL> @ environment . pass_env <EOL> def reboot ( env , identifier , hard ) : <EOL> """<STR_LIT>""" <EOL> virtual_guest = env . client [ '<STR_LIT>' ] <EOL> mgr = SoftLayer . HardwareManager ( env . client ) <EOL> vs_id = helpers . resolve_id ( mgr . resolve_ids , identifier , '<STR_LIT>' ) <EOL> if not ( env . skip_confirmations or <EOL> formatting . confirm ( '<STR_LIT>' <EOL> '<STR_LIT>' % vs_id ) ) : <EOL> raise exceptions . CLIAbort ( '<STR_LIT>' ) <EOL> if hard is True : <EOL> virtual_guest . rebootHard ( id = vs_id ) <EOL> elif hard is False : <EOL> virtual_guest . rebootSoft ( id = vs_id ) <EOL> else : <EOL> virtual_guest . rebootDefault ( id = vs_id ) <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . option ( '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> @ environment . pass_env <EOL> def power_off ( env , identifier , hard ) : <EOL> """<STR_LIT>""" <EOL> virtual_guest = env . client [ '<STR_LIT>' ] <EOL> vsi = SoftLayer . VSManager ( env . client ) <EOL> vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , '<STR_LIT>' ) <EOL> if not ( env . skip_confirmations or <EOL> formatting . confirm ( '<STR_LIT>' <EOL> '<STR_LIT>' % vs_id ) ) : <EOL> raise exceptions . CLIAbort ( '<STR_LIT>' ) <EOL> if hard : <EOL> virtual_guest . powerOff ( id = vs_id ) <EOL> else : <EOL> virtual_guest . powerOffSoft ( id = vs_id ) <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ environment . pass_env <EOL> def power_on ( env , identifier ) : <EOL> """<STR_LIT>""" <EOL> vsi = SoftLayer . VSManager ( env . client ) <EOL> vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , '<STR_LIT>' ) <EOL> env . client [ '<STR_LIT>' ] . powerOn ( id = vs_id ) <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ environment . pass_env <EOL> def pause ( env , identifier ) : <EOL> """<STR_LIT>""" <EOL> vsi = SoftLayer . VSManager ( env . client ) <EOL> vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , '<STR_LIT>' ) <EOL> if not ( env . skip_confirmations or <EOL> formatting . confirm ( '<STR_LIT>' <EOL> % vs_id ) ) : <EOL> raise exceptions . CLIAbort ( '<STR_LIT>' ) <EOL> env . client [ '<STR_LIT>' ] . pause ( id = vs_id ) <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ environment . pass_env <EOL> def resume ( env , identifier ) : <EOL> """<STR_LIT>""" <EOL> vsi = SoftLayer . VSManager ( env . client ) <EOL> vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , '<STR_LIT>' ) <EOL> env . client [ '<STR_LIT>' ] . resume ( id = vs_id ) </s>
