- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetVaultAccessPolicyCommand
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 .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { GlacierClient, GetVaultAccessPolicyCommand } from "@aws-sdk/client-glacier"; // ES Modules import
// const { GlacierClient, GetVaultAccessPolicyCommand } = require("@aws-sdk/client-glacier"); // CommonJS import
const client = new GlacierClient(config);
const input = { // GetVaultAccessPolicyInput
accountId: "STRING_VALUE", // required
vaultName: "STRING_VALUE", // required
};
const command = new GetVaultAccessPolicyCommand(input);
const response = await client.send(command);
// { // GetVaultAccessPolicyOutput
// policy: { // VaultAccessPolicy
// Policy: "STRING_VALUE",
// },
// };
Example Usage
GetVaultAccessPolicyCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
accountId Required | string | undefined | The |
vaultName Required | string | undefined | The name of the vault. |
GetVaultAccessPolicyCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
policy | VaultAccessPolicy | undefined | Contains the returned vault access policy as a JSON string. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidParameterValueException | client | Returned if a parameter of the request is incorrectly specified. |
MissingParameterValueException | client | Returned if a required header or parameter is missing from the request. |
ResourceNotFoundException | client | Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist. |
ServiceUnavailableException | server | Returned if the service cannot complete the request. |
GlacierServiceException | Base exception class for all service exceptions from Glacier service. |