Skip to content

Instances

instances

UnsupportedInstanceDeclarationError

Bases: RuntimeError

Raised when a credential group cannot declare named instances.

Source code in packages/axm-vault/src/axm_vault/instances.py
Python
class UnsupportedInstanceDeclarationError(RuntimeError):
    """Raised when a credential group cannot declare named instances."""

declare_instance(group, instance)

Declare an instance through the group's source without provisioning it.

Source code in packages/axm-vault/src/axm_vault/instances.py
Python
def declare_instance(group: CredentialGroup, instance: str) -> None:
    """Declare an instance through the group's source without provisioning it."""
    source = group.instances
    if source is None:
        raise UnsupportedInstanceDeclarationError(
            f"credential group {group.id!r} does not support instance declaration"
        )
    source.declare(instance)

list_instances(group)

Return the instances declared by the group's source, in source order.

Source code in packages/axm-vault/src/axm_vault/instances.py
Python
def list_instances(group: CredentialGroup) -> list[str]:
    """Return the instances declared by the group's source, in source order."""
    source = group.instances
    if source is None:
        return []
    return list(source.list_instances())