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

Class Resource

source code

object --+
         |
        Resource
Known Subclasses:

Base class for resources.

Instance Methods [hide private]
yakumo.base.Resource
__init__(self, manager, *args, **kwargs)
Create a resource object
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__getattr__(self, name) source code
 
_set_attrs(self, kwargs) source code
None
_clear_attrs(self)
Clear attributes
source code
str
get_id(self)
Query ID of a resource
source code
dict
get_attrs(self)
Aquire attributes as a dictionary
source code
bool
reload(self)
(Re)load attributes of a resource
source code
None
update(self, **kwargs)
Update a resource and reload it.
source code
None
delete(self)
Delete a resource
source code
None
wait_for_finished(self, count=10, interval=10)
Wait for task finished
source code

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

Class Variables [hide private]
  _id = None
  _attrs = []
  _loaded = True
  _sub_manager_list = {}
  _state_attr = 'status'
  _stable_state = []
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, manager, *args, **kwargs)
(Constructor)

source code 

Create a resource object

Don't call this method directly; use Manager methods instead.

Parameters:
  • manager (yakumo.base.Manager) - Manager object
Returns: yakumo.base.Resource
Resource object
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

get_id(self)

source code 

Query ID of a resource

Returns: str
ID

get_attrs(self)

source code 

Aquire attributes as a dictionary

Returns: dict
attributes

reload(self)

source code 

(Re)load attributes of a resource

Returns: bool
Whether attributes are updated

update(self, **kwargs)

source code 

Update a resource and reload it. kwargs: attributes and their values to update

Returns: None

wait_for_finished(self, count=10, interval=10)

source code 

Wait for task finished

Parameters:
  • count (int) - Maximum polling time
  • interval (int) - Polling interval in seconds
Returns: None