This operation retrieves the access-policy subresource set on the vault; for more information on setting this subresource, see Set Vault Access Policy (PUT access-policy). If there is no access policy set on the vault, the operation returns a 404 Not found error. For more information about vault access policies, see Amazon Glacier Access Control with Vault Access Policies.
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)
–
Raises:
Examples:
To get the access-policy set on the vault
The example retrieves the access-policy set on the vault named example-vault.
>>> await client.get_vault_access_policy(account_id='-', vault_name='example-vault')
Source code in docs_src/capo_glacier/_services/async_glacier.py
| async def get_vault_access_policy(
self,
account_id: "capo_glacier.types.string.string",
vault_name: "capo_glacier.types.string.string",
*,
config_overrides: Optional[AsyncGlacierClientConfig] = None,
) -> "capo_glacier.types.get_vault_access_policy_output.GetVaultAccessPolicyOutput":
"""<p>This operation retrieves the <code>access-policy</code> subresource set on the vault; for more information on setting this subresource, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/api-SetVaultAccessPolicy.html">Set Vault Access Policy (PUT access-policy)</a>. If there is no access policy set on the vault, the operation returns a <code>404 Not found</code> error. For more information about vault access policies, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/vault-access-policy.html">Amazon Glacier Access Control with Vault Access Policies</a>.</p>
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>
Raises:
capo_glacier.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Returned if a parameter of the request is incorrectly specified.</p>
capo_glacier.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Returned if a required header or parameter is missing from the request.</p>
capo_glacier.errors.no_longer_supported_exception.NoLongerSupportedException: <p>Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.</p>
capo_glacier.errors.resource_not_found_exception.ResourceNotFoundException: <p>Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.</p>
capo_glacier.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returned if the service cannot complete the request.</p>
capo_glacier.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To get the access-policy set on the vault
The example retrieves the access-policy set on the vault named example-vault.
>>> await client.get_vault_access_policy(account_id='-', vault_name='example-vault')
"""
async def _handler(
req: "AsyncOperationRequest[capo_glacier.types.get_vault_access_policy_input.GetVaultAccessPolicyInput]",
) -> AsyncOperationResponse[
"capo_glacier.types.get_vault_access_policy_output.GetVaultAccessPolicyOutput"
]:
import capo_glacier._operations.glacier.get_vault_access_policy
(
output,
http_response,
) = await capo_glacier._operations.glacier.get_vault_access_policy.async_get_vault_access_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetVaultAccessPolicy")
)
input_: capo_glacier.types.get_vault_access_policy_input.GetVaultAccessPolicyInput = {
"account_id": account_id,
"vault_name": vault_name,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|