The novaclient.base Module

Base utilities to build API operation managers and objects on top of.

class novaclient.base.BootingManagerWithFind(api)

Bases: novaclient.base.ManagerWithFind

Like a ManagerWithFind, but has the ability to boot servers.

class novaclient.base.Manager(api)

Bases: novaclient.utils.HookableMixin

Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.

completion_cache(*args, **kwds)

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.

resource_class = None
write_to_completion_cache(cache_type, val)
class 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.

This isn’t very efficient: it loads the entire list then filters on the Python side.

findall(**kwargs)

Find all items with attributes matching **kwargs.

This isn’t very efficient: it loads the entire list then filters on the Python side.

list()
class novaclient.base.Resource(manager, info, loaded=False)

Bases: object

A resource represents a particular instance of an object (server, flavor, etc). This is pretty much just a bag for attributes.

Parameters:
  • manager – Manager object
  • info – dictionary representing resource attributes
  • loaded – prevent lazy-loading if set to True
HUMAN_ID = False
NAME_ATTR = 'name'
get()
human_id

Subclasses may override this provide a pretty ID which can be used for bash completion.

is_loaded()
set_loaded(val)
novaclient.base.getid(obj)

Abstracts the common pattern of allowing both an object or an object’s ID as a parameter when dealing with relationships.

This Page