- 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.
GetPermissionCommand
Retrieves the contents of a managed permission in JSON format.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { RAMClient, GetPermissionCommand } from "@aws-sdk/client-ram"; // ES Modules import
// const { RAMClient, GetPermissionCommand } = require("@aws-sdk/client-ram"); // CommonJS import
const client = new RAMClient(config);
const input = { // GetPermissionRequest
permissionArn: "STRING_VALUE", // required
permissionVersion: Number("int"),
};
const command = new GetPermissionCommand(input);
const response = await client.send(command);
// { // GetPermissionResponse
// permission: { // ResourceSharePermissionDetail
// arn: "STRING_VALUE",
// version: "STRING_VALUE",
// defaultVersion: true || false,
// name: "STRING_VALUE",
// resourceType: "STRING_VALUE",
// permission: "STRING_VALUE",
// creationTime: new Date("TIMESTAMP"),
// lastUpdatedTime: new Date("TIMESTAMP"),
// isResourceTypeDefault: true || false,
// permissionType: "CUSTOMER_MANAGED" || "AWS_MANAGED",
// featureSet: "CREATED_FROM_POLICY" || "PROMOTING_TO_STANDARD" || "STANDARD",
// status: "ATTACHABLE" || "UNATTACHABLE" || "DELETING" || "DELETED",
// tags: [ // TagList
// { // Tag
// key: "STRING_VALUE",
// value: "STRING_VALUE",
// },
// ],
// },
// };
GetPermissionCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
permissionArn Required | string | undefined | Specifies the Amazon Resource Name (ARN) of the permission whose contents you want to retrieve. To find the ARN for a permission, use either the ListPermissions operation or go to the Permissions library page in the RAM console and then choose the name of the permission. The ARN is displayed on the detail page. |
permissionVersion | number | undefined | Specifies the version number of the RAM permission to retrieve. If you don't specify this parameter, the operation retrieves the default version. To see the list of available versions, use ListPermissionVersions. |
GetPermissionCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
permission | ResourceSharePermissionDetail | undefined | An object with details about the permission. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidParameterException | client | The operation failed because a parameter you specified isn't valid. |
MalformedArnException | client | The operation failed because the specified Amazon Resource Name (ARN) has a format that isn't valid. |
OperationNotPermittedException | client | The operation failed because the requested operation isn't permitted. |
ServerInternalException | server | The operation failed because the service could not respond to the request due to an internal problem. Try again later. |
ServiceUnavailableException | server | The operation failed because the service isn't available. Try again later. |
UnknownResourceException | client | The operation failed because a specified resource couldn't be found. |
RAMServiceException | Base exception class for all service exceptions from RAM service. |