runway.cfngin.hooks.docker.hook_data module

Docker hook_data object.

class runway.cfngin.hooks.docker.hook_data.DockerHookData[source]

Bases: runway.utils.MutableMap

Docker hook_data object.

property client: docker.client.DockerClient

Docker client.

__bool__() bool

Implement evaluation of instances as a bool.

__contains__(value: Any) bool

Implement evaluation of ‘in’ conditional.

__delitem__(key: str) None

Implement deletion of self[key].

Parameters

key – Attribute name to remove from the object.

Example

__getitem__(key: str) Any

Implement evaluation of self[key].

Parameters

key – Attribute name to return the value for.

Returns

The value associated with the provided key/attribute name.

Raises

AttributeError – If attribute does not exist on this object.

Example

__init__(**kwargs: Any) None

Initialize class.

Provided kwargs are added to the object as attributes.

Example

__iter__() Iterator[Any]

Return iterator object that can iterate over all attributes.

Example

__len__() int

Implement the built-in function len().

Example

__new__(**kwargs)
__setitem__(key: str, value: Any) None

Implement assignment to self[key].

Parameters
  • key – Attribute name to associate with a value.

  • value – Value of a key/attribute.

Example

__str__() str

Return string representation of the object.

clear() None.  Remove all items from D.
clear_found_cache() None

Clear _found_cache.

property data: Dict[str, Any]

Sanitized output of __dict__.

Removes anything that starts with _.

find(query: str, default: Any = None, ignore_cache: bool = False) Any

Find a value in the map.

Previously found queries are cached to increase search speed. The cached value should only be used if values are not expected to change.

Parameters
  • query – A period delimited string that is split to search for nested values

  • default – The value to return if the query was unsuccessful.

  • ignore_cache – Ignore cached value.

get(key: str, default: Any = None) Any

Implement evaluation of self.get.

Parameters
  • key – Attribute name to return the value for.

  • default – Value to return if attribute is not found.

items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
pop(k[, d]) v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F) None.  Update D from mapping/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

update_context(context: CfnginContext = None) runway.cfngin.hooks.docker.hook_data.DockerHookData[source]
update_context(context: None = None) None

Update context object with new the current DockerHookData.

values() an object providing a view on D's values
classmethod from_cfngin_context(context: runway.context.CfnginContext) runway.cfngin.hooks.docker.hook_data.DockerHookData[source]

Get existing object or create a new one.