Skip to content

Commit

Permalink
feat(client-docdb): Enable copy-on-write restore type
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Jul 21, 2022
1 parent b8837a8 commit 9173056
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
40 changes: 40 additions & 0 deletions clients/client-docdb/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,11 @@ export interface DBCluster {
*/
AssociatedRoles?: DBClusterRole[];

/**
* <p>Identifies the clone group to which the DB cluster is associated.</p>
*/
CloneGroupId?: string;

/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated Time
* (UTC).</p>
Expand Down Expand Up @@ -1986,6 +1991,11 @@ export interface CreateDBInstanceMessage {
*/
DBClusterIdentifier: string | undefined;

/**
* <p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>
*/
CopyTagsToSnapshot?: boolean;

/**
* <p>A value that specifies the order in which an Amazon DocumentDB replica is promoted to the
* primary instance after a failure of the existing primary instance.</p>
Expand Down Expand Up @@ -2434,6 +2444,11 @@ export interface DBInstance {
*/
CACertificateIdentifier?: string;

/**
* <p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>
*/
CopyTagsToSnapshot?: boolean;

/**
* <p>A value that specifies the order in which an Amazon DocumentDB replica is promoted to the
* primary instance after a failure of the existing primary instance.</p>
Expand Down Expand Up @@ -5684,6 +5699,11 @@ export interface ModifyDBInstanceMessage {
*/
CACertificateIdentifier?: string;

/**
* <p>A value that indicates whether to copy all tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>
*/
CopyTagsToSnapshot?: boolean;

/**
* <p>A value that specifies the order in which an Amazon DocumentDB replica is promoted to the primary instance after a failure of the existing primary instance.</p>
* <p>Default: 1</p>
Expand Down Expand Up @@ -6326,6 +6346,26 @@ export interface RestoreDBClusterToPointInTimeMessage {
*/
DBClusterIdentifier: string | undefined;

/**
* <p>The type of restore to be performed. You can specify one of the following values:</p>
* <ul>
* <li>
* <p>
* <code>full-copy</code> - The new DB cluster is restored as a full copy of the
* source DB cluster.</p>
* </li>
* <li>
* <p>
* <code>copy-on-write</code> - The new DB cluster is restored as a clone of the
* source DB cluster.</p>
* </li>
* </ul>
* <p>Constraints: You can't specify <code>copy-on-write</code> if the engine version of the source DB cluster is earlier than 1.11.</p>
* <p>If you don't specify a <code>RestoreType</code> value, then the new DB cluster is
* restored as a full copy of the source DB cluster.</p>
*/
RestoreType?: string;

/**
* <p>The identifier of the source cluster from which to restore.</p>
* <p>Constraints:</p>
Expand Down
17 changes: 17 additions & 0 deletions clients/client-docdb/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5068,6 +5068,9 @@ const serializeAws_queryCreateDBInstanceMessage = (input: CreateDBInstanceMessag
if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) {
entries["DBClusterIdentifier"] = input.DBClusterIdentifier;
}
if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) {
entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot;
}
if (input.PromotionTier !== undefined && input.PromotionTier !== null) {
entries["PromotionTier"] = input.PromotionTier;
}
Expand Down Expand Up @@ -5914,6 +5917,9 @@ const serializeAws_queryModifyDBInstanceMessage = (input: ModifyDBInstanceMessag
if (input.CACertificateIdentifier !== undefined && input.CACertificateIdentifier !== null) {
entries["CACertificateIdentifier"] = input.CACertificateIdentifier;
}
if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) {
entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot;
}
if (input.PromotionTier !== undefined && input.PromotionTier !== null) {
entries["PromotionTier"] = input.PromotionTier;
}
Expand Down Expand Up @@ -6188,6 +6194,9 @@ const serializeAws_queryRestoreDBClusterToPointInTimeMessage = (
if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) {
entries["DBClusterIdentifier"] = input.DBClusterIdentifier;
}
if (input.RestoreType !== undefined && input.RestoreType !== null) {
entries["RestoreType"] = input.RestoreType;
}
if (input.SourceDBClusterIdentifier !== undefined && input.SourceDBClusterIdentifier !== null) {
entries["SourceDBClusterIdentifier"] = input.SourceDBClusterIdentifier;
}
Expand Down Expand Up @@ -6620,6 +6629,7 @@ const deserializeAws_queryDBCluster = (output: any, context: __SerdeContext): DB
DbClusterResourceId: undefined,
DBClusterArn: undefined,
AssociatedRoles: undefined,
CloneGroupId: undefined,
ClusterCreateTime: undefined,
EnabledCloudwatchLogsExports: undefined,
DeletionProtection: undefined,
Expand Down Expand Up @@ -6742,6 +6752,9 @@ const deserializeAws_queryDBCluster = (output: any, context: __SerdeContext): DB
context
);
}
if (output["CloneGroupId"] !== undefined) {
contents.CloneGroupId = __expectString(output["CloneGroupId"]);
}
if (output["ClusterCreateTime"] !== undefined) {
contents.ClusterCreateTime = __expectNonNull(__parseRfc3339DateTime(output["ClusterCreateTime"]));
}
Expand Down Expand Up @@ -7306,6 +7319,7 @@ const deserializeAws_queryDBInstance = (output: any, context: __SerdeContext): D
KmsKeyId: undefined,
DbiResourceId: undefined,
CACertificateIdentifier: undefined,
CopyTagsToSnapshot: undefined,
PromotionTier: undefined,
DBInstanceArn: undefined,
EnabledCloudwatchLogsExports: undefined,
Expand Down Expand Up @@ -7395,6 +7409,9 @@ const deserializeAws_queryDBInstance = (output: any, context: __SerdeContext): D
if (output["CACertificateIdentifier"] !== undefined) {
contents.CACertificateIdentifier = __expectString(output["CACertificateIdentifier"]);
}
if (output["CopyTagsToSnapshot"] !== undefined) {
contents.CopyTagsToSnapshot = __parseBoolean(output["CopyTagsToSnapshot"]);
}
if (output["PromotionTier"] !== undefined) {
contents.PromotionTier = __strictParseInt32(output["PromotionTier"]) as number;
}
Expand Down
42 changes: 42 additions & 0 deletions codegen/sdk-codegen/aws-models/docdb.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
"input": {
"target": "com.amazonaws.docdb#AddTagsToResourceMessage"
},
"output": {
"target": "smithy.api#Unit"
},
"errors": [
{
"target": "com.amazonaws.docdb#DBClusterNotFoundFault"
Expand Down Expand Up @@ -1150,6 +1153,12 @@
"smithy.api#required": {}
}
},
"CopyTagsToSnapshot": {
"target": "com.amazonaws.docdb#BooleanOptional",
"traits": {
"smithy.api#documentation": "<p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>"
}
},
"PromotionTier": {
"target": "com.amazonaws.docdb#IntegerOptional",
"traits": {
Expand Down Expand Up @@ -1604,6 +1613,12 @@
"smithy.api#documentation": "<p>Provides a list of the Identity and Access Management (IAM) roles that are associated with the cluster. (IAM) roles that are associated with a cluster grant permission for the cluster to access other Amazon Web Services services on your behalf.</p>"
}
},
"CloneGroupId": {
"target": "com.amazonaws.docdb#String",
"traits": {
"smithy.api#documentation": "<p>Identifies the clone group to which the DB cluster is associated.</p>"
}
},
"ClusterCreateTime": {
"target": "com.amazonaws.docdb#TStamp",
"traits": {
Expand Down Expand Up @@ -2337,6 +2352,12 @@
"smithy.api#documentation": "<p>The identifier of the CA certificate for this DB instance.</p>"
}
},
"CopyTagsToSnapshot": {
"target": "com.amazonaws.docdb#BooleanOptional",
"traits": {
"smithy.api#documentation": "<p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>"
}
},
"PromotionTier": {
"target": "com.amazonaws.docdb#IntegerOptional",
"traits": {
Expand Down Expand Up @@ -2802,6 +2823,9 @@
"input": {
"target": "com.amazonaws.docdb#DeleteDBClusterParameterGroupMessage"
},
"output": {
"target": "smithy.api#Unit"
},
"errors": [
{
"target": "com.amazonaws.docdb#DBParameterGroupNotFoundFault"
Expand Down Expand Up @@ -2937,6 +2961,9 @@
"input": {
"target": "com.amazonaws.docdb#DeleteDBSubnetGroupMessage"
},
"output": {
"target": "smithy.api#Unit"
},
"errors": [
{
"target": "com.amazonaws.docdb#DBSubnetGroupNotFoundFault"
Expand Down Expand Up @@ -5411,6 +5438,12 @@
"smithy.api#documentation": "<p>Indicates the certificate that needs to be associated with the instance.</p>"
}
},
"CopyTagsToSnapshot": {
"target": "com.amazonaws.docdb#BooleanOptional",
"traits": {
"smithy.api#documentation": "<p>A value that indicates whether to copy all tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>"
}
},
"PromotionTier": {
"target": "com.amazonaws.docdb#IntegerOptional",
"traits": {
Expand Down Expand Up @@ -6157,6 +6190,9 @@
"input": {
"target": "com.amazonaws.docdb#RemoveTagsFromResourceMessage"
},
"output": {
"target": "smithy.api#Unit"
},
"errors": [
{
"target": "com.amazonaws.docdb#DBClusterNotFoundFault"
Expand Down Expand Up @@ -6494,6 +6530,12 @@
"smithy.api#required": {}
}
},
"RestoreType": {
"target": "com.amazonaws.docdb#String",
"traits": {
"smithy.api#documentation": "<p>The type of restore to be performed. You can specify one of the following values:</p>\n <ul>\n <li>\n <p>\n <code>full-copy</code> - The new DB cluster is restored as a full copy of the\n source DB cluster.</p>\n </li>\n <li>\n <p>\n <code>copy-on-write</code> - The new DB cluster is restored as a clone of the\n source DB cluster.</p>\n </li>\n </ul>\n <p>Constraints: You can't specify <code>copy-on-write</code> if the engine version of the source DB cluster is earlier than 1.11.</p>\n <p>If you don't specify a <code>RestoreType</code> value, then the new DB cluster is\n restored as a full copy of the source DB cluster.</p>"
}
},
"SourceDBClusterIdentifier": {
"target": "com.amazonaws.docdb#String",
"traits": {
Expand Down

0 comments on commit 9173056

Please sign in to comment.