- 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.
GetCanaryCommand
Retrieves complete information about one canary. You must specify the name of the canary that you want. To get a list of canaries and their names, use DescribeCanaries .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SyntheticsClient, GetCanaryCommand } from "@aws-sdk/client-synthetics"; // ES Modules import
// const { SyntheticsClient, GetCanaryCommand } = require("@aws-sdk/client-synthetics"); // CommonJS import
const client = new SyntheticsClient(config);
const input = { // GetCanaryRequest
Name: "STRING_VALUE", // required
};
const command = new GetCanaryCommand(input);
const response = await client.send(command);
// { // GetCanaryResponse
// Canary: { // Canary
// Id: "STRING_VALUE",
// Name: "STRING_VALUE",
// Code: { // CanaryCodeOutput
// SourceLocationArn: "STRING_VALUE",
// Handler: "STRING_VALUE",
// },
// ExecutionRoleArn: "STRING_VALUE",
// Schedule: { // CanaryScheduleOutput
// Expression: "STRING_VALUE",
// DurationInSeconds: Number("long"),
// },
// RunConfig: { // CanaryRunConfigOutput
// TimeoutInSeconds: Number("int"),
// MemoryInMB: Number("int"),
// ActiveTracing: true || false,
// },
// SuccessRetentionPeriodInDays: Number("int"),
// FailureRetentionPeriodInDays: Number("int"),
// Status: { // CanaryStatus
// State: "CREATING" || "READY" || "STARTING" || "RUNNING" || "UPDATING" || "STOPPING" || "STOPPED" || "ERROR" || "DELETING",
// StateReason: "STRING_VALUE",
// StateReasonCode: "INVALID_PERMISSIONS" || "CREATE_PENDING" || "CREATE_IN_PROGRESS" || "CREATE_FAILED" || "UPDATE_PENDING" || "UPDATE_IN_PROGRESS" || "UPDATE_COMPLETE" || "ROLLBACK_COMPLETE" || "ROLLBACK_FAILED" || "DELETE_IN_PROGRESS" || "DELETE_FAILED" || "SYNC_DELETE_IN_PROGRESS",
// },
// Timeline: { // CanaryTimeline
// Created: new Date("TIMESTAMP"),
// LastModified: new Date("TIMESTAMP"),
// LastStarted: new Date("TIMESTAMP"),
// LastStopped: new Date("TIMESTAMP"),
// },
// ArtifactS3Location: "STRING_VALUE",
// EngineArn: "STRING_VALUE",
// RuntimeVersion: "STRING_VALUE",
// VpcConfig: { // VpcConfigOutput
// VpcId: "STRING_VALUE",
// SubnetIds: [ // SubnetIds
// "STRING_VALUE",
// ],
// SecurityGroupIds: [ // SecurityGroupIds
// "STRING_VALUE",
// ],
// Ipv6AllowedForDualStack: true || false,
// },
// VisualReference: { // VisualReferenceOutput
// BaseScreenshots: [ // BaseScreenshots
// { // BaseScreenshot
// ScreenshotName: "STRING_VALUE", // required
// IgnoreCoordinates: [ // BaseScreenshotIgnoreCoordinates
// "STRING_VALUE",
// ],
// },
// ],
// BaseCanaryRunId: "STRING_VALUE",
// },
// ProvisionedResourceCleanup: "AUTOMATIC" || "OFF",
// Tags: { // TagMap
// "<keys>": "STRING_VALUE",
// },
// ArtifactConfig: { // ArtifactConfigOutput
// S3Encryption: { // S3EncryptionConfig
// EncryptionMode: "SSE_S3" || "SSE_KMS",
// KmsKeyArn: "STRING_VALUE",
// },
// },
// },
// };
GetCanaryCommand Input
See GetCanaryCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Name Required | string | undefined | The name of the canary that you want details for. |
GetCanaryCommand Output
See GetCanaryCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Canary | Canary | undefined | A structure that contains the full information about the canary. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerException | server | An unknown internal error occurred. |
ValidationException | client | A parameter could not be validated. |
SyntheticsServiceException | Base exception class for all service exceptions from Synthetics service. |