Base utilities to build API operation managers and objects on top of.
novaclient.base.
BootingManagerWithFind
(api)¶Bases: novaclient.base.ManagerWithFind
Like a ManagerWithFind, but has the ability to boot servers.
novaclient.base.
BytesWithMeta
(values, resp)¶Bases: bytes
, novaclient.base.RequestIdMixin
novaclient.base.
DictWithMeta
(values, resp)¶Bases: dict
, novaclient.base.RequestIdMixin
novaclient.base.
HookableMixin
¶Bases: object
Mixin so classes can register and run hooks.
add_hook
(hook_type, hook_func)¶Add a new hook of specified type.
Parameters: |
|
---|
run_hooks
(hook_type, *args, **kwargs)¶Run all hooks of specified type.
Parameters: |
|
---|
novaclient.base.
ListWithMeta
(values, resp)¶Bases: list
, novaclient.base.RequestIdMixin
novaclient.base.
Manager
(api)¶Bases: novaclient.base.HookableMixin
Manager for API service.
Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
alternate_service_type
(default, allowed_types=())¶api_version
¶cache_lock
= <unlocked _thread.RLock object owner=0 count=0>¶client
¶completion_cache
(cache_type, obj_class, mode)¶The completion cache for bash autocompletion.
The completion cache store items that can be used for bash autocompletion, like UUIDs or human-friendly IDs.
A resource listing will clear and repopulate the cache.
A resource create will append to the cache.
Delete is not handled because listings are assumed to be performed often enough to keep the cache reasonably up-to-date.
convert_into_with_meta
(item, resp)¶resource_class
= None¶write_to_completion_cache
(cache_type, val)¶novaclient.base.
ManagerWithFind
(api)¶Bases: novaclient.base.Manager
Like a Manager, but with additional find()/findall() methods.
find
(**kwargs)¶Find a single item with attributes matching **kwargs
.
findall
(**kwargs)¶Find all items with attributes matching **kwargs
.
list
()¶novaclient.base.
RequestIdMixin
¶Bases: object
Wrapper class to expose x-openstack-request-id to the caller.
append_request_ids
(resp)¶Add request_ids as an attribute to the object
Parameters: | resp – Response object or list of Response objects |
---|
request_ids
¶request_ids_setup
()¶novaclient.base.
Resource
(manager, info, loaded=False, resp=None)¶Bases: novaclient.base.RequestIdMixin
Base class for OpenStack resources (tenant, user, etc.).
This is pretty much just a bag for attributes.
Populate and bind to a manager.
Parameters: |
|
---|
HUMAN_ID
= False¶NAME_ATTR
= 'name'¶api_version
¶get
()¶Support for lazy loading details.
Some clients, such as novaclient have the option to lazy load the details, details which can be loaded with this function.
human_id
¶Human-readable ID which can be used for bash completion.
is_loaded
()¶set_info
(key, value)¶set_loaded
(val)¶to_dict
()¶novaclient.base.
StrWithMeta
(values, resp)¶Bases: str
, novaclient.base.RequestIdMixin
novaclient.base.
TupleWithMeta
(values, resp)¶Bases: tuple
, novaclient.base.RequestIdMixin
novaclient.base.
getid
(obj)¶Get object’s ID or object.
Abstracts the common pattern of allowing both an object or an object’s ID as a parameter when dealing with relationships.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.