<s> """<STR_LIT>""" <EOL> from cafe . engine . http . client import AutoMarshallingHTTPClient <EOL> from cloudcafe . compute . servers_api . models . servers import Server <EOL> from cloudcafe . compute . extensions . rescue_api . models . requests import RescueMode , ExitRescueMode <EOL> from cloudcafe . compute . extensions . rescue_api . models . responses import RescueResponse <EOL> class RescueClient ( AutoMarshallingHTTPClient ) : <EOL> def __init__ ( self , url , auth_token , serialize_format = None , <EOL> deserialize_format = None ) : <EOL> """<STR_LIT>""" <EOL> super ( RescueClient , self ) . __init__ ( serialize_format , <EOL> deserialize_format ) <EOL> self . auth_token = auth_token <EOL> self . default_headers [ '<STR_LIT>' ] = auth_token <EOL> ct = '<STR_LIT>' . join ( [ '<STR_LIT>' , self . serialize_format ] ) <EOL> accept = '<STR_LIT>' . join ( [ '<STR_LIT>' , self . deserialize_format ] ) <EOL> self . default_headers [ '<STR_LIT:Content-Type>' ] = ct <EOL> self . default_headers [ '<STR_LIT>' ] = accept <EOL> self . url = url <EOL> def rescue ( self , server_id , rescue_image_ref = None , <EOL> requestslib_kwargs = None ) : <EOL> self . server_id = server_id <EOL> url = '<STR_LIT>' . format ( <EOL> base_url = self . url , server_id = server_id ) <EOL> resp = self . request ( <EOL> '<STR_LIT:POST>' , url , response_entity_type = RescueResponse , <EOL> request_entity = RescueMode ( rescue_image_ref = rescue_image_ref ) , <EOL> requestslib_kwargs = requestslib_kwargs ) <EOL> return resp <EOL> def unrescue ( self , server_id , requestslib_kwargs = None ) : <EOL> self . server_id = server_id <EOL> url = '<STR_LIT>' . format ( <EOL> base_url = self . url , server_id = server_id ) <EOL> resp = self . request ( <EOL> '<STR_LIT:POST>' , url , response_entity_type = Server , <EOL> request_entity = ExitRescueMode ( ) , <EOL> requestslib_kwargs = requestslib_kwargs ) <EOL> return resp </s>
