utils.api module

class utils.api.API(entry_point, auth)[source]

Bases: object

api_version(version)[source]
delete(url, **payload)[source]
get(url, **get_params)[source]
get_entity(collection_or_name, entity_id)[source]
latest_version[source]
new_id_behaviour[source]

2.0.0 introduced a new id/href difference.

on_latest_version[source]
post(url, **payload)[source]
version[source]
versions[source]
exception utils.api.APIException[source]

Bases: exceptions.Exception

class utils.api.Action(container, name, method, href)[source]

Bases: object

api[source]
collection[source]
class utils.api.ActionContainer(obj)[source]

Bases: object

all[source]
collection[source]
reload()[source]
class utils.api.Collection(api, href, name, description=None)[source]

Bases: object

all[source]
api[source]
count[source]
find_by(**params)[source]

Search items in collection. Filters based on keywords passed.

get(**params)[source]
reload(expand=False)[source]
reload_if_needed()[source]
subcount[source]
class utils.api.CollectionsIndex(api, data)[source]

Bases: object

all[source]
all_names[source]
class utils.api.Entity(collection, data, incomplete=False)[source]

Bases: object

COLLECTION_MAPPING = {'zone_id': 'zones', 'task_id': 'tasks', 'current_group_id': 'groups', 'evm_owner_id': 'users', 'host_id': 'hosts', 'storage_id': 'data_stores', 'ems_id': 'providers', 'miq_user_role_id': 'roles'}
SUBCOLLECTIONS = {'service_catalogs': set(['service_templates'])}
TIME_FIELDS = set(['last_scan_attempt_on', 'created_at', 'updated_at', 'state_changed_on', 'lastlogon', 'created_on', 'last_scan_on', 'updated_on', 'last_sync_on'])
exists[source]
reload(expand=None, get=True)[source]
reload_if_needed()[source]
wait_exists(**kwargs)[source]
wait_for_existence(existence, **kwargs)[source]
wait_not_exists(**kwargs)[source]
class utils.api.SearchResult(collection, data)[source]

Bases: object