Skip to content

Commit

Permalink
feat(client-dynamodb): Amazon DynamoDB now supports Incremental Expor…
Browse files Browse the repository at this point in the history
…t as an enhancement to the existing Export Table
  • Loading branch information
awstools committed Sep 26, 2023
1 parent 571d0db commit 4ff14d6
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 16 deletions.
6 changes: 6 additions & 0 deletions clients/client-dynamodb/src/commands/DescribeExportCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ export interface DescribeExportCommandOutput extends DescribeExportOutput, __Met
* // ExportFormat: "DYNAMODB_JSON" || "ION",
* // BilledSizeBytes: Number("long"),
* // ItemCount: Number("long"),
* // ExportType: "FULL_EXPORT" || "INCREMENTAL_EXPORT",
* // IncrementalExportSpecification: { // IncrementalExportSpecification
* // ExportFromTime: new Date("TIMESTAMP"),
* // ExportToTime: new Date("TIMESTAMP"),
* // ExportViewType: "NEW_IMAGE" || "NEW_AND_OLD_IMAGES",
* // },
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ export interface ExportTableToPointInTimeCommandOutput extends ExportTableToPoin
* S3SseAlgorithm: "AES256" || "KMS",
* S3SseKmsKeyId: "STRING_VALUE",
* ExportFormat: "DYNAMODB_JSON" || "ION",
* ExportType: "FULL_EXPORT" || "INCREMENTAL_EXPORT",
* IncrementalExportSpecification: { // IncrementalExportSpecification
* ExportFromTime: new Date("TIMESTAMP"),
* ExportToTime: new Date("TIMESTAMP"),
* ExportViewType: "NEW_IMAGE" || "NEW_AND_OLD_IMAGES",
* },
* };
* const command = new ExportTableToPointInTimeCommand(input);
* const response = await client.send(command);
Expand All @@ -80,6 +86,12 @@ export interface ExportTableToPointInTimeCommandOutput extends ExportTableToPoin
* // ExportFormat: "DYNAMODB_JSON" || "ION",
* // BilledSizeBytes: Number("long"),
* // ItemCount: Number("long"),
* // ExportType: "FULL_EXPORT" || "INCREMENTAL_EXPORT",
* // IncrementalExportSpecification: { // IncrementalExportSpecification
* // ExportFromTime: new Date("TIMESTAMP"),
* // ExportToTime: new Date("TIMESTAMP"),
* // ExportViewType: "NEW_IMAGE" || "NEW_AND_OLD_IMAGES",
* // },
* // },
* // };
*
Expand Down
7 changes: 5 additions & 2 deletions clients/client-dynamodb/src/commands/ListBackupsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ export interface ListBackupsCommandOutput extends ListBackupsOutput, __MetadataB

/**
* @public
* <p>List backups associated with an Amazon Web Services account. To list backups for a
* given table, specify <code>TableName</code>. <code>ListBackups</code> returns a
* <p>List DynamoDB backups that are associated with an Amazon Web Services account and weren't made with Amazon Web Services Backup.
* To list these backups for a given table, specify <code>TableName</code>. <code>ListBackups</code> returns a
* paginated list of results with at most 1 MB worth of items in a page. You can also
* specify a maximum number of entries to be returned in a page.</p>
* <p>In the request, start time is inclusive, but end time is exclusive. Note that these
* boundaries are for the time at which the original backup was requested.</p>
* <p>You can call <code>ListBackups</code> a maximum of five times per second.</p>
* <p>If you want to retrieve the complete list of backups made with Amazon Web Services Backup, use the
* <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/API_ListBackupJobs.html">Amazon Web Services Backup list API.</a>
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
1 change: 1 addition & 0 deletions clients/client-dynamodb/src/commands/ListExportsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ListExportsCommandOutput extends ListExportsOutput, __MetadataB
* // { // ExportSummary
* // ExportArn: "STRING_VALUE",
* // ExportStatus: "IN_PROGRESS" || "COMPLETED" || "FAILED",
* // ExportType: "FULL_EXPORT" || "INCREMENTAL_EXPORT",
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
82 changes: 82 additions & 0 deletions clients/client-dynamodb/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3758,6 +3758,58 @@ export const ExportStatus = {
*/
export type ExportStatus = (typeof ExportStatus)[keyof typeof ExportStatus];

/**
* @public
* @enum
*/
export const ExportType = {
FULL_EXPORT: "FULL_EXPORT",
INCREMENTAL_EXPORT: "INCREMENTAL_EXPORT",
} as const;

/**
* @public
*/
export type ExportType = (typeof ExportType)[keyof typeof ExportType];

/**
* @public
* @enum
*/
export const ExportViewType = {
NEW_AND_OLD_IMAGES: "NEW_AND_OLD_IMAGES",
NEW_IMAGE: "NEW_IMAGE",
} as const;

/**
* @public
*/
export type ExportViewType = (typeof ExportViewType)[keyof typeof ExportViewType];

/**
* @public
* <p>Optional object containing the parameters specific to an incremental export.</p>
*/
export interface IncrementalExportSpecification {
/**
* @public
* <p>Time in the past which provides the inclusive start range for the export table's data, counted in seconds from the start of the Unix epoch. The incremental export will reflect the table's state including and after this point in time.</p>
*/
ExportFromTime?: Date;

/**
* @public
* <p>Time in the past which provides the exclusive end range for the export table's data, counted in seconds from the start of the Unix epoch. The incremental export will reflect the table's state just prior to this point in time. If this is not provided, the latest time with data available will be used.</p>
*/
ExportToTime?: Date;

/**
* @public
* <p>Choice of whether to output the previous item image prior to the start time of the incremental export. Valid values are <code>NEW_AND_OLD_IMAGES</code> and <code>NEW_IMAGES</code>.</p>
*/
ExportViewType?: ExportViewType | string;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -3910,6 +3962,18 @@ export interface ExportDescription {
* <p>The number of items exported.</p>
*/
ItemCount?: number;

/**
* @public
* <p>Choice of whether to execute as a full export or incremental export. Valid values are <code>FULL_EXPORT</code> or <code>INCREMENTAL_EXPORT</code>. If <code>INCREMENTAL_EXPORT</code> is provided, the <code>IncrementalExportSpecification</code> must also be used.</p>
*/
ExportType?: ExportType | string;

/**
* @public
* <p>Optional object containing the parameters specific to an incremental export.</p>
*/
IncrementalExportSpecification?: IncrementalExportSpecification;
}

/**
Expand Down Expand Up @@ -5085,6 +5149,18 @@ export interface ExportTableToPointInTimeInput {
* <code>DYNAMODB_JSON</code> or <code>ION</code>.</p>
*/
ExportFormat?: ExportFormat | string;

/**
* @public
* <p>Choice of whether to execute as a full export or incremental export. Valid values are <code>FULL_EXPORT</code> or <code>INCREMENTAL_EXPORT</code>. If <code>INCREMENTAL_EXPORT</code> is provided, the <code>IncrementalExportSpecification</code> must also be used.</p>
*/
ExportType?: ExportType | string;

/**
* @public
* <p>Optional object containing the parameters specific to an incremental export.</p>
*/
IncrementalExportSpecification?: IncrementalExportSpecification;
}

/**
Expand Down Expand Up @@ -5398,6 +5474,12 @@ export interface ExportSummary {
* FAILED.</p>
*/
ExportStatus?: ExportStatus | string;

/**
* @public
* <p>Choice of whether to execute as a full export or incremental export. Valid values are <code>FULL_EXPORT</code> or <code>INCREMENTAL_EXPORT</code>. If <code>INCREMENTAL_EXPORT</code> is provided, the <code>IncrementalExportSpecification</code> must also be used.</p>
*/
ExportType?: ExportType | string;
}

/**
Expand Down
27 changes: 27 additions & 0 deletions clients/client-dynamodb/src/protocols/Aws_json1_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ import {
ImportTableDescription,
ImportTableInput,
ImportTableOutput,
IncrementalExportSpecification,
IndexNotFoundException,
InputFormatOptions,
InternalServerError,
Expand Down Expand Up @@ -4834,6 +4835,8 @@ const se_ExportTableToPointInTimeInput = (input: ExportTableToPointInTimeInput,
ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
ExportFormat: [],
ExportTime: (_) => Math.round(_.getTime() / 1000),
ExportType: [],
IncrementalExportSpecification: (_) => se_IncrementalExportSpecification(_, context),
S3Bucket: [],
S3BucketOwner: [],
S3Prefix: [],
Expand Down Expand Up @@ -4975,6 +4978,17 @@ const se_ImportTableInput = (input: ImportTableInput, context: __SerdeContext):
});
};

/**
* serializeAws_json1_0IncrementalExportSpecification
*/
const se_IncrementalExportSpecification = (input: IncrementalExportSpecification, context: __SerdeContext): any => {
return take(input, {
ExportFromTime: (_) => Math.round(_.getTime() / 1000),
ExportToTime: (_) => Math.round(_.getTime() / 1000),
ExportViewType: [],
});
};

// se_InputFormatOptions omitted.

/**
Expand Down Expand Up @@ -6188,8 +6202,10 @@ const de_ExportDescription = (output: any, context: __SerdeContext): ExportDescr
ExportManifest: __expectString,
ExportStatus: __expectString,
ExportTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
ExportType: __expectString,
FailureCode: __expectString,
FailureMessage: __expectString,
IncrementalExportSpecification: (_: any) => de_IncrementalExportSpecification(_, context),
ItemCount: __expectLong,
S3Bucket: __expectString,
S3BucketOwner: __expectString,
Expand Down Expand Up @@ -6362,6 +6378,17 @@ const de_ImportTableOutput = (output: any, context: __SerdeContext): ImportTable
}) as any;
};

/**
* deserializeAws_json1_0IncrementalExportSpecification
*/
const de_IncrementalExportSpecification = (output: any, context: __SerdeContext): IncrementalExportSpecification => {
return take(output, {
ExportFromTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
ExportToTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
ExportViewType: __expectString,
}) as any;
};

// de_IndexNotFoundException omitted.

// de_InputFormatOptions omitted.
Expand Down

0 comments on commit 4ff14d6

Please sign in to comment.