<s> """<STR_LIT>""" <EOL> from cloudcafe . cloudkeep . barbican . client import BarbicanRestClient <EOL> from cloudcafe . cloudkeep . barbican . containers . models . container import ( <EOL> Container , ContainerRef , ContainerGroup ) <EOL> class ContainerClient ( BarbicanRestClient ) : <EOL> def __init__ ( self , url , api_version , token = None , <EOL> serialize_format = None , deserialize_format = None ) : <EOL> super ( ContainerClient , self ) . __init__ ( <EOL> token = token , serialize_format = serialize_format , <EOL> deserialize_format = deserialize_format ) <EOL> self . url = url <EOL> self . api_version = api_version <EOL> def _get_base_url ( self ) : <EOL> return '<STR_LIT>' . format ( <EOL> base = self . url , <EOL> api_version = self . api_version ) <EOL> def create_container ( self , name , container_type , secret_refs ) : <EOL> """<STR_LIT>""" <EOL> remote_url = self . _get_base_url ( ) <EOL> container = Container ( name , container_type , secret_refs ) <EOL> return self . request ( '<STR_LIT:POST>' , remote_url , request_entity = container , <EOL> response_entity_type = ContainerRef ) <EOL> def get_container ( self , container_ref ) : <EOL> """<STR_LIT>""" <EOL> return self . request ( '<STR_LIT:GET>' , container_ref , <EOL> response_entity_type = Container ) <EOL> def get_containers ( self , limit = None , offset = None , ref = None ) : <EOL> """<STR_LIT>""" <EOL> resp = self . request ( '<STR_LIT:GET>' , <EOL> ref or self . _get_base_url ( ) , <EOL> params = { '<STR_LIT>' : limit , '<STR_LIT>' : offset } , <EOL> response_entity_type = ContainerGroup ) <EOL> return resp <EOL> def delete_container ( self , container_ref ) : <EOL> """<STR_LIT>""" <EOL> return self . request ( '<STR_LIT>' , container_ref ) </s>
