juju.constraints

Summary

ConstraintsDict

DeviceConstraintDict

StorageConstraintDict

normalize_key

normalize_list_value

normalize_value

parse

Constraints must be expressed as a string containing only spaces and key value pairs joined by an ‘=’.

parse_device_constraint

parse_storage_constraint

parse_storage_constraints

Reference

class juju.constraints.ConstraintsDict[source]

Bases: TypedDict

allocate_public_ip: Union[int, bool, str]
arch: Union[int, bool, str]
container: Union[int, bool, str]
cores: Union[int, bool, str]
cpu_cores: Union[int, bool, str]
cpu_power: Union[int, bool, str]
instance_role: Union[int, bool, str]
instance_type: Union[int, bool, str]
mem: Union[int, bool, str]
root_disk: Union[int, bool, str]
root_dist_source: Union[int, bool, str]
spaces: List[Union[int, bool, str]]
tags: List[Union[int, bool, str]]
virt_type: Union[int, bool, str]
zones: List[Union[int, bool, str]]
class juju.constraints.DeviceConstraintDict[source]

Bases: TypedDict

attributes: Dict[str, str]
count: int
type: str
class juju.constraints.StorageConstraintDict[source]

Bases: TypedDict

count: int
pool: str
size: int
juju.constraints.normalize_key(orig_key: str) str[source]
juju.constraints.normalize_list_value(value: str) List[Union[int, bool, str]][source]
juju.constraints.normalize_value(value: str) Union[int, bool, str][source]
juju.constraints.parse(constraints: Union[str, ConstraintsDict]) Optional[ConstraintsDict][source]

Constraints must be expressed as a string containing only spaces and key value pairs joined by an ‘=’.

juju.constraints.parse_device_constraint(constraint: str) DeviceConstraintDict[source]
juju.constraints.parse_storage_constraint(constraint: str) StorageConstraintDict[source]
juju.constraints.parse_storage_constraints(constraints: Optional[Mapping[str, Union[str, StorageConstraintDict]]] = None) Dict[str, StorageConstraintDict][source]