<s> """<STR_LIT>""" <EOL> from cloudcafe . designate . client import DesignateClient <EOL> from cloudcafe . designate . v1 . server_api . models . requests import ServerRequest <EOL> from cloudcafe . designate . v1 . server_api . models . responses import ServerResponse , ServerListResponse <EOL> class ServerAPIClient ( DesignateClient ) : <EOL> def __init__ ( self , url , serialize_format = None , <EOL> deserialize_format = None ) : <EOL> super ( ServerAPIClient , self ) . __init__ ( url , serialize_format , <EOL> deserialize_format ) <EOL> def _get_servers_url ( self ) : <EOL> return "<STR_LIT>" . format ( self . url ) <EOL> def _get_server_url ( self , server_id ) : <EOL> return "<STR_LIT>" . format ( self . _get_servers_url ( ) , server_id ) <EOL> def create_server ( self , name = None , ** requestslib_kwargs ) : <EOL> """<STR_LIT>""" <EOL> server = ServerRequest ( name = name ) <EOL> url = self . _get_servers_url ( ) <EOL> return self . request ( '<STR_LIT:POST>' , url , response_entity_type = ServerResponse , <EOL> request_entity = server , <EOL> requestslib_kwargs = requestslib_kwargs ) <EOL> def update_server ( self , server_id , name , ** requestslib_kwargs ) : <EOL> """<STR_LIT>""" <EOL> server = ServerRequest ( name = name ) <EOL> url = self . _get_server_url ( server_id ) <EOL> return self . request ( '<STR_LIT>' , url , response_entity_type = ServerResponse , <EOL> request_entity = server , <EOL> requestslib_kwargs = requestslib_kwargs ) <EOL> def list_servers ( self , ** requestslib_kwargs ) : <EOL> """<STR_LIT>""" <EOL> url = self . _get_servers_url ( ) <EOL> return self . request ( '<STR_LIT:GET>' , url , <EOL> response_entity_type = ServerListResponse , <EOL> requestslib_kwargs = requestslib_kwargs ) <EOL> def get_server ( self , server_id , ** requestslib_kwargs ) : <EOL> """<STR_LIT>""" <EOL> url = self . _get_server_url ( server_id ) <EOL> return self . request ( '<STR_LIT:GET>' , url , response_entity_type = ServerResponse , <EOL> requestslib_kwargs = requestslib_kwargs ) <EOL> def delete_server ( self , server_id , ** requestslib_kwargs ) : <EOL> """<STR_LIT>""" <EOL> url = self . _get_server_url ( server_id ) <EOL> return self . request ( '<STR_LIT>' , url , <EOL> requestslib_kwargs = requestslib_kwargs ) </s>
