- 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.
GetKeyCommand
Returns a key value pair.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudFrontKeyValueStoreClient, GetKeyCommand } from "@aws-sdk/client-cloudfront-keyvaluestore"; // ES Modules import
// const { CloudFrontKeyValueStoreClient, GetKeyCommand } = require("@aws-sdk/client-cloudfront-keyvaluestore"); // CommonJS import
const client = new CloudFrontKeyValueStoreClient(config);
const input = { // GetKeyRequest
KvsARN: "STRING_VALUE", // required
Key: "STRING_VALUE", // required
};
const command = new GetKeyCommand(input);
const response = await client.send(command);
// { // GetKeyResponse
// Key: "STRING_VALUE", // required
// Value: "STRING_VALUE", // required
// ItemCount: Number("int"), // required
// TotalSizeInBytes: Number("long"), // required
// };
Example Usage
Loading code editor
GetKeyCommand Input
See GetKeyCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Key Required | string | undefined | The key to get. |
KvsARN Required | string | undefined | The Amazon Resource Name (ARN) of the Key Value Store. |
GetKeyCommand Output
See GetKeyCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ItemCount Required | number | undefined | Number of key value pairs in the Key Value Store. |
Key Required | string | undefined | The key of the key value pair. |
TotalSizeInBytes Required | number | undefined | Total size of the Key Value Store in bytes. |
Value Required | string | undefined | The value of the key value pair. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | Access denied. |
ConflictException | client | Resource is not in expected state. |
InternalServerException | server | Internal server error. |
ResourceNotFoundException | client | Resource was not found. |
CloudFrontKeyValueStoreServiceException | Base exception class for all service exceptions from CloudFrontKeyValueStore service. |