DescribeKeyCommand

Retrieves the API key resource details.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { LocationClient, DescribeKeyCommand } from "@aws-sdk/client-location"; // ES Modules import
// const { LocationClient, DescribeKeyCommand } = require("@aws-sdk/client-location"); // CommonJS import
const client = new LocationClient(config);
const input = { // DescribeKeyRequest
  KeyName: "STRING_VALUE", // required
};
const command = new DescribeKeyCommand(input);
const response = await client.send(command);
// { // DescribeKeyResponse
//   Key: "STRING_VALUE", // required
//   KeyArn: "STRING_VALUE", // required
//   KeyName: "STRING_VALUE", // required
//   Restrictions: { // ApiKeyRestrictions
//     AllowActions: [ // ApiKeyActionList // required
//       "STRING_VALUE",
//     ],
//     AllowResources: [ // GeoArnList // required
//       "STRING_VALUE",
//     ],
//     AllowReferers: [ // RefererPatternList
//       "STRING_VALUE",
//     ],
//   },
//   CreateTime: new Date("TIMESTAMP"), // required
//   ExpireTime: new Date("TIMESTAMP"), // required
//   UpdateTime: new Date("TIMESTAMP"), // required
//   Description: "STRING_VALUE",
//   Tags: { // TagMap
//     "<keys>": "STRING_VALUE",
//   },
// };

DescribeKeyCommand Input

See DescribeKeyCommandInput for more details

Parameter
Type
Description
KeyName
Required
string | undefined

The name of the API key resource.

DescribeKeyCommand Output

See DescribeKeyCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
CreateTime
Required
Date | undefined

The timestamp for when the API key resource was created in ISO 8601  format: YYYY-MM-DDThh:mm:ss.sssZ.

ExpireTime
Required
Date | undefined

The timestamp for when the API key resource will expire in ISO 8601  format: YYYY-MM-DDThh:mm:ss.sssZ.

Key
Required
string | undefined

The key value/string of an API key.

KeyArn
Required
string | undefined

The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.

  • Format example: arn:aws:geo:region:account-id:key/ExampleKey

KeyName
Required
string | undefined

The name of the API key resource.

Restrictions
Required
ApiKeyRestrictions | undefined

API Restrictions on the allowed actions, resources, and referers for an API key resource.

UpdateTime
Required
Date | undefined

The timestamp for when the API key resource was last updated in ISO 8601  format: YYYY-MM-DDThh:mm:ss.sssZ.

Description
string | undefined

The optional description for the API key resource.

Tags
Record<string, string> | undefined

Tags associated with the API key resource.

Throws

Name
Fault
Details
AccessDeniedException
client

The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.

InternalServerException
server

The request has failed to process because of an unknown server error, exception, or failure.

ResourceNotFoundException
client

The resource that you've entered was not found in your AWS account.

ThrottlingException
client

The request was denied because of request throttling.

ValidationException
client

The input failed to meet the constraints specified by the AWS service.

LocationServiceException
Base exception class for all service exceptions from Location service.