runway.cfngin.hooks.docker.data_models module

Hook data models.

These are makeshift data models for use until Runway v2 is realeased and pydantic can be used.

class runway.cfngin.hooks.docker.data_models.BaseModel(*, context: Optional[CfnginContext] = None, **_kwargs: Any)[source]

Bases: object

Base model.

Instantiate class.

dict()Dict[str, Any][source]

Return object as a dict.

find(query: str, default: Optional[typing.Any] = None, **kwargs: typing.Any)typing.Any[source]

Find a value in the object.

get(name: str, default: Optional[typing.Any] = None)typing.Any[source]

Get a value or return default if it is not found.

Attr:

name: The value to look for. default: Returned if no other value is found.

classmethod parse_obj(obj: Any, context: Optional[CfnginContext] = None)Model[source]

Parse object.

__eq__(other: typing.Any)bool[source]

Evaluate equal comparison operator.

__getitem__(name: str)bool[source]

Implement evaluation of self[name].

Parameters

name – The value to look for.

Raises

KeyError – Object does not contain a field of the name provided.

__iter__()ItemsView[str, typing.Any][source]

Iterate object.

__setitem__(name: str, value: typing.Any)None[source]

Implement assignment to self[key].

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

  • value – Value of a key/attribute.

class runway.cfngin.hooks.docker.data_models.ElasticContainerRegistry(*, account_id: Optional[str] = None, alias: Optional[str] = None, aws_region: Optional[str] = None, context: Optional[CfnginContext] = None, **kwargs: Any)[source]

Bases: runway.cfngin.hooks.docker.data_models.BaseModel

AWS Elastic Container Registry.

account_id

AWS account ID that owns the registry being logged into.

Type

Optional[str]

alias

If it is a public repository, the alias of the repository.

Type

Optional[str]

public

Whether the repository is public.

Type

bool

region

AWS region where the registry is located.

Type

Optional[str]

Instantiate class.

property fqn

Fully qualified ECR name.

__eq__(other: typing.Any)bool

Evaluate equal comparison operator.

__getitem__(name: str)bool

Implement evaluation of self[name].

Parameters

name – The value to look for.

Raises

KeyError – Object does not contain a field of the name provided.

__iter__()ItemsView[str, typing.Any]

Iterate object.

__setitem__(name: str, value: typing.Any)None

Implement assignment to self[key].

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

  • value – Value of a key/attribute.

dict()Dict[str, Any]

Return object as a dict.

find(query: str, default: Optional[typing.Any] = None, **kwargs: typing.Any)typing.Any

Find a value in the object.

get(name: str, default: Optional[typing.Any] = None)typing.Any

Get a value or return default if it is not found.

Attr:

name: The value to look for. default: Returned if no other value is found.

classmethod parse_obj(obj: Any, context: Optional[CfnginContext] = None)Model

Parse object.

class runway.cfngin.hooks.docker.data_models.DockerImage(*, image: Image, **kwargs: Any)[source]

Bases: runway.cfngin.hooks.docker.data_models.BaseModel

Wrapper for docker.models.images.Image.

Instantiate class.

__eq__(other: typing.Any)bool

Evaluate equal comparison operator.

__getitem__(name: str)bool

Implement evaluation of self[name].

Parameters

name – The value to look for.

Raises

KeyError – Object does not contain a field of the name provided.

__iter__()ItemsView[str, typing.Any]

Iterate object.

__setitem__(name: str, value: typing.Any)None

Implement assignment to self[key].

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

  • value – Value of a key/attribute.

dict()Dict[str, Any]

Return object as a dict.

find(query: str, default: Optional[typing.Any] = None, **kwargs: typing.Any)typing.Any

Find a value in the object.

get(name: str, default: Optional[typing.Any] = None)typing.Any

Get a value or return default if it is not found.

Attr:

name: The value to look for. default: Returned if no other value is found.

classmethod parse_obj(obj: Any, context: Optional[CfnginContext] = None)Model

Parse object.

property id

ID of the image.

property repo

Repository URI.

property short_id

ID of the image truncated to 10 characters plus the sha256: prefix.

property tags

List of image tags.

property uri

Return a mapping of tag to image URI.

class runway.cfngin.hooks.docker.data_models.ElasticContainerRegistryRepository(*, account_id: Optional[str] = None, aws_region: Optional[str] = None, context: Optional[CfnginContext] = None, registry_alias: Optional[str] = None, repo_name: str, **kwargs: Any)[source]

Bases: runway.cfngin.hooks.docker.data_models.BaseModel

AWS Elastic Container Registry (ECR) Repository.

name

The name of the repository.

Type

str

registry

Information about an ECR registry.

Type

runway.cfngin.hooks.docker.data_models.ElasticContainerRegistry

Instantiace class.

Parameters
  • account_id – AWS account ID.

  • aws_region – AWS region.

  • context – CFNgin context object.

  • registry_alias – Alias of a public ECR registry.

  • repo_name – Name of the ECR repository.

__eq__(other: typing.Any)bool

Evaluate equal comparison operator.

__getitem__(name: str)bool

Implement evaluation of self[name].

Parameters

name – The value to look for.

Raises

KeyError – Object does not contain a field of the name provided.

__iter__()ItemsView[str, typing.Any]

Iterate object.

__setitem__(name: str, value: typing.Any)None

Implement assignment to self[key].

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

  • value – Value of a key/attribute.

dict()Dict[str, Any]

Return object as a dict.

find(query: str, default: Optional[typing.Any] = None, **kwargs: typing.Any)typing.Any

Find a value in the object.

get(name: str, default: Optional[typing.Any] = None)typing.Any

Get a value or return default if it is not found.

Attr:

name: The value to look for. default: Returned if no other value is found.

classmethod parse_obj(obj: Any, context: Optional[CfnginContext] = None)Model

Parse object.

property fqn

Fully qualified ECR repo name.