Package yakumo :: Module base :: Class Manager
[hide private]
[frames] | no frames]

Class Manager

source code

object --+
         |
        Manager
Known Subclasses:

Base class for resource managers.

Instance Methods [hide private]
yakumo.base.Manager
__init__(self, client, verbose=False, **kwargs)
Create a Manager object
source code
 
_no_such_api(self, *args) source code
 
_json2attr(self, json_params) source code
 
_attr2json(self, attrs) source code
yakumo.base.Resource
get_empty(self, id)
Create a resource object without attributes
source code
yakumo.base.Resource
create(self, **kwargs)
Create a new resource
source code
yakumo.base.Resource
get(self, id)
Aquire an existing resource object
source code
 
_find_gen(self, **kwargs) source code
yakumo.base.Resource
find(self, **kwargs)
Query existing resource object matched the conditions
source code
yakumo.base.Resource
find_one(self, **kwargs)
Aquire an existing resource object matched the conditions
source code
[yakumo.base.Resource]
list(self)
Aquire an existing resource object
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  resource_class = None
  service_type = ''
  _attr_mapping = []
  _has_detail = True
  _has_extra_attr = False
  _hidden_methods = None
  _json_resource_key = ''
  _json_resources_key = ''
  _id_attr = 'id'
  _update_method = 'put'
  _url_resource_path = ''
  _url_resource_list_path = ''
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, client, verbose=False, **kwargs)
(Constructor)

source code 

Create a Manager object

kwargs: options

Parameters:
  • client (yakumo.Client) - client object
  • verbose (bool) - Whether str(Resource) displays all attributes
Returns: yakumo.base.Manager
Manager object
Overrides: object.__init__

get_empty(self, id)

source code 

Create a resource object without attributes

Returns: yakumo.base.Resource
Resource object (empty)

create(self, **kwargs)

source code 

Create a new resource

kwargs: attributes of the resource

Returns: yakumo.base.Resource
Resource object (empty)

get(self, id)

source code 

Aquire an existing resource object

Parameters:
  • id (str) - ID
Returns: yakumo.base.Resource
Resource object

find(self, **kwargs)

source code 

Query existing resource object matched the conditions

kwargs is key=value style query conditions. Returns empty list if no matched resource.

Returns: yakumo.base.Resource
List of Resource object

find_one(self, **kwargs)

source code 

Aquire an existing resource object matched the conditions

kwargs is key=value style query conditions. Returns None if no matched resource.

Returns: yakumo.base.Resource
Resource object

list(self)

source code 

Aquire an existing resource object

Returns: [yakumo.base.Resource]
List of Resource objects