- 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.
UpdateArchiveCommand
Updates the specified archive.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudWatchEventsClient, UpdateArchiveCommand } from "@aws-sdk/client-cloudwatch-events"; // ES Modules import
// const { CloudWatchEventsClient, UpdateArchiveCommand } = require("@aws-sdk/client-cloudwatch-events"); // CommonJS import
const client = new CloudWatchEventsClient(config);
const input = { // UpdateArchiveRequest
ArchiveName: "STRING_VALUE", // required
Description: "STRING_VALUE",
EventPattern: "STRING_VALUE",
RetentionDays: Number("int"),
};
const command = new UpdateArchiveCommand(input);
const response = await client.send(command);
// { // UpdateArchiveResponse
// ArchiveArn: "STRING_VALUE",
// State: "ENABLED" || "DISABLED" || "CREATING" || "UPDATING" || "CREATE_FAILED" || "UPDATE_FAILED",
// StateReason: "STRING_VALUE",
// CreationTime: new Date("TIMESTAMP"),
// };
UpdateArchiveCommand Input
See UpdateArchiveCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ArchiveName Required | string | undefined | The name of the archive to update. |
Description | string | undefined | The description for the archive. |
EventPattern | string | undefined | The event pattern to use to filter events sent to the archive. |
RetentionDays | number | undefined | The number of days to retain events in the archive. |
UpdateArchiveCommand Output
See UpdateArchiveCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ArchiveArn | string | undefined | The ARN of the archive. |
CreationTime | Date | undefined | The time at which the archive was updated. |
State | ArchiveState | undefined | The state of the archive. |
StateReason | string | undefined | The reason that the archive is in the current state. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ConcurrentModificationException | client | There is concurrent modification on a rule, target, archive, or replay. |
InternalException | server | This exception occurs due to unexpected causes. |
InvalidEventPatternException | client | The event pattern is not valid. |
LimitExceededException | client | The request failed because it attempted to create resource beyond the allowed service quota. |
ResourceNotFoundException | client | An entity that you specified does not exist. |
CloudWatchEventsServiceException | Base exception class for all service exceptions from CloudWatchEvents service. |