deckhand.client.base module

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

class deckhand.client.base.Manager(api)[source]

Bases: object

Manager for API service.

Managers interact with a particular type of API (buckets, revisions, etc.) and provide CRUD operations for them.

api_version
client
resource_class = None
class deckhand.client.base.Resource(manager, info, loaded=False)[source]

Bases: object

Base class for OpenStack resources (tenant, user, etc.).

This is pretty much just a bag for attributes.

HUMAN_ID = False
NAME_ATTR = 'name'
api_version
get()[source]

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()[source]
set_info(key, value)[source]
set_loaded(val)[source]
to_dict()[source]
deckhand.client.base.get_url_with_filter(url, filters)[source]
deckhand.client.base.getid(obj)[source]

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.

deckhand.client.base.prepare_query_string(params)[source]

Convert dict params to query string