Skip to content

wait_until_vault_not_exists

wait_until_vault_not_exists(
    account_id: string,
    vault_name: string,
    *,
    max_wait_time: float,
    min_delay: float = 3,
    max_delay: float = 120,
    config_overrides: Optional[GlacierClientConfig] = None,
) -> ServiceError

Wait for vault_not_exists.

Parameters:

  • account_id (string) –

    The AccountId value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.

  • vault_name (string) –

    The name of the vault.

  • max_wait_time (float) –

    Maximum total seconds to wait before raising WaiterTimeoutError.

  • min_delay (float, default: 3 ) –

    Minimum seconds between operation attempts (spec default 2).

  • max_delay (float, default: 120 ) –

    Maximum seconds between operation attempts (spec default 120).

Source code in docs_src/capo_glacier/_services/glacier.py
def wait_until_vault_not_exists(
    self,
    account_id: "capo_glacier.types.string.string",
    vault_name: "capo_glacier.types.string.string",
    *,
    max_wait_time: float,
    min_delay: float = 3,
    max_delay: float = 120,
    config_overrides: Optional[GlacierClientConfig] = None,
) -> ServiceError:
    """Wait for vault_not_exists.

    Args:
        account_id: <p>The <code>AccountId</code> value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '<code>-</code>' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID. </p>
        vault_name: <p>The name of the vault.</p>
        max_wait_time: Maximum total seconds to wait before raising WaiterTimeoutError.
        min_delay: Minimum seconds between operation attempts (spec default 2).
        max_delay: Maximum seconds between operation attempts (spec default 120).
    """
    start = time.monotonic()
    attempt = 0
    while True:
        op_output: "capo_glacier.types.describe_vault_output.DescribeVaultOutput | None" = None
        op_error: ServiceError | None = None
        try:
            op_output = self.describe_vault(  # noqa: F841
                account_id, vault_name, config_overrides=config_overrides
            )
        except ServiceError as e:
            op_error = e
        if op_output is not None:
            pass
        elif op_error is not None and op_error.code == "ResourceNotFoundException":
            return op_error
        elif op_error is not None:
            raise op_error

        elapsed = time.monotonic() - start
        remaining = max_wait_time - elapsed
        if remaining <= 0:
            raise WaiterTimeoutError("vault_not_exists", max_wait_time)
        delay = min(max_delay, min_delay * (2**attempt))
        delay = random.uniform(min_delay, delay)
        delay = min(delay, remaining)
        time.sleep(delay)
        attempt += 1