ModifyClusterSnapshot - Amazon Redshift

ModifyClusterSnapshot

Modifies the settings for a snapshot.

This exanmple modifies the manual retention period setting for a cluster snapshot.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

SnapshotIdentifier

The identifier of the snapshot whose setting you want to modify.

Type: String

Length Constraints: Maximum length of 2147483647.

Required: Yes

Force

A Boolean option to override an exception if the retention period has already passed.

Type: Boolean

Required: No

ManualSnapshotRetentionPeriod

The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.

If the manual snapshot falls outside of the new retention period, you can specify the force option to immediately delete the snapshot.

The value must be either -1 or an integer between 1 and 3,653.

Type: Integer

Required: No

Response Elements

The following element is returned by the service.

Snapshot

Describes a snapshot.

Type: Snapshot object

Errors

For information about the errors that are common to all actions, see Common Errors.

ClusterSnapshotNotFound

The snapshot identifier does not refer to an existing cluster snapshot.

HTTP Status Code: 404

InvalidClusterSnapshotState

The specified cluster snapshot is not in the available state, or other accounts are authorized to access the snapshot.

HTTP Status Code: 400

InvalidRetentionPeriodFault

The retention period specified is either in the past or is not a valid value.

The value must be either -1 or an integer between 1 and 3,653.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of ModifyClusterSnapshot.

Sample Request

https://redshift.us-east-2.amazonaws.com/ ?Action=ModifyClusterSnapshot &ClusterIdentifier=mycluster &SnapshotIdentifier=mysnapshotid &ManualSnapshotRetentionPeriod=10 &SignatureMethod=HmacSHA256&SignatureVersion=4 &Version=2012-12-01 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIAIOSFODNN7EXAMPLE/20190817/us-east-2/redshift/aws4_request &X-Amz-Date=20190825T160000Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=0aa1234bb5cc678ddddd901ee2ff3aa45678b90c12d345e6ff789012345a6b7b

Sample Response

<ModifyClusterSnapshotResponse xmlns="http://redshift.amazonaws.com/doc/2012-12-01/"> <ModifyClusterSnapshotResult> <Snapshot> <SnapshotRetentionStartTime>2019-12-27T18:19:14.966Z</SnapshotRetentionStartTime> <ClusterIdentifier>mycluster</ClusterIdentifier> <EncryptedWithHSM>false</EncryptedWithHSM> <NumberOfNodes>1</NumberOfNodes> <OwnerAccount>123456789012</OwnerAccount> <AvailabilityZone>us-east-2a</AvailabilityZone> <ClusterVersion>1.0</ClusterVersion> <ManualSnapshotRetentionPeriod>10</ManualSnapshotRetentionPeriod> <TotalBackupSizeInMegaBytes>62758.0</TotalBackupSizeInMegaBytes> <VpcId>vpc-a1abc1a1</VpcId> <BackupProgressInMegaBytes>15.0</BackupProgressInMegaBytes> <CurrentBackupRateInMegaBytesPerSecond>5.4506</CurrentBackupRateInMegaBytesPerSecond> <ClusterCreateTime>2019-12-23T23:21:27.977Z</ClusterCreateTime> <ElapsedTimeInSeconds>2</ElapsedTimeInSeconds> <MasterUsername>adminuser</MasterUsername> <DBName>dev</DBName> <ActualIncrementalBackupSizeInMegaBytes>15.0</ActualIncrementalBackupSizeInMegaBytes> <SnapshotType>manual</SnapshotType> <EnhancedVpcRouting>false</EnhancedVpcRouting> <ManualSnapshotRemainingDays>9</ManualSnapshotRemainingDays> <SnapshotIdentifier>mysnapshotid</SnapshotIdentifier> <NodeType>dc2.large</NodeType> <Tags/> <Encrypted>false</Encrypted> <Port>5439</Port> <EstimatedSecondsToCompletion>0</EstimatedSecondsToCompletion> <MaintenanceTrackName>current</MaintenanceTrackName> <SnapshotCreateTime>2019-12-27T18:19:12.214Z</SnapshotCreateTime> <Status>available</Status> </Snapshot> </ModifyClusterSnapshotResult> <ResponseMetadata> <RequestId>f377d8a2-28e9-11ea-b6af-7126da6f11af</RequestId> </ResponseMetadata> </ModifyClusterSnapshotResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: