- 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.
GetStageCommand
Gets information about a Stage resource.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { APIGatewayClient, GetStageCommand } from "@aws-sdk/client-api-gateway"; // ES Modules import
// const { APIGatewayClient, GetStageCommand } = require("@aws-sdk/client-api-gateway"); // CommonJS import
const client = new APIGatewayClient(config);
const input = { // GetStageRequest
restApiId: "STRING_VALUE", // required
stageName: "STRING_VALUE", // required
};
const command = new GetStageCommand(input);
const response = await client.send(command);
// { // Stage
// deploymentId: "STRING_VALUE",
// clientCertificateId: "STRING_VALUE",
// stageName: "STRING_VALUE",
// description: "STRING_VALUE",
// cacheClusterEnabled: true || false,
// cacheClusterSize: "0.5" || "1.6" || "6.1" || "13.5" || "28.4" || "58.2" || "118" || "237",
// cacheClusterStatus: "CREATE_IN_PROGRESS" || "AVAILABLE" || "DELETE_IN_PROGRESS" || "NOT_AVAILABLE" || "FLUSH_IN_PROGRESS",
// methodSettings: { // MapOfMethodSettings
// "<keys>": { // MethodSetting
// metricsEnabled: true || false,
// loggingLevel: "STRING_VALUE",
// dataTraceEnabled: true || false,
// throttlingBurstLimit: Number("int"),
// throttlingRateLimit: Number("double"),
// cachingEnabled: true || false,
// cacheTtlInSeconds: Number("int"),
// cacheDataEncrypted: true || false,
// requireAuthorizationForCacheControl: true || false,
// unauthorizedCacheControlHeaderStrategy: "FAIL_WITH_403" || "SUCCEED_WITH_RESPONSE_HEADER" || "SUCCEED_WITHOUT_RESPONSE_HEADER",
// },
// },
// variables: { // MapOfStringToString
// "<keys>": "STRING_VALUE",
// },
// documentationVersion: "STRING_VALUE",
// accessLogSettings: { // AccessLogSettings
// format: "STRING_VALUE",
// destinationArn: "STRING_VALUE",
// },
// canarySettings: { // CanarySettings
// percentTraffic: Number("double"),
// deploymentId: "STRING_VALUE",
// stageVariableOverrides: {
// "<keys>": "STRING_VALUE",
// },
// useStageCache: true || false,
// },
// tracingEnabled: true || false,
// webAclArn: "STRING_VALUE",
// tags: {
// "<keys>": "STRING_VALUE",
// },
// createdDate: new Date("TIMESTAMP"),
// lastUpdatedDate: new Date("TIMESTAMP"),
// };
GetStageCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
restApiId Required | string | undefined | The string identifier of the associated RestApi. |
stageName Required | string | undefined | The name of the Stage resource to get information about. |
GetStageCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
accessLogSettings | AccessLogSettings | undefined | Settings for logging access in this stage. |
cacheClusterEnabled | boolean | undefined | Specifies whether a cache cluster is enabled for the stage. To activate a method-level cache, set |
cacheClusterSize | CacheClusterSize | undefined | The stage's cache capacity in GB. For more information about choosing a cache size, see Enabling API caching to enhance responsiveness . |
cacheClusterStatus | CacheClusterStatus | undefined | The status of the cache cluster for the stage, if enabled. |
canarySettings | CanarySettings | undefined | Settings for the canary deployment in this stage. |
clientCertificateId | string | undefined | The identifier of a client certificate for an API stage. |
createdDate | Date | undefined | The timestamp when the stage was created. |
deploymentId | string | undefined | The identifier of the Deployment that the stage points to. |
description | string | undefined | The stage's description. |
documentationVersion | string | undefined | The version of the associated API documentation. |
lastUpdatedDate | Date | undefined | The timestamp when the stage last updated. |
methodSettings | Record<string, MethodSetting> | undefined | A map that defines the method settings for a Stage resource. Keys (designated as |
stageName | string | undefined | The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters. |
tags | Record<string, string> | undefined | The collection of tags. Each tag element is associated with a given resource. |
tracingEnabled | boolean | undefined | Specifies whether active tracing with X-ray is enabled for the Stage. |
variables | Record<string, string> | undefined | A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match |
webAclArn | string | undefined | The ARN of the WebAcl associated with the Stage. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details. |
ConflictException | client | The request configuration has conflicts. For details, see the accompanying error message. |
LimitExceededException | client | The request exceeded the rate limit. Retry after the specified time period. |
NotFoundException | client | The requested resource is not found. Make sure that the request URI is correct. |
TooManyRequestsException | client | The request has reached its throttling limit. Retry after the specified time period. |
UnauthorizedException | client | The request is denied because the caller has insufficient permissions. |
APIGatewayServiceException | Base exception class for all service exceptions from APIGateway service. |