From 5319e55db5568cee7e16222eb83d9098874947e7 Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 14 Nov 2023 19:21:12 +0000 Subject: [PATCH] feat(client-backup): AWS Backup - Features: Provide Job Summary for your backup activity. --- clients/client-backup/README.md | 24 + clients/client-backup/src/Backup.ts | 69 ++ clients/client-backup/src/BackupClient.ts | 18 + .../src/commands/DescribeBackupJobCommand.ts | 1 + .../src/commands/DescribeCopyJobCommand.ts | 1 + .../commands/ListBackupJobSummariesCommand.ts | 172 ++++ .../src/commands/ListBackupJobsCommand.ts | 2 + .../commands/ListCopyJobSummariesCommand.ts | 172 ++++ .../src/commands/ListCopyJobsCommand.ts | 2 + .../ListRestoreJobSummariesCommand.ts | 170 ++++ clients/client-backup/src/commands/index.ts | 3 + clients/client-backup/src/models/models_0.ts | 792 +++++++++++++++++ .../ListBackupJobSummariesPaginator.ts | 50 ++ .../ListCopyJobSummariesPaginator.ts | 50 ++ .../ListRestoreJobSummariesPaginator.ts | 50 ++ clients/client-backup/src/pagination/index.ts | 3 + .../src/protocols/Aws_restJson1.ts | 357 ++++++++ codegen/sdk-codegen/aws-models/backup.json | 795 +++++++++++++++++- 18 files changed, 2729 insertions(+), 2 deletions(-) create mode 100644 clients/client-backup/src/commands/ListBackupJobSummariesCommand.ts create mode 100644 clients/client-backup/src/commands/ListCopyJobSummariesCommand.ts create mode 100644 clients/client-backup/src/commands/ListRestoreJobSummariesCommand.ts create mode 100644 clients/client-backup/src/pagination/ListBackupJobSummariesPaginator.ts create mode 100644 clients/client-backup/src/pagination/ListCopyJobSummariesPaginator.ts create mode 100644 clients/client-backup/src/pagination/ListRestoreJobSummariesPaginator.ts diff --git a/clients/client-backup/README.md b/clients/client-backup/README.md index f73019269961..bd2895c8deeb 100644 --- a/clients/client-backup/README.md +++ b/clients/client-backup/README.md @@ -535,6 +535,14 @@ ListBackupJobs [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/classes/listbackupjobscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listbackupjobscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listbackupjobscommandoutput.html) + +
+ +ListBackupJobSummaries + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/classes/listbackupjobsummariescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listbackupjobsummariescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listbackupjobsummariescommandoutput.html) +
@@ -583,6 +591,14 @@ ListCopyJobs [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/classes/listcopyjobscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listcopyjobscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listcopyjobscommandoutput.html) +
+
+ +ListCopyJobSummaries + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/classes/listcopyjobsummariescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listcopyjobsummariescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listcopyjobsummariescommandoutput.html) +
@@ -663,6 +679,14 @@ ListRestoreJobs [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/classes/listrestorejobscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listrestorejobscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listrestorejobscommandoutput.html) +
+
+ +ListRestoreJobSummaries + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/classes/listrestorejobsummariescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listrestorejobsummariescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-backup/interfaces/listrestorejobsummariescommandoutput.html) +
diff --git a/clients/client-backup/src/Backup.ts b/clients/client-backup/src/Backup.ts index 8ece9170d37a..2b7ff6ca0503 100644 --- a/clients/client-backup/src/Backup.ts +++ b/clients/client-backup/src/Backup.ts @@ -208,6 +208,11 @@ import { ListBackupJobsCommandInput, ListBackupJobsCommandOutput, } from "./commands/ListBackupJobsCommand"; +import { + ListBackupJobSummariesCommand, + ListBackupJobSummariesCommandInput, + ListBackupJobSummariesCommandOutput, +} from "./commands/ListBackupJobSummariesCommand"; import { ListBackupPlansCommand, ListBackupPlansCommandInput, @@ -238,6 +243,11 @@ import { ListCopyJobsCommandInput, ListCopyJobsCommandOutput, } from "./commands/ListCopyJobsCommand"; +import { + ListCopyJobSummariesCommand, + ListCopyJobSummariesCommandInput, + ListCopyJobSummariesCommandOutput, +} from "./commands/ListCopyJobSummariesCommand"; import { ListFrameworksCommand, ListFrameworksCommandInput, @@ -288,6 +298,11 @@ import { ListRestoreJobsCommandInput, ListRestoreJobsCommandOutput, } from "./commands/ListRestoreJobsCommand"; +import { + ListRestoreJobSummariesCommand, + ListRestoreJobSummariesCommandInput, + ListRestoreJobSummariesCommandOutput, +} from "./commands/ListRestoreJobSummariesCommand"; import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "./commands/ListTagsCommand"; import { PutBackupVaultAccessPolicyCommand, @@ -408,12 +423,14 @@ const commands = { GetRecoveryPointRestoreMetadataCommand, GetSupportedResourceTypesCommand, ListBackupJobsCommand, + ListBackupJobSummariesCommand, ListBackupPlansCommand, ListBackupPlanTemplatesCommand, ListBackupPlanVersionsCommand, ListBackupSelectionsCommand, ListBackupVaultsCommand, ListCopyJobsCommand, + ListCopyJobSummariesCommand, ListFrameworksCommand, ListLegalHoldsCommand, ListProtectedResourcesCommand, @@ -424,6 +441,7 @@ const commands = { ListReportJobsCommand, ListReportPlansCommand, ListRestoreJobsCommand, + ListRestoreJobSummariesCommand, ListTagsCommand, PutBackupVaultAccessPolicyCommand, PutBackupVaultLockConfigurationCommand, @@ -1111,6 +1129,23 @@ export interface Backup { cb: (err: any, data?: ListBackupJobsCommandOutput) => void ): void; + /** + * @see {@link ListBackupJobSummariesCommand} + */ + listBackupJobSummaries( + args: ListBackupJobSummariesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listBackupJobSummaries( + args: ListBackupJobSummariesCommandInput, + cb: (err: any, data?: ListBackupJobSummariesCommandOutput) => void + ): void; + listBackupJobSummaries( + args: ListBackupJobSummariesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListBackupJobSummariesCommandOutput) => void + ): void; + /** * @see {@link ListBackupPlansCommand} */ @@ -1204,6 +1239,23 @@ export interface Backup { cb: (err: any, data?: ListCopyJobsCommandOutput) => void ): void; + /** + * @see {@link ListCopyJobSummariesCommand} + */ + listCopyJobSummaries( + args: ListCopyJobSummariesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listCopyJobSummaries( + args: ListCopyJobSummariesCommandInput, + cb: (err: any, data?: ListCopyJobSummariesCommandOutput) => void + ): void; + listCopyJobSummaries( + args: ListCopyJobSummariesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListCopyJobSummariesCommandOutput) => void + ): void; + /** * @see {@link ListFrameworksCommand} */ @@ -1359,6 +1411,23 @@ export interface Backup { cb: (err: any, data?: ListRestoreJobsCommandOutput) => void ): void; + /** + * @see {@link ListRestoreJobSummariesCommand} + */ + listRestoreJobSummaries( + args: ListRestoreJobSummariesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listRestoreJobSummaries( + args: ListRestoreJobSummariesCommandInput, + cb: (err: any, data?: ListRestoreJobSummariesCommandOutput) => void + ): void; + listRestoreJobSummaries( + args: ListRestoreJobSummariesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListRestoreJobSummariesCommandOutput) => void + ): void; + /** * @see {@link ListTagsCommand} */ diff --git a/clients/client-backup/src/BackupClient.ts b/clients/client-backup/src/BackupClient.ts index 5bdae782d19f..679e9a8c6d90 100644 --- a/clients/client-backup/src/BackupClient.ts +++ b/clients/client-backup/src/BackupClient.ts @@ -154,6 +154,10 @@ import { GetSupportedResourceTypesCommandOutput, } from "./commands/GetSupportedResourceTypesCommand"; import { ListBackupJobsCommandInput, ListBackupJobsCommandOutput } from "./commands/ListBackupJobsCommand"; +import { + ListBackupJobSummariesCommandInput, + ListBackupJobSummariesCommandOutput, +} from "./commands/ListBackupJobSummariesCommand"; import { ListBackupPlansCommandInput, ListBackupPlansCommandOutput } from "./commands/ListBackupPlansCommand"; import { ListBackupPlanTemplatesCommandInput, @@ -169,6 +173,10 @@ import { } from "./commands/ListBackupSelectionsCommand"; import { ListBackupVaultsCommandInput, ListBackupVaultsCommandOutput } from "./commands/ListBackupVaultsCommand"; import { ListCopyJobsCommandInput, ListCopyJobsCommandOutput } from "./commands/ListCopyJobsCommand"; +import { + ListCopyJobSummariesCommandInput, + ListCopyJobSummariesCommandOutput, +} from "./commands/ListCopyJobSummariesCommand"; import { ListFrameworksCommandInput, ListFrameworksCommandOutput } from "./commands/ListFrameworksCommand"; import { ListLegalHoldsCommandInput, ListLegalHoldsCommandOutput } from "./commands/ListLegalHoldsCommand"; import { @@ -194,6 +202,10 @@ import { import { ListReportJobsCommandInput, ListReportJobsCommandOutput } from "./commands/ListReportJobsCommand"; import { ListReportPlansCommandInput, ListReportPlansCommandOutput } from "./commands/ListReportPlansCommand"; import { ListRestoreJobsCommandInput, ListRestoreJobsCommandOutput } from "./commands/ListRestoreJobsCommand"; +import { + ListRestoreJobSummariesCommandInput, + ListRestoreJobSummariesCommandOutput, +} from "./commands/ListRestoreJobSummariesCommand"; import { ListTagsCommandInput, ListTagsCommandOutput } from "./commands/ListTagsCommand"; import { PutBackupVaultAccessPolicyCommandInput, @@ -284,12 +296,14 @@ export type ServiceInputTypes = | GetLegalHoldCommandInput | GetRecoveryPointRestoreMetadataCommandInput | GetSupportedResourceTypesCommandInput + | ListBackupJobSummariesCommandInput | ListBackupJobsCommandInput | ListBackupPlanTemplatesCommandInput | ListBackupPlanVersionsCommandInput | ListBackupPlansCommandInput | ListBackupSelectionsCommandInput | ListBackupVaultsCommandInput + | ListCopyJobSummariesCommandInput | ListCopyJobsCommandInput | ListFrameworksCommandInput | ListLegalHoldsCommandInput @@ -300,6 +314,7 @@ export type ServiceInputTypes = | ListRecoveryPointsByResourceCommandInput | ListReportJobsCommandInput | ListReportPlansCommandInput + | ListRestoreJobSummariesCommandInput | ListRestoreJobsCommandInput | ListTagsCommandInput | PutBackupVaultAccessPolicyCommandInput @@ -363,12 +378,14 @@ export type ServiceOutputTypes = | GetLegalHoldCommandOutput | GetRecoveryPointRestoreMetadataCommandOutput | GetSupportedResourceTypesCommandOutput + | ListBackupJobSummariesCommandOutput | ListBackupJobsCommandOutput | ListBackupPlanTemplatesCommandOutput | ListBackupPlanVersionsCommandOutput | ListBackupPlansCommandOutput | ListBackupSelectionsCommandOutput | ListBackupVaultsCommandOutput + | ListCopyJobSummariesCommandOutput | ListCopyJobsCommandOutput | ListFrameworksCommandOutput | ListLegalHoldsCommandOutput @@ -379,6 +396,7 @@ export type ServiceOutputTypes = | ListRecoveryPointsByResourceCommandOutput | ListReportJobsCommandOutput | ListReportPlansCommandOutput + | ListRestoreJobSummariesCommandOutput | ListRestoreJobsCommandOutput | ListTagsCommandOutput | PutBackupVaultAccessPolicyCommandOutput diff --git a/clients/client-backup/src/commands/DescribeBackupJobCommand.ts b/clients/client-backup/src/commands/DescribeBackupJobCommand.ts index 992d3b7b90a8..e053a3fef3e1 100644 --- a/clients/client-backup/src/commands/DescribeBackupJobCommand.ts +++ b/clients/client-backup/src/commands/DescribeBackupJobCommand.ts @@ -84,6 +84,7 @@ export interface DescribeBackupJobCommandOutput extends DescribeBackupJobOutput, * // "": Number("long"), * // }, * // ResourceName: "STRING_VALUE", + * // MessageCategory: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-backup/src/commands/DescribeCopyJobCommand.ts b/clients/client-backup/src/commands/DescribeCopyJobCommand.ts index f5e3ee787a79..83a9461498c5 100644 --- a/clients/client-backup/src/commands/DescribeCopyJobCommand.ts +++ b/clients/client-backup/src/commands/DescribeCopyJobCommand.ts @@ -79,6 +79,7 @@ export interface DescribeCopyJobCommandOutput extends DescribeCopyJobOutput, __M * // "": Number("long"), * // }, * // ResourceName: "STRING_VALUE", + * // MessageCategory: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-backup/src/commands/ListBackupJobSummariesCommand.ts b/clients/client-backup/src/commands/ListBackupJobSummariesCommand.ts new file mode 100644 index 000000000000..e2ea26def1ed --- /dev/null +++ b/clients/client-backup/src/commands/ListBackupJobSummariesCommand.ts @@ -0,0 +1,172 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BackupClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupClient"; +import { ListBackupJobSummariesInput, ListBackupJobSummariesOutput } from "../models/models_0"; +import { de_ListBackupJobSummariesCommand, se_ListBackupJobSummariesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListBackupJobSummariesCommand}. + */ +export interface ListBackupJobSummariesCommandInput extends ListBackupJobSummariesInput {} +/** + * @public + * + * The output of {@link ListBackupJobSummariesCommand}. + */ +export interface ListBackupJobSummariesCommandOutput extends ListBackupJobSummariesOutput, __MetadataBearer {} + +/** + * @public + *

This is a request for a summary of backup jobs created + * or running within the most recent 30 days. You can + * include parameters AccountID, State, ResourceType, MessageCategory, + * AggregationPeriod, MaxResults, or NextToken to filter + * results.

+ *

This request returns a summary that contains + * Region, Account, State, ResourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BackupClient, ListBackupJobSummariesCommand } from "@aws-sdk/client-backup"; // ES Modules import + * // const { BackupClient, ListBackupJobSummariesCommand } = require("@aws-sdk/client-backup"); // CommonJS import + * const client = new BackupClient(config); + * const input = { // ListBackupJobSummariesInput + * AccountId: "STRING_VALUE", + * State: "CREATED" || "PENDING" || "RUNNING" || "ABORTING" || "ABORTED" || "COMPLETED" || "FAILED" || "EXPIRED" || "PARTIAL" || "AGGREGATE_ALL" || "ANY", + * ResourceType: "STRING_VALUE", + * MessageCategory: "STRING_VALUE", + * AggregationPeriod: "ONE_DAY" || "SEVEN_DAYS" || "FOURTEEN_DAYS", + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListBackupJobSummariesCommand(input); + * const response = await client.send(command); + * // { // ListBackupJobSummariesOutput + * // BackupJobSummaries: [ // BackupJobSummaryList + * // { // BackupJobSummary + * // Region: "STRING_VALUE", + * // AccountId: "STRING_VALUE", + * // State: "CREATED" || "PENDING" || "RUNNING" || "ABORTING" || "ABORTED" || "COMPLETED" || "FAILED" || "EXPIRED" || "PARTIAL" || "AGGREGATE_ALL" || "ANY", + * // ResourceType: "STRING_VALUE", + * // MessageCategory: "STRING_VALUE", + * // Count: Number("int"), + * // StartTime: new Date("TIMESTAMP"), + * // EndTime: new Date("TIMESTAMP"), + * // }, + * // ], + * // AggregationPeriod: "STRING_VALUE", + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListBackupJobSummariesCommandInput - {@link ListBackupJobSummariesCommandInput} + * @returns {@link ListBackupJobSummariesCommandOutput} + * @see {@link ListBackupJobSummariesCommandInput} for command's `input` shape. + * @see {@link ListBackupJobSummariesCommandOutput} for command's `response` shape. + * @see {@link BackupClientResolvedConfig | config} for BackupClient's `config` shape. + * + * @throws {@link InvalidParameterValueException} (client fault) + *

Indicates that something is wrong with a parameter's value. For example, the value is + * out of range.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

The request failed due to a temporary failure of the server.

+ * + * @throws {@link BackupServiceException} + *

Base exception class for all service exceptions from Backup service.

+ * + */ +export class ListBackupJobSummariesCommand extends $Command< + ListBackupJobSummariesCommandInput, + ListBackupJobSummariesCommandOutput, + BackupClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListBackupJobSummariesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BackupClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListBackupJobSummariesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BackupClient"; + const commandName = "ListBackupJobSummariesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "CryoControllerUserManager", + operation: "ListBackupJobSummaries", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListBackupJobSummariesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListBackupJobSummariesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListBackupJobSummariesCommand(output, context); + } +} diff --git a/clients/client-backup/src/commands/ListBackupJobsCommand.ts b/clients/client-backup/src/commands/ListBackupJobsCommand.ts index 666b7b86b01f..39d0f4f5342b 100644 --- a/clients/client-backup/src/commands/ListBackupJobsCommand.ts +++ b/clients/client-backup/src/commands/ListBackupJobsCommand.ts @@ -58,6 +58,7 @@ export interface ListBackupJobsCommandOutput extends ListBackupJobsOutput, __Met * ByCompleteAfter: new Date("TIMESTAMP"), * ByCompleteBefore: new Date("TIMESTAMP"), * ByParentJobId: "STRING_VALUE", + * ByMessageCategory: "STRING_VALUE", * }; * const command = new ListBackupJobsCommand(input); * const response = await client.send(command); @@ -94,6 +95,7 @@ export interface ListBackupJobsCommandOutput extends ListBackupJobsOutput, __Met * // ParentJobId: "STRING_VALUE", * // IsParent: true || false, * // ResourceName: "STRING_VALUE", + * // MessageCategory: "STRING_VALUE", * // }, * // ], * // NextToken: "STRING_VALUE", diff --git a/clients/client-backup/src/commands/ListCopyJobSummariesCommand.ts b/clients/client-backup/src/commands/ListCopyJobSummariesCommand.ts new file mode 100644 index 000000000000..41e7ff10cafc --- /dev/null +++ b/clients/client-backup/src/commands/ListCopyJobSummariesCommand.ts @@ -0,0 +1,172 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BackupClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupClient"; +import { ListCopyJobSummariesInput, ListCopyJobSummariesOutput } from "../models/models_0"; +import { de_ListCopyJobSummariesCommand, se_ListCopyJobSummariesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListCopyJobSummariesCommand}. + */ +export interface ListCopyJobSummariesCommandInput extends ListCopyJobSummariesInput {} +/** + * @public + * + * The output of {@link ListCopyJobSummariesCommand}. + */ +export interface ListCopyJobSummariesCommandOutput extends ListCopyJobSummariesOutput, __MetadataBearer {} + +/** + * @public + *

This request obtains a list of copy jobs created + * or running within the the most recent 30 days. You can + * include parameters AccountID, State, ResourceType, MessageCategory, + * AggregationPeriod, MaxResults, or NextToken to filter + * results.

+ *

This request returns a summary that contains + * Region, Account, State, RestourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BackupClient, ListCopyJobSummariesCommand } from "@aws-sdk/client-backup"; // ES Modules import + * // const { BackupClient, ListCopyJobSummariesCommand } = require("@aws-sdk/client-backup"); // CommonJS import + * const client = new BackupClient(config); + * const input = { // ListCopyJobSummariesInput + * AccountId: "STRING_VALUE", + * State: "CREATED" || "RUNNING" || "ABORTING" || "ABORTED" || "COMPLETING" || "COMPLETED" || "FAILING" || "FAILED" || "PARTIAL" || "AGGREGATE_ALL" || "ANY", + * ResourceType: "STRING_VALUE", + * MessageCategory: "STRING_VALUE", + * AggregationPeriod: "ONE_DAY" || "SEVEN_DAYS" || "FOURTEEN_DAYS", + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListCopyJobSummariesCommand(input); + * const response = await client.send(command); + * // { // ListCopyJobSummariesOutput + * // CopyJobSummaries: [ // CopyJobSummaryList + * // { // CopyJobSummary + * // Region: "STRING_VALUE", + * // AccountId: "STRING_VALUE", + * // State: "CREATED" || "RUNNING" || "ABORTING" || "ABORTED" || "COMPLETING" || "COMPLETED" || "FAILING" || "FAILED" || "PARTIAL" || "AGGREGATE_ALL" || "ANY", + * // ResourceType: "STRING_VALUE", + * // MessageCategory: "STRING_VALUE", + * // Count: Number("int"), + * // StartTime: new Date("TIMESTAMP"), + * // EndTime: new Date("TIMESTAMP"), + * // }, + * // ], + * // AggregationPeriod: "STRING_VALUE", + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListCopyJobSummariesCommandInput - {@link ListCopyJobSummariesCommandInput} + * @returns {@link ListCopyJobSummariesCommandOutput} + * @see {@link ListCopyJobSummariesCommandInput} for command's `input` shape. + * @see {@link ListCopyJobSummariesCommandOutput} for command's `response` shape. + * @see {@link BackupClientResolvedConfig | config} for BackupClient's `config` shape. + * + * @throws {@link InvalidParameterValueException} (client fault) + *

Indicates that something is wrong with a parameter's value. For example, the value is + * out of range.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

The request failed due to a temporary failure of the server.

+ * + * @throws {@link BackupServiceException} + *

Base exception class for all service exceptions from Backup service.

+ * + */ +export class ListCopyJobSummariesCommand extends $Command< + ListCopyJobSummariesCommandInput, + ListCopyJobSummariesCommandOutput, + BackupClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListCopyJobSummariesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BackupClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListCopyJobSummariesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BackupClient"; + const commandName = "ListCopyJobSummariesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "CryoControllerUserManager", + operation: "ListCopyJobSummaries", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListCopyJobSummariesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListCopyJobSummariesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListCopyJobSummariesCommand(output, context); + } +} diff --git a/clients/client-backup/src/commands/ListCopyJobsCommand.ts b/clients/client-backup/src/commands/ListCopyJobsCommand.ts index fff7e3749a8e..ae8a22bc9097 100644 --- a/clients/client-backup/src/commands/ListCopyJobsCommand.ts +++ b/clients/client-backup/src/commands/ListCopyJobsCommand.ts @@ -57,6 +57,7 @@ export interface ListCopyJobsCommandOutput extends ListCopyJobsOutput, __Metadat * ByCompleteBefore: new Date("TIMESTAMP"), * ByCompleteAfter: new Date("TIMESTAMP"), * ByParentJobId: "STRING_VALUE", + * ByMessageCategory: "STRING_VALUE", * }; * const command = new ListCopyJobsCommand(input); * const response = await client.send(command); @@ -91,6 +92,7 @@ export interface ListCopyJobsCommandOutput extends ListCopyJobsOutput, __Metadat * // "": Number("long"), * // }, * // ResourceName: "STRING_VALUE", + * // MessageCategory: "STRING_VALUE", * // }, * // ], * // NextToken: "STRING_VALUE", diff --git a/clients/client-backup/src/commands/ListRestoreJobSummariesCommand.ts b/clients/client-backup/src/commands/ListRestoreJobSummariesCommand.ts new file mode 100644 index 000000000000..5fa4f60d499b --- /dev/null +++ b/clients/client-backup/src/commands/ListRestoreJobSummariesCommand.ts @@ -0,0 +1,170 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BackupClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupClient"; +import { ListRestoreJobSummariesInput, ListRestoreJobSummariesOutput } from "../models/models_0"; +import { de_ListRestoreJobSummariesCommand, se_ListRestoreJobSummariesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListRestoreJobSummariesCommand}. + */ +export interface ListRestoreJobSummariesCommandInput extends ListRestoreJobSummariesInput {} +/** + * @public + * + * The output of {@link ListRestoreJobSummariesCommand}. + */ +export interface ListRestoreJobSummariesCommandOutput extends ListRestoreJobSummariesOutput, __MetadataBearer {} + +/** + * @public + *

This request obtains a summary of restore jobs created + * or running within the the most recent 30 days. You can + * include parameters AccountID, State, ResourceType, + * AggregationPeriod, MaxResults, or NextToken to filter + * results.

+ *

This request returns a summary that contains + * Region, Account, State, RestourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BackupClient, ListRestoreJobSummariesCommand } from "@aws-sdk/client-backup"; // ES Modules import + * // const { BackupClient, ListRestoreJobSummariesCommand } = require("@aws-sdk/client-backup"); // CommonJS import + * const client = new BackupClient(config); + * const input = { // ListRestoreJobSummariesInput + * AccountId: "STRING_VALUE", + * State: "CREATED" || "PENDING" || "RUNNING" || "ABORTED" || "COMPLETED" || "FAILED" || "AGGREGATE_ALL" || "ANY", + * ResourceType: "STRING_VALUE", + * AggregationPeriod: "ONE_DAY" || "SEVEN_DAYS" || "FOURTEEN_DAYS", + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListRestoreJobSummariesCommand(input); + * const response = await client.send(command); + * // { // ListRestoreJobSummariesOutput + * // RestoreJobSummaries: [ // RestoreJobSummaryList + * // { // RestoreJobSummary + * // Region: "STRING_VALUE", + * // AccountId: "STRING_VALUE", + * // State: "CREATED" || "PENDING" || "RUNNING" || "ABORTED" || "COMPLETED" || "FAILED" || "AGGREGATE_ALL" || "ANY", + * // ResourceType: "STRING_VALUE", + * // Count: Number("int"), + * // StartTime: new Date("TIMESTAMP"), + * // EndTime: new Date("TIMESTAMP"), + * // }, + * // ], + * // AggregationPeriod: "STRING_VALUE", + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListRestoreJobSummariesCommandInput - {@link ListRestoreJobSummariesCommandInput} + * @returns {@link ListRestoreJobSummariesCommandOutput} + * @see {@link ListRestoreJobSummariesCommandInput} for command's `input` shape. + * @see {@link ListRestoreJobSummariesCommandOutput} for command's `response` shape. + * @see {@link BackupClientResolvedConfig | config} for BackupClient's `config` shape. + * + * @throws {@link InvalidParameterValueException} (client fault) + *

Indicates that something is wrong with a parameter's value. For example, the value is + * out of range.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

The request failed due to a temporary failure of the server.

+ * + * @throws {@link BackupServiceException} + *

Base exception class for all service exceptions from Backup service.

+ * + */ +export class ListRestoreJobSummariesCommand extends $Command< + ListRestoreJobSummariesCommandInput, + ListRestoreJobSummariesCommandOutput, + BackupClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListRestoreJobSummariesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BackupClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListRestoreJobSummariesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BackupClient"; + const commandName = "ListRestoreJobSummariesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "CryoControllerUserManager", + operation: "ListRestoreJobSummaries", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListRestoreJobSummariesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListRestoreJobSummariesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListRestoreJobSummariesCommand(output, context); + } +} diff --git a/clients/client-backup/src/commands/index.ts b/clients/client-backup/src/commands/index.ts index 16498c9a8668..ca75ad195e61 100644 --- a/clients/client-backup/src/commands/index.ts +++ b/clients/client-backup/src/commands/index.ts @@ -39,12 +39,14 @@ export * from "./GetBackupVaultNotificationsCommand"; export * from "./GetLegalHoldCommand"; export * from "./GetRecoveryPointRestoreMetadataCommand"; export * from "./GetSupportedResourceTypesCommand"; +export * from "./ListBackupJobSummariesCommand"; export * from "./ListBackupJobsCommand"; export * from "./ListBackupPlanTemplatesCommand"; export * from "./ListBackupPlanVersionsCommand"; export * from "./ListBackupPlansCommand"; export * from "./ListBackupSelectionsCommand"; export * from "./ListBackupVaultsCommand"; +export * from "./ListCopyJobSummariesCommand"; export * from "./ListCopyJobsCommand"; export * from "./ListFrameworksCommand"; export * from "./ListLegalHoldsCommand"; @@ -55,6 +57,7 @@ export * from "./ListRecoveryPointsByLegalHoldCommand"; export * from "./ListRecoveryPointsByResourceCommand"; export * from "./ListReportJobsCommand"; export * from "./ListReportPlansCommand"; +export * from "./ListRestoreJobSummariesCommand"; export * from "./ListRestoreJobsCommand"; export * from "./ListTagsCommand"; export * from "./PutBackupVaultAccessPolicyCommand"; diff --git a/clients/client-backup/src/models/models_0.ts b/clients/client-backup/src/models/models_0.ts index dcecdbdbb42c..45713d5a5e93 100644 --- a/clients/client-backup/src/models/models_0.ts +++ b/clients/client-backup/src/models/models_0.ts @@ -35,6 +35,21 @@ export interface AdvancedBackupSetting { BackupOptions?: Record; } +/** + * @public + * @enum + */ +export const AggregationPeriod = { + FOURTEEN_DAYS: "FOURTEEN_DAYS", + ONE_DAY: "ONE_DAY", + SEVEN_DAYS: "SEVEN_DAYS", +} as const; + +/** + * @public + */ +export type AggregationPeriod = (typeof AggregationPeriod)[keyof typeof AggregationPeriod]; + /** * @public *

The required resource already exists.

@@ -320,6 +335,120 @@ export interface BackupJob { * belongs to the specified backup.

*/ ResourceName?: string; + + /** + * @public + *

This parameter is the job count for the specified + * message category.

+ *

Example strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum.

+ */ + MessageCategory?: string; +} + +/** + * @public + * @enum + */ +export const BackupJobStatus = { + ABORTED: "ABORTED", + ABORTING: "ABORTING", + AGGREGATE_ALL: "AGGREGATE_ALL", + ANY: "ANY", + COMPLETED: "COMPLETED", + CREATED: "CREATED", + EXPIRED: "EXPIRED", + FAILED: "FAILED", + PARTIAL: "PARTIAL", + PENDING: "PENDING", + RUNNING: "RUNNING", +} as const; + +/** + * @public + */ +export type BackupJobStatus = (typeof BackupJobStatus)[keyof typeof BackupJobStatus]; + +/** + * @public + *

This is a summary of jobs created + * or running within the most recent 30 days.

+ *

The returned summary may contain the following: + * Region, Account, State, RestourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ */ +export interface BackupJobSummary { + /** + * @public + *

The Amazon Web Services Regions within the job summary.

+ */ + Region?: string; + + /** + * @public + *

The account ID that owns the jobs within the summary.

+ */ + AccountId?: string; + + /** + * @public + *

This value is job count for jobs + * with the specified state.

+ */ + State?: BackupJobStatus; + + /** + * @public + *

This value is the job count for the specified resource type. + * The request GetSupportedResourceTypes returns + * strings for supported resource types.

+ */ + ResourceType?: string; + + /** + * @public + *

This parameter is the job count for the specified + * message category.

+ *

Example strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum.

+ */ + MessageCategory?: string; + + /** + * @public + *

The value as a number of jobs in a job summary.

+ */ + Count?: number; + + /** + * @public + *

The value of time in number format of a job start time.

+ *

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to + * milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 + * 12:11:30.087 AM.

+ */ + StartTime?: Date; + + /** + * @public + *

The value of time in number format of a job end time.

+ *

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to + * milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 + * 12:11:30.087 AM.

+ */ + EndTime?: Date; } /** @@ -1627,6 +1756,120 @@ export interface CopyJob { * belongs to the specified backup.

*/ ResourceName?: string; + + /** + * @public + *

This parameter is the job count for the specified + * message category.

+ *

Example strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum

+ */ + MessageCategory?: string; +} + +/** + * @public + * @enum + */ +export const CopyJobStatus = { + ABORTED: "ABORTED", + ABORTING: "ABORTING", + AGGREGATE_ALL: "AGGREGATE_ALL", + ANY: "ANY", + COMPLETED: "COMPLETED", + COMPLETING: "COMPLETING", + CREATED: "CREATED", + FAILED: "FAILED", + FAILING: "FAILING", + PARTIAL: "PARTIAL", + RUNNING: "RUNNING", +} as const; + +/** + * @public + */ +export type CopyJobStatus = (typeof CopyJobStatus)[keyof typeof CopyJobStatus]; + +/** + * @public + *

This is a summary of copy jobs created + * or running within the most recent 30 days.

+ *

The returned summary may contain the following: + * Region, Account, State, RestourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ */ +export interface CopyJobSummary { + /** + * @public + *

This is the Amazon Web Services Regions within the job summary.

+ */ + Region?: string; + + /** + * @public + *

The account ID that owns the jobs within the summary.

+ */ + AccountId?: string; + + /** + * @public + *

This value is job count for jobs + * with the specified state.

+ */ + State?: CopyJobStatus; + + /** + * @public + *

This value is the job count for the specified resource type. + * The request GetSupportedResourceTypes returns + * strings for supported resource types

+ */ + ResourceType?: string; + + /** + * @public + *

This parameter is the job count for the specified + * message category.

+ *

Example strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum.

+ */ + MessageCategory?: string; + + /** + * @public + *

The value as a number of jobs in a job summary.

+ */ + Count?: number; + + /** + * @public + *

The value of time in number format of a job start time.

+ *

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to + * milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 + * 12:11:30.087 AM.

+ */ + StartTime?: Date; + + /** + * @public + *

The value of time in number format of a job end time.

+ *

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to + * milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 + * 12:11:30.087 AM.

+ */ + EndTime?: Date; } /** @@ -2798,6 +3041,17 @@ export interface DescribeBackupJobOutput { * belongs to the specified backup.

*/ ResourceName?: string; + + /** + * @public + *

This is the job count for the specified + * message category.

+ *

Example strings may include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of MessageCategory strings.

+ */ + MessageCategory?: string; } /** @@ -4457,6 +4711,17 @@ export interface ListBackupJobsInput { *

This is a filter to list child (nested) jobs based on parent job ID.

*/ ByParentJobId?: string; + + /** + * @public + *

This returns a list of backup jobs for the specified + * message category.

+ *

Example strings may include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of MessageCategory strings.

+ */ + ByMessageCategory?: string; } /** @@ -4480,6 +4745,155 @@ export interface ListBackupJobsOutput { NextToken?: string; } +/** + * @public + */ +export interface ListBackupJobSummariesInput { + /** + * @public + *

Returns the job count for the specified account.

+ *

If the request is sent from a member account or an account + * not part of Amazon Web Services Organizations, jobs within requestor's account + * will be returned.

+ *

Root, admin, and delegated administrator accounts can use + * the value ANY to return job counts from every account in the + * organization.

+ *

+ * AGGREGATE_ALL aggregates job counts + * from all accounts within the authenticated organization, + * then returns the sum.

+ */ + AccountId?: string; + + /** + * @public + *

This parameter returns the job count for jobs + * with the specified state.

+ *

The the value ANY returns count of all states.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all states and returns the sum.

+ */ + State?: BackupJobStatus; + + /** + * @public + *

Returns the job count for the specified resource type. + * Use request GetSupportedResourceTypes to obtain + * strings for supported resource types.

+ *

The the value ANY returns count of all resource types.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all resource types and returns the sum.

+ *

The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

+ */ + ResourceType?: string; + + /** + * @public + *

This parameter returns the job count for the specified + * message category.

+ *

Example accepted strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of accepted MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum.

+ */ + MessageCategory?: string; + + /** + * @public + *

This is the period that sets the boundaries for returned + * results.

+ *

Acceptable values include

+ *
    + *
  • + *

    + * ONE_DAY for daily job count + * for the prior 14 days.

    + *
  • + *
  • + *

    + * SEVEN_DAYS for the aggregated + * job count for the prior 7 days.

    + *
  • + *
  • + *

    + * FOURTEEN_DAYS for aggregated + * job count for prior 14 days.

    + *
  • + *
+ */ + AggregationPeriod?: AggregationPeriod; + + /** + * @public + *

This parameter sets the maximum number of items + * to be returned.

+ *

The value is an integer. Range of accepted values is from + * 1 to 500.

+ */ + MaxResults?: number; + + /** + * @public + *

The next item following a partial list of returned resources. For example, if a request + * is made to return maxResults number of resources, NextToken + * allows you to return more items in your list starting at the location pointed to by the + * next token.

+ */ + NextToken?: string; +} + +/** + * @public + */ +export interface ListBackupJobSummariesOutput { + /** + * @public + *

This request returns a summary that contains + * Region, Account, State, ResourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ */ + BackupJobSummaries?: BackupJobSummary[]; + + /** + * @public + *

This is the period that sets the boundaries for returned + * results.

+ *
    + *
  • + *

    + * ONE_DAY for daily job count + * for the prior 14 days.

    + *
  • + *
  • + *

    + * SEVEN_DAYS for the aggregated + * job count for the prior 7 days.

    + *
  • + *
  • + *

    + * FOURTEEN_DAYS for aggregated + * job count for prior 14 days.

    + *
  • + *
+ */ + AggregationPeriod?: string; + + /** + * @public + *

The next item following a partial list of returned resources. For example, if a request + * is made to return maxResults number of resources, NextToken + * allows you to return more items in your list starting at the location pointed to by the + * next token.

+ */ + NextToken?: string; +} + /** * @public */ @@ -4848,6 +5262,21 @@ export interface ListCopyJobsInput { *

This is a filter to list child (nested) jobs based on parent job ID.

*/ ByParentJobId?: string; + + /** + * @public + *

This parameter returns the job count for the specified + * message category.

+ *

Example accepted strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of accepted MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum.

+ */ + ByMessageCategory?: string; } /** @@ -4870,6 +5299,154 @@ export interface ListCopyJobsOutput { NextToken?: string; } +/** + * @public + */ +export interface ListCopyJobSummariesInput { + /** + * @public + *

Returns the job count for the specified account.

+ *

If the request is sent from a member account or an account + * not part of Amazon Web Services Organizations, jobs within requestor's account + * will be returned.

+ *

Root, admin, and delegated administrator accounts can use + * the value ANY to return job counts from every account in the + * organization.

+ *

+ * AGGREGATE_ALL aggregates job counts + * from all accounts within the authenticated organization, + * then returns the sum.

+ */ + AccountId?: string; + + /** + * @public + *

This parameter returns the job count for jobs + * with the specified state.

+ *

The the value ANY returns count of all states.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all states and returns the sum.

+ */ + State?: CopyJobStatus; + + /** + * @public + *

Returns the job count for the specified resource type. + * Use request GetSupportedResourceTypes to obtain + * strings for supported resource types.

+ *

The the value ANY returns count of all resource types.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all resource types and returns the sum.

+ *

The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

+ */ + ResourceType?: string; + + /** + * @public + *

This parameter returns the job count for the specified + * message category.

+ *

Example accepted strings include AccessDenied, + * Success, and InvalidParameters. See + * Monitoring + * for a list of accepted MessageCategory strings.

+ *

The the value ANY returns count of all message categories.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all message categories and returns the sum.

+ */ + MessageCategory?: string; + + /** + * @public + *

This is the period that sets the boundaries for returned + * results.

+ *
    + *
  • + *

    + * ONE_DAY for daily job count + * for the prior 14 days.

    + *
  • + *
  • + *

    + * SEVEN_DAYS for the aggregated + * job count for the prior 7 days.

    + *
  • + *
  • + *

    + * FOURTEEN_DAYS for aggregated + * job count for prior 14 days.

    + *
  • + *
+ */ + AggregationPeriod?: AggregationPeriod; + + /** + * @public + *

This parameter sets the maximum number of items + * to be returned.

+ *

The value is an integer. Range of accepted values is from + * 1 to 500.

+ */ + MaxResults?: number; + + /** + * @public + *

The next item following a partial list of returned resources. For example, if a request + * is made to return maxResults number of resources, NextToken + * allows you to return more items in your list starting at the location pointed to by the + * next token.

+ */ + NextToken?: string; +} + +/** + * @public + */ +export interface ListCopyJobSummariesOutput { + /** + * @public + *

This return shows a summary that contains + * Region, Account, State, ResourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ */ + CopyJobSummaries?: CopyJobSummary[]; + + /** + * @public + *

This is the period that sets the boundaries for returned + * results.

+ *
    + *
  • + *

    + * ONE_DAY for daily job count + * for the prior 14 days.

    + *
  • + *
  • + *

    + * SEVEN_DAYS for the aggregated + * job count for the prior 7 days.

    + *
  • + *
  • + *

    + * FOURTEEN_DAYS for aggregated + * job count for prior 14 days.

    + *
  • + *
+ */ + AggregationPeriod?: string; + + /** + * @public + *

The next item following a partial list of returned resources. For example, if a request + * is made to return maxResults number of resources, NextToken + * allows you to return more items in your list starting at the location pointed to by the + * next token.

+ */ + NextToken?: string; +} + /** * @public */ @@ -5968,6 +6545,221 @@ export interface ListRestoreJobsOutput { NextToken?: string; } +/** + * @public + * @enum + */ +export const RestoreJobState = { + ABORTED: "ABORTED", + AGGREGATE_ALL: "AGGREGATE_ALL", + ANY: "ANY", + COMPLETED: "COMPLETED", + CREATED: "CREATED", + FAILED: "FAILED", + PENDING: "PENDING", + RUNNING: "RUNNING", +} as const; + +/** + * @public + */ +export type RestoreJobState = (typeof RestoreJobState)[keyof typeof RestoreJobState]; + +/** + * @public + */ +export interface ListRestoreJobSummariesInput { + /** + * @public + *

Returns the job count for the specified account.

+ *

If the request is sent from a member account or an account + * not part of Amazon Web Services Organizations, jobs within requestor's account + * will be returned.

+ *

Root, admin, and delegated administrator accounts can use + * the value ANY to return job counts from every account in the + * organization.

+ *

+ * AGGREGATE_ALL aggregates job counts + * from all accounts within the authenticated organization, + * then returns the sum.

+ */ + AccountId?: string; + + /** + * @public + *

This parameter returns the job count for jobs + * with the specified state.

+ *

The the value ANY returns count of all states.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all states and returns the sum.

+ */ + State?: RestoreJobState; + + /** + * @public + *

Returns the job count for the specified resource type. + * Use request GetSupportedResourceTypes to obtain + * strings for supported resource types.

+ *

The the value ANY returns count of all resource types.

+ *

+ * AGGREGATE_ALL aggregates job counts + * for all resource types and returns the sum.

+ *

The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

+ */ + ResourceType?: string; + + /** + * @public + *

This is the period that sets the boundaries for returned + * results.

+ *

Acceptable values include

+ *
    + *
  • + *

    + * ONE_DAY for daily job count + * for the prior 14 days.

    + *
  • + *
  • + *

    + * SEVEN_DAYS for the aggregated + * job count for the prior 7 days.

    + *
  • + *
  • + *

    + * FOURTEEN_DAYS for aggregated + * job count for prior 14 days.

    + *
  • + *
+ */ + AggregationPeriod?: AggregationPeriod; + + /** + * @public + *

This parameter sets the maximum number of items + * to be returned.

+ *

The value is an integer. Range of accepted values is from + * 1 to 500.

+ */ + MaxResults?: number; + + /** + * @public + *

The next item following a partial list of returned resources. For example, if a request + * is made to return maxResults number of resources, NextToken + * allows you to return more items in your list starting at the location pointed to by the + * next token.

+ */ + NextToken?: string; +} + +/** + * @public + *

This is a summary of restore jobs created + * or running within the most recent 30 days.

+ *

The returned summary may contain the following: + * Region, Account, State, ResourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ */ +export interface RestoreJobSummary { + /** + * @public + *

The Amazon Web Services Regions within the job summary.

+ */ + Region?: string; + + /** + * @public + *

The account ID that owns the jobs within the summary.

+ */ + AccountId?: string; + + /** + * @public + *

This value is job count for jobs + * with the specified state.

+ */ + State?: RestoreJobState; + + /** + * @public + *

This value is the job count for the specified resource type. + * The request GetSupportedResourceTypes returns + * strings for supported resource types.

+ */ + ResourceType?: string; + + /** + * @public + *

The value as a number of jobs in a job summary.

+ */ + Count?: number; + + /** + * @public + *

The value of time in number format of a job start time.

+ *

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to + * milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 + * 12:11:30.087 AM.

+ */ + StartTime?: Date; + + /** + * @public + *

The value of time in number format of a job end time.

+ *

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to + * milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 + * 12:11:30.087 AM.

+ */ + EndTime?: Date; +} + +/** + * @public + */ +export interface ListRestoreJobSummariesOutput { + /** + * @public + *

This return contains a summary that contains + * Region, Account, State, ResourceType, MessageCategory, + * StartTime, EndTime, and Count of included jobs.

+ */ + RestoreJobSummaries?: RestoreJobSummary[]; + + /** + * @public + *

This is the period that sets the boundaries for returned + * results.

+ *
    + *
  • + *

    + * ONE_DAY for daily job count + * for the prior 14 days.

    + *
  • + *
  • + *

    + * SEVEN_DAYS for the aggregated + * job count for the prior 7 days.

    + *
  • + *
  • + *

    + * FOURTEEN_DAYS for aggregated + * job count for prior 14 days.

    + *
  • + *
+ */ + AggregationPeriod?: string; + + /** + * @public + *

The next item following a partial list of returned resources. For example, if a request + * is made to return maxResults number of resources, NextToken + * allows you to return more items in your list starting at the location pointed to by the + * next token.

+ */ + NextToken?: string; +} + /** * @public */ diff --git a/clients/client-backup/src/pagination/ListBackupJobSummariesPaginator.ts b/clients/client-backup/src/pagination/ListBackupJobSummariesPaginator.ts new file mode 100644 index 000000000000..35b9d6daac12 --- /dev/null +++ b/clients/client-backup/src/pagination/ListBackupJobSummariesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BackupClient } from "../BackupClient"; +import { + ListBackupJobSummariesCommand, + ListBackupJobSummariesCommandInput, + ListBackupJobSummariesCommandOutput, +} from "../commands/ListBackupJobSummariesCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupJobSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupJobSummariesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListBackupJobSummaries( + config: BackupPaginationConfiguration, + input: ListBackupJobSummariesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListBackupJobSummariesCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/src/pagination/ListCopyJobSummariesPaginator.ts b/clients/client-backup/src/pagination/ListCopyJobSummariesPaginator.ts new file mode 100644 index 000000000000..176b67fc9512 --- /dev/null +++ b/clients/client-backup/src/pagination/ListCopyJobSummariesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BackupClient } from "../BackupClient"; +import { + ListCopyJobSummariesCommand, + ListCopyJobSummariesCommandInput, + ListCopyJobSummariesCommandOutput, +} from "../commands/ListCopyJobSummariesCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BackupClient, + input: ListCopyJobSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCopyJobSummariesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListCopyJobSummaries( + config: BackupPaginationConfiguration, + input: ListCopyJobSummariesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListCopyJobSummariesCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/src/pagination/ListRestoreJobSummariesPaginator.ts b/clients/client-backup/src/pagination/ListRestoreJobSummariesPaginator.ts new file mode 100644 index 000000000000..fabbc57106b6 --- /dev/null +++ b/clients/client-backup/src/pagination/ListRestoreJobSummariesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BackupClient } from "../BackupClient"; +import { + ListRestoreJobSummariesCommand, + ListRestoreJobSummariesCommandInput, + ListRestoreJobSummariesCommandOutput, +} from "../commands/ListRestoreJobSummariesCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BackupClient, + input: ListRestoreJobSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRestoreJobSummariesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListRestoreJobSummaries( + config: BackupPaginationConfiguration, + input: ListRestoreJobSummariesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListRestoreJobSummariesCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/src/pagination/index.ts b/clients/client-backup/src/pagination/index.ts index ed86936ce4d6..6a73afa7729c 100644 --- a/clients/client-backup/src/pagination/index.ts +++ b/clients/client-backup/src/pagination/index.ts @@ -1,11 +1,13 @@ // smithy-typescript generated code export * from "./Interfaces"; +export * from "./ListBackupJobSummariesPaginator"; export * from "./ListBackupJobsPaginator"; export * from "./ListBackupPlanTemplatesPaginator"; export * from "./ListBackupPlanVersionsPaginator"; export * from "./ListBackupPlansPaginator"; export * from "./ListBackupSelectionsPaginator"; export * from "./ListBackupVaultsPaginator"; +export * from "./ListCopyJobSummariesPaginator"; export * from "./ListCopyJobsPaginator"; export * from "./ListFrameworksPaginator"; export * from "./ListLegalHoldsPaginator"; @@ -16,5 +18,6 @@ export * from "./ListRecoveryPointsByLegalHoldPaginator"; export * from "./ListRecoveryPointsByResourcePaginator"; export * from "./ListReportJobsPaginator"; export * from "./ListReportPlansPaginator"; +export * from "./ListRestoreJobSummariesPaginator"; export * from "./ListRestoreJobsPaginator"; export * from "./ListTagsPaginator"; diff --git a/clients/client-backup/src/protocols/Aws_restJson1.ts b/clients/client-backup/src/protocols/Aws_restJson1.ts index 10303915af2c..62ec3d6aafc0 100644 --- a/clients/client-backup/src/protocols/Aws_restJson1.ts +++ b/clients/client-backup/src/protocols/Aws_restJson1.ts @@ -129,6 +129,10 @@ import { GetSupportedResourceTypesCommandOutput, } from "../commands/GetSupportedResourceTypesCommand"; import { ListBackupJobsCommandInput, ListBackupJobsCommandOutput } from "../commands/ListBackupJobsCommand"; +import { + ListBackupJobSummariesCommandInput, + ListBackupJobSummariesCommandOutput, +} from "../commands/ListBackupJobSummariesCommand"; import { ListBackupPlansCommandInput, ListBackupPlansCommandOutput } from "../commands/ListBackupPlansCommand"; import { ListBackupPlanTemplatesCommandInput, @@ -144,6 +148,10 @@ import { } from "../commands/ListBackupSelectionsCommand"; import { ListBackupVaultsCommandInput, ListBackupVaultsCommandOutput } from "../commands/ListBackupVaultsCommand"; import { ListCopyJobsCommandInput, ListCopyJobsCommandOutput } from "../commands/ListCopyJobsCommand"; +import { + ListCopyJobSummariesCommandInput, + ListCopyJobSummariesCommandOutput, +} from "../commands/ListCopyJobSummariesCommand"; import { ListFrameworksCommandInput, ListFrameworksCommandOutput } from "../commands/ListFrameworksCommand"; import { ListLegalHoldsCommandInput, ListLegalHoldsCommandOutput } from "../commands/ListLegalHoldsCommand"; import { @@ -169,6 +177,10 @@ import { import { ListReportJobsCommandInput, ListReportJobsCommandOutput } from "../commands/ListReportJobsCommand"; import { ListReportPlansCommandInput, ListReportPlansCommandOutput } from "../commands/ListReportPlansCommand"; import { ListRestoreJobsCommandInput, ListRestoreJobsCommandOutput } from "../commands/ListRestoreJobsCommand"; +import { + ListRestoreJobSummariesCommandInput, + ListRestoreJobSummariesCommandOutput, +} from "../commands/ListRestoreJobSummariesCommand"; import { ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; import { PutBackupVaultAccessPolicyCommandInput, @@ -209,6 +221,7 @@ import { AdvancedBackupSetting, AlreadyExistsException, BackupJob, + BackupJobSummary, BackupPlanInput, BackupPlansListMember, BackupRuleInput, @@ -225,6 +238,7 @@ import { ControlScope, CopyAction, CopyJob, + CopyJobSummary, DateRange, DependencyFailureException, Framework, @@ -246,6 +260,7 @@ import { ReportSetting, ResourceNotFoundException, RestoreJobsListMember, + RestoreJobSummary, ServiceUnavailableException, } from "../models/models_0"; @@ -1573,6 +1588,40 @@ export const se_ListBackupJobsCommand = async ( () => (input.ByCompleteBefore!.toISOString().split(".")[0] + "Z").toString(), ], parentJobId: [, input.ByParentJobId!], + messageCategory: [, input.ByMessageCategory!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListBackupJobSummariesCommand + */ +export const se_ListBackupJobSummariesCommand = async ( + input: ListBackupJobSummariesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/audit/backup-job-summaries"; + const query: any = map({ + AccountId: [, input.AccountId!], + State: [, input.State!], + ResourceType: [, input.ResourceType!], + MessageCategory: [, input.MessageCategory!], + AggregationPeriod: [, input.AggregationPeriod!], + MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()], + NextToken: [, input.NextToken!], }); let body: any; return new __HttpRequest({ @@ -1778,6 +1827,40 @@ export const se_ListCopyJobsCommand = async ( () => (input.ByCompleteAfter!.toISOString().split(".")[0] + "Z").toString(), ], parentJobId: [, input.ByParentJobId!], + messageCategory: [, input.ByMessageCategory!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListCopyJobSummariesCommand + */ +export const se_ListCopyJobSummariesCommand = async ( + input: ListCopyJobSummariesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/audit/copy-job-summaries"; + const query: any = map({ + AccountId: [, input.AccountId!], + State: [, input.State!], + ResourceType: [, input.ResourceType!], + MessageCategory: [, input.MessageCategory!], + AggregationPeriod: [, input.AggregationPeriod!], + MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()], + NextToken: [, input.NextToken!], }); let body: any; return new __HttpRequest({ @@ -2129,6 +2212,38 @@ export const se_ListRestoreJobsCommand = async ( }); }; +/** + * serializeAws_restJson1ListRestoreJobSummariesCommand + */ +export const se_ListRestoreJobSummariesCommand = async ( + input: ListRestoreJobSummariesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/audit/restore-job-summaries"; + const query: any = map({ + AccountId: [, input.AccountId!], + State: [, input.State!], + ResourceType: [, input.ResourceType!], + AggregationPeriod: [, input.AggregationPeriod!], + MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()], + NextToken: [, input.NextToken!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + /** * serializeAws_restJson1ListTagsCommand */ @@ -3743,6 +3858,7 @@ export const de_DescribeBackupJobCommand = async ( ExpectedCompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), IamRoleArn: __expectString, IsParent: __expectBoolean, + MessageCategory: __expectString, NumberOfChildJobs: __expectLong, ParentJobId: __expectString, PercentDone: __expectString, @@ -5143,6 +5259,58 @@ const de_ListBackupJobsCommandError = async ( } }; +/** + * deserializeAws_restJson1ListBackupJobSummariesCommand + */ +export const de_ListBackupJobSummariesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListBackupJobSummariesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AggregationPeriod: __expectString, + BackupJobSummaries: (_) => de_BackupJobSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListBackupJobSummariesCommandError + */ +const de_ListBackupJobSummariesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterValueException": + case "com.amazonaws.backup#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.backup#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1ListBackupPlansCommand */ @@ -5479,6 +5647,58 @@ const de_ListCopyJobsCommandError = async ( } }; +/** + * deserializeAws_restJson1ListCopyJobSummariesCommand + */ +export const de_ListCopyJobSummariesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListCopyJobSummariesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AggregationPeriod: __expectString, + CopyJobSummaries: (_) => de_CopyJobSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListCopyJobSummariesCommandError + */ +const de_ListCopyJobSummariesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterValueException": + case "com.amazonaws.backup#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.backup#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1ListFrameworksCommand */ @@ -6016,6 +6236,58 @@ const de_ListRestoreJobsCommandError = async ( } }; +/** + * deserializeAws_restJson1ListRestoreJobSummariesCommand + */ +export const de_ListRestoreJobSummariesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListRestoreJobSummariesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AggregationPeriod: __expectString, + NextToken: __expectString, + RestoreJobSummaries: (_) => de_RestoreJobSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListRestoreJobSummariesCommandError + */ +const de_ListRestoreJobSummariesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterValueException": + case "com.amazonaws.backup#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.backup#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1ListTagsCommand */ @@ -7337,6 +7609,7 @@ const de_BackupJob = (output: any, context: __SerdeContext): BackupJob => { ExpectedCompletionDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), IamRoleArn: __expectString, IsParent: __expectBoolean, + MessageCategory: __expectString, ParentJobId: __expectString, PercentDone: __expectString, RecoveryPointArn: __expectString, @@ -7363,6 +7636,34 @@ const de_BackupJobsList = (output: any, context: __SerdeContext): BackupJob[] => return retVal; }; +/** + * deserializeAws_restJson1BackupJobSummary + */ +const de_BackupJobSummary = (output: any, context: __SerdeContext): BackupJobSummary => { + return take(output, { + AccountId: __expectString, + Count: __expectInt32, + EndTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + MessageCategory: __expectString, + Region: __expectString, + ResourceType: __expectString, + StartTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + State: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1BackupJobSummaryList + */ +const de_BackupJobSummaryList = (output: any, context: __SerdeContext): BackupJobSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_BackupJobSummary(entry, context); + }); + return retVal; +}; + // de_BackupOptions omitted. // de_BackupPlan omitted. @@ -7523,6 +7824,7 @@ const de_CopyJob = (output: any, context: __SerdeContext): CopyJob => { DestinationRecoveryPointArn: __expectString, IamRoleArn: __expectString, IsParent: __expectBoolean, + MessageCategory: __expectString, NumberOfChildJobs: __expectLong, ParentJobId: __expectString, ResourceArn: __expectString, @@ -7549,6 +7851,34 @@ const de_CopyJobsList = (output: any, context: __SerdeContext): CopyJob[] => { return retVal; }; +/** + * deserializeAws_restJson1CopyJobSummary + */ +const de_CopyJobSummary = (output: any, context: __SerdeContext): CopyJobSummary => { + return take(output, { + AccountId: __expectString, + Count: __expectInt32, + EndTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + MessageCategory: __expectString, + Region: __expectString, + ResourceType: __expectString, + StartTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + State: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1CopyJobSummaryList + */ +const de_CopyJobSummaryList = (output: any, context: __SerdeContext): CopyJobSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_CopyJobSummary(entry, context); + }); + return retVal; +}; + /** * deserializeAws_restJson1DateRange */ @@ -7847,6 +8177,33 @@ const de_RestoreJobsListMember = (output: any, context: __SerdeContext): Restore }) as any; }; +/** + * deserializeAws_restJson1RestoreJobSummary + */ +const de_RestoreJobSummary = (output: any, context: __SerdeContext): RestoreJobSummary => { + return take(output, { + AccountId: __expectString, + Count: __expectInt32, + EndTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Region: __expectString, + ResourceType: __expectString, + StartTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + State: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1RestoreJobSummaryList + */ +const de_RestoreJobSummaryList = (output: any, context: __SerdeContext): RestoreJobSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_RestoreJobSummary(entry, context); + }); + return retVal; +}; + // de_stringList omitted. // de_stringMap omitted. diff --git a/codegen/sdk-codegen/aws-models/backup.json b/codegen/sdk-codegen/aws-models/backup.json index 3e1ec6d82c34..2118109fe746 100644 --- a/codegen/sdk-codegen/aws-models/backup.json +++ b/codegen/sdk-codegen/aws-models/backup.json @@ -64,6 +64,29 @@ "target": "com.amazonaws.backup#AdvancedBackupSetting" } }, + "com.amazonaws.backup#AggregationPeriod": { + "type": "enum", + "members": { + "ONE_DAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ONE_DAY" + } + }, + "SEVEN_DAYS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SEVEN_DAYS" + } + }, + "FOURTEEN_DAYS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FOURTEEN_DAYS" + } + } + } + }, "com.amazonaws.backup#AlreadyExistsException": { "type": "structure", "members": { @@ -244,6 +267,12 @@ "traits": { "smithy.api#documentation": "

This is the non-unique name of the resource that \n belongs to the specified backup.

" } + }, + "MessageCategory": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This parameter is the job count for the specified \n message category.

\n

Example strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum.

" + } } }, "traits": { @@ -318,6 +347,140 @@ } } }, + "com.amazonaws.backup#BackupJobStatus": { + "type": "enum", + "members": { + "CREATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATED" + } + }, + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "RUNNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RUNNING" + } + }, + "ABORTING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ABORTING" + } + }, + "ABORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ABORTED" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETED" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "EXPIRED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXPIRED" + } + }, + "PARTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PARTIAL" + } + }, + "AGGREGATE_ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AGGREGATE_ALL" + } + }, + "ANY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANY" + } + } + } + }, + "com.amazonaws.backup#BackupJobSummary": { + "type": "structure", + "members": { + "Region": { + "target": "com.amazonaws.backup#Region", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Regions within the job summary.

" + } + }, + "AccountId": { + "target": "com.amazonaws.backup#AccountId", + "traits": { + "smithy.api#documentation": "

The account ID that owns the jobs within the summary.

" + } + }, + "State": { + "target": "com.amazonaws.backup#BackupJobStatus", + "traits": { + "smithy.api#documentation": "

This value is job count for jobs \n with the specified state.

" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

This value is the job count for the specified resource type. \n The request GetSupportedResourceTypes returns \n strings for supported resource types.

" + } + }, + "MessageCategory": { + "target": "com.amazonaws.backup#MessageCategory", + "traits": { + "smithy.api#documentation": "

This parameter is the job count for the specified \n message category.

\n

Example strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum.

" + } + }, + "Count": { + "target": "com.amazonaws.backup#integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The value as a number of jobs in a job summary.

" + } + }, + "StartTime": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The value of time in number format of a job start time.

\n

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to\n milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018\n 12:11:30.087 AM.

" + } + }, + "EndTime": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The value of time in number format of a job end time.

\n

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to\n milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018\n 12:11:30.087 AM.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is a summary of jobs created \n or running within the most recent 30 days.

\n

The returned summary may contain the following: \n Region, Account, State, RestourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

" + } + }, + "com.amazonaws.backup#BackupJobSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.backup#BackupJobSummary" + } + }, "com.amazonaws.backup#BackupJobsList": { "type": "list", "member": { @@ -1419,6 +1582,12 @@ "traits": { "smithy.api#documentation": "

This is the non-unique name of the resource that \n belongs to the specified backup.

" } + }, + "MessageCategory": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This parameter is the job count for the specified \n message category.

\n

Example strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum

" + } } }, "traits": { @@ -1469,6 +1638,140 @@ } } }, + "com.amazonaws.backup#CopyJobStatus": { + "type": "enum", + "members": { + "CREATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATED" + } + }, + "RUNNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RUNNING" + } + }, + "ABORTING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ABORTING" + } + }, + "ABORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ABORTED" + } + }, + "COMPLETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETING" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETED" + } + }, + "FAILING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "PARTIAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PARTIAL" + } + }, + "AGGREGATE_ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AGGREGATE_ALL" + } + }, + "ANY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANY" + } + } + } + }, + "com.amazonaws.backup#CopyJobSummary": { + "type": "structure", + "members": { + "Region": { + "target": "com.amazonaws.backup#Region", + "traits": { + "smithy.api#documentation": "

This is the Amazon Web Services Regions within the job summary.

" + } + }, + "AccountId": { + "target": "com.amazonaws.backup#AccountId", + "traits": { + "smithy.api#documentation": "

The account ID that owns the jobs within the summary.

" + } + }, + "State": { + "target": "com.amazonaws.backup#CopyJobStatus", + "traits": { + "smithy.api#documentation": "

This value is job count for jobs \n with the specified state.

" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

This value is the job count for the specified resource type. \n The request GetSupportedResourceTypes returns \n strings for supported resource types

" + } + }, + "MessageCategory": { + "target": "com.amazonaws.backup#MessageCategory", + "traits": { + "smithy.api#documentation": "

This parameter is the job count for the specified \n message category.

\n

Example strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum.

" + } + }, + "Count": { + "target": "com.amazonaws.backup#integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The value as a number of jobs in a job summary.

" + } + }, + "StartTime": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The value of time in number format of a job start time.

\n

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to\n milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018\n 12:11:30.087 AM.

" + } + }, + "EndTime": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The value of time in number format of a job end time.

\n

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to\n milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018\n 12:11:30.087 AM.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is a summary of copy jobs created \n or running within the most recent 30 days.

\n

The returned summary may contain the following: \n Region, Account, State, RestourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

" + } + }, + "com.amazonaws.backup#CopyJobSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.backup#CopyJobSummary" + } + }, "com.amazonaws.backup#CopyJobsList": { "type": "list", "member": { @@ -2329,6 +2632,9 @@ { "target": "com.amazonaws.backup#ListBackupJobs" }, + { + "target": "com.amazonaws.backup#ListBackupJobSummaries" + }, { "target": "com.amazonaws.backup#ListBackupPlans" }, @@ -2347,6 +2653,9 @@ { "target": "com.amazonaws.backup#ListCopyJobs" }, + { + "target": "com.amazonaws.backup#ListCopyJobSummaries" + }, { "target": "com.amazonaws.backup#ListFrameworks" }, @@ -2377,6 +2686,9 @@ { "target": "com.amazonaws.backup#ListRestoreJobs" }, + { + "target": "com.amazonaws.backup#ListRestoreJobSummaries" + }, { "target": "com.amazonaws.backup#ListTags" }, @@ -3366,6 +3678,17 @@ "expect": { "error": "Invalid Configuration: Missing Region" } + }, + { + "documentation": "Partition doesn't support DualStack", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true + } } ], "version": "1.0" @@ -4122,8 +4445,14 @@ "traits": { "smithy.api#documentation": "

This is the non-unique name of the resource that \n belongs to the specified backup.

" } - } - }, + }, + "MessageCategory": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This is the job count for the specified \n message category.

\n

Example strings may include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of MessageCategory strings.

" + } + } + }, "traits": { "smithy.api#output": {} } @@ -6331,6 +6660,119 @@ "smithy.api#error": "client" } }, + "com.amazonaws.backup#ListBackupJobSummaries": { + "type": "operation", + "input": { + "target": "com.amazonaws.backup#ListBackupJobSummariesInput" + }, + "output": { + "target": "com.amazonaws.backup#ListBackupJobSummariesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backup#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.backup#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

This is a request for a summary of backup jobs created \n or running within the most recent 30 days. You can \n include parameters AccountID, State, ResourceType, MessageCategory, \n AggregationPeriod, MaxResults, or NextToken to filter \n results.

\n

This request returns a summary that contains \n Region, Account, State, ResourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

", + "smithy.api#http": { + "method": "GET", + "uri": "/audit/backup-job-summaries", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.backup#ListBackupJobSummariesInput": { + "type": "structure", + "members": { + "AccountId": { + "target": "com.amazonaws.backup#AccountId", + "traits": { + "smithy.api#documentation": "

Returns the job count for the specified account.

\n

If the request is sent from a member account or an account \n not part of Amazon Web Services Organizations, jobs within requestor's account \n will be returned.

\n

Root, admin, and delegated administrator accounts can use \n the value ANY to return job counts from every account in the \n organization.

\n

\n AGGREGATE_ALL aggregates job counts \n from all accounts within the authenticated organization, \n then returns the sum.

", + "smithy.api#httpQuery": "AccountId" + } + }, + "State": { + "target": "com.amazonaws.backup#BackupJobStatus", + "traits": { + "smithy.api#documentation": "

This parameter returns the job count for jobs \n with the specified state.

\n

The the value ANY returns count of all states.

\n

\n AGGREGATE_ALL aggregates job counts \n for all states and returns the sum.

", + "smithy.api#httpQuery": "State" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

Returns the job count for the specified resource type. \n Use request GetSupportedResourceTypes to obtain \n strings for supported resource types.

\n

The the value ANY returns count of all resource types.

\n

\n AGGREGATE_ALL aggregates job counts \n for all resource types and returns the sum.

\n

The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

", + "smithy.api#httpQuery": "ResourceType" + } + }, + "MessageCategory": { + "target": "com.amazonaws.backup#MessageCategory", + "traits": { + "smithy.api#documentation": "

This parameter returns the job count for the specified \n message category.

\n

Example accepted strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of accepted MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum.

", + "smithy.api#httpQuery": "MessageCategory" + } + }, + "AggregationPeriod": { + "target": "com.amazonaws.backup#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

This is the period that sets the boundaries for returned \n results.

\n

Acceptable values include

\n
    \n
  • \n

    \n ONE_DAY for daily job count\n for the prior 14 days.

    \n
  • \n
  • \n

    \n SEVEN_DAYS for the aggregated \n job count for the prior 7 days.

    \n
  • \n
  • \n

    \n FOURTEEN_DAYS for aggregated \n job count for prior 14 days.

    \n
  • \n
", + "smithy.api#httpQuery": "AggregationPeriod" + } + }, + "MaxResults": { + "target": "com.amazonaws.backup#MaxResults", + "traits": { + "smithy.api#documentation": "

This parameter sets the maximum number of items \n to be returned.

\n

The value is an integer. Range of accepted values is from \n 1 to 500.

", + "smithy.api#httpQuery": "MaxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned resources. For example, if a request\n is made to return maxResults number of resources, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "NextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backup#ListBackupJobSummariesOutput": { + "type": "structure", + "members": { + "BackupJobSummaries": { + "target": "com.amazonaws.backup#BackupJobSummaryList", + "traits": { + "smithy.api#documentation": "

This request returns a summary that contains \n Region, Account, State, ResourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

" + } + }, + "AggregationPeriod": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This is the period that sets the boundaries for returned \n results.

\n
    \n
  • \n

    \n ONE_DAY for daily job count\n for the prior 14 days.

    \n
  • \n
  • \n

    \n SEVEN_DAYS for the aggregated \n job count for the prior 7 days.

    \n
  • \n
  • \n

    \n FOURTEEN_DAYS for aggregated \n job count for prior 14 days.

    \n
  • \n
" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned resources. For example, if a request\n is made to return maxResults number of resources, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.backup#ListBackupJobs": { "type": "operation", "input": { @@ -6449,6 +6891,13 @@ "smithy.api#documentation": "

This is a filter to list child (nested) jobs based on parent job ID.

", "smithy.api#httpQuery": "parentJobId" } + }, + "ByMessageCategory": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This returns a list of backup jobs for the specified \n message category.

\n

Example strings may include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of MessageCategory strings.

", + "smithy.api#httpQuery": "messageCategory" + } } }, "traits": { @@ -6912,6 +7361,119 @@ "smithy.api#output": {} } }, + "com.amazonaws.backup#ListCopyJobSummaries": { + "type": "operation", + "input": { + "target": "com.amazonaws.backup#ListCopyJobSummariesInput" + }, + "output": { + "target": "com.amazonaws.backup#ListCopyJobSummariesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backup#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.backup#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

This request obtains a list of copy jobs created \n or running within the the most recent 30 days. You can \n include parameters AccountID, State, ResourceType, MessageCategory, \n AggregationPeriod, MaxResults, or NextToken to filter \n results.

\n

This request returns a summary that contains \n Region, Account, State, RestourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

", + "smithy.api#http": { + "method": "GET", + "uri": "/audit/copy-job-summaries", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.backup#ListCopyJobSummariesInput": { + "type": "structure", + "members": { + "AccountId": { + "target": "com.amazonaws.backup#AccountId", + "traits": { + "smithy.api#documentation": "

Returns the job count for the specified account.

\n

If the request is sent from a member account or an account \n not part of Amazon Web Services Organizations, jobs within requestor's account \n will be returned.

\n

Root, admin, and delegated administrator accounts can use \n the value ANY to return job counts from every account in the \n organization.

\n

\n AGGREGATE_ALL aggregates job counts \n from all accounts within the authenticated organization, \n then returns the sum.

", + "smithy.api#httpQuery": "AccountId" + } + }, + "State": { + "target": "com.amazonaws.backup#CopyJobStatus", + "traits": { + "smithy.api#documentation": "

This parameter returns the job count for jobs \n with the specified state.

\n

The the value ANY returns count of all states.

\n

\n AGGREGATE_ALL aggregates job counts \n for all states and returns the sum.

", + "smithy.api#httpQuery": "State" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

Returns the job count for the specified resource type. \n Use request GetSupportedResourceTypes to obtain \n strings for supported resource types.

\n

The the value ANY returns count of all resource types.

\n

\n AGGREGATE_ALL aggregates job counts \n for all resource types and returns the sum.

\n

The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

", + "smithy.api#httpQuery": "ResourceType" + } + }, + "MessageCategory": { + "target": "com.amazonaws.backup#MessageCategory", + "traits": { + "smithy.api#documentation": "

This parameter returns the job count for the specified \n message category.

\n

Example accepted strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of accepted MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum.

", + "smithy.api#httpQuery": "MessageCategory" + } + }, + "AggregationPeriod": { + "target": "com.amazonaws.backup#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

This is the period that sets the boundaries for returned \n results.

\n
    \n
  • \n

    \n ONE_DAY for daily job count\n for the prior 14 days.

    \n
  • \n
  • \n

    \n SEVEN_DAYS for the aggregated \n job count for the prior 7 days.

    \n
  • \n
  • \n

    \n FOURTEEN_DAYS for aggregated \n job count for prior 14 days.

    \n
  • \n
", + "smithy.api#httpQuery": "AggregationPeriod" + } + }, + "MaxResults": { + "target": "com.amazonaws.backup#MaxResults", + "traits": { + "smithy.api#documentation": "

This parameter sets the maximum number of items \n to be returned.

\n

The value is an integer. Range of accepted values is from \n 1 to 500.

", + "smithy.api#httpQuery": "MaxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned resources. For example, if a request\n is made to return maxResults number of resources, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "NextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backup#ListCopyJobSummariesOutput": { + "type": "structure", + "members": { + "CopyJobSummaries": { + "target": "com.amazonaws.backup#CopyJobSummaryList", + "traits": { + "smithy.api#documentation": "

This return shows a summary that contains \n Region, Account, State, ResourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

" + } + }, + "AggregationPeriod": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This is the period that sets the boundaries for returned \n results.

\n
    \n
  • \n

    \n ONE_DAY for daily job count\n for the prior 14 days.

    \n
  • \n
  • \n

    \n SEVEN_DAYS for the aggregated \n job count for the prior 7 days.

    \n
  • \n
  • \n

    \n FOURTEEN_DAYS for aggregated \n job count for prior 14 days.

    \n
  • \n
" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned resources. For example, if a request\n is made to return maxResults number of resources, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.backup#ListCopyJobs": { "type": "operation", "input": { @@ -7029,6 +7591,13 @@ "smithy.api#documentation": "

This is a filter to list child (nested) jobs based on parent job ID.

", "smithy.api#httpQuery": "parentJobId" } + }, + "ByMessageCategory": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This parameter returns the job count for the specified \n message category.

\n

Example accepted strings include AccessDenied, \n Success, and InvalidParameters. See \n Monitoring \n for a list of accepted MessageCategory strings.

\n

The the value ANY returns count of all message categories.

\n

\n AGGREGATE_ALL aggregates job counts \n for all message categories and returns the sum.

", + "smithy.api#httpQuery": "messageCategory" + } } }, "traits": { @@ -7857,6 +8426,112 @@ "smithy.api#output": {} } }, + "com.amazonaws.backup#ListRestoreJobSummaries": { + "type": "operation", + "input": { + "target": "com.amazonaws.backup#ListRestoreJobSummariesInput" + }, + "output": { + "target": "com.amazonaws.backup#ListRestoreJobSummariesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backup#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.backup#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

This request obtains a summary of restore jobs created \n or running within the the most recent 30 days. You can \n include parameters AccountID, State, ResourceType, \n AggregationPeriod, MaxResults, or NextToken to filter \n results.

\n

This request returns a summary that contains \n Region, Account, State, RestourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

", + "smithy.api#http": { + "method": "GET", + "uri": "/audit/restore-job-summaries", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.backup#ListRestoreJobSummariesInput": { + "type": "structure", + "members": { + "AccountId": { + "target": "com.amazonaws.backup#AccountId", + "traits": { + "smithy.api#documentation": "

Returns the job count for the specified account.

\n

If the request is sent from a member account or an account \n not part of Amazon Web Services Organizations, jobs within requestor's account \n will be returned.

\n

Root, admin, and delegated administrator accounts can use \n the value ANY to return job counts from every account in the \n organization.

\n

\n AGGREGATE_ALL aggregates job counts \n from all accounts within the authenticated organization, \n then returns the sum.

", + "smithy.api#httpQuery": "AccountId" + } + }, + "State": { + "target": "com.amazonaws.backup#RestoreJobState", + "traits": { + "smithy.api#documentation": "

This parameter returns the job count for jobs \n with the specified state.

\n

The the value ANY returns count of all states.

\n

\n AGGREGATE_ALL aggregates job counts \n for all states and returns the sum.

", + "smithy.api#httpQuery": "State" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

Returns the job count for the specified resource type. \n Use request GetSupportedResourceTypes to obtain \n strings for supported resource types.

\n

The the value ANY returns count of all resource types.

\n

\n AGGREGATE_ALL aggregates job counts \n for all resource types and returns the sum.

\n

The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.

", + "smithy.api#httpQuery": "ResourceType" + } + }, + "AggregationPeriod": { + "target": "com.amazonaws.backup#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

This is the period that sets the boundaries for returned \n results.

\n

Acceptable values include

\n
    \n
  • \n

    \n ONE_DAY for daily job count\n for the prior 14 days.

    \n
  • \n
  • \n

    \n SEVEN_DAYS for the aggregated \n job count for the prior 7 days.

    \n
  • \n
  • \n

    \n FOURTEEN_DAYS for aggregated \n job count for prior 14 days.

    \n
  • \n
", + "smithy.api#httpQuery": "AggregationPeriod" + } + }, + "MaxResults": { + "target": "com.amazonaws.backup#MaxResults", + "traits": { + "smithy.api#documentation": "

This parameter sets the maximum number of items \n to be returned.

\n

The value is an integer. Range of accepted values is from \n 1 to 500.

", + "smithy.api#httpQuery": "MaxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned resources. For example, if a request\n is made to return maxResults number of resources, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "NextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backup#ListRestoreJobSummariesOutput": { + "type": "structure", + "members": { + "RestoreJobSummaries": { + "target": "com.amazonaws.backup#RestoreJobSummaryList", + "traits": { + "smithy.api#documentation": "

This return contains a summary that contains \n Region, Account, State, ResourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

" + } + }, + "AggregationPeriod": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

This is the period that sets the boundaries for returned \n results.

\n
    \n
  • \n

    \n ONE_DAY for daily job count\n for the prior 14 days.

    \n
  • \n
  • \n

    \n SEVEN_DAYS for the aggregated \n job count for the prior 7 days.

    \n
  • \n
  • \n

    \n FOURTEEN_DAYS for aggregated \n job count for prior 14 days.

    \n
  • \n
" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned resources. For example, if a request\n is made to return maxResults number of resources, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.backup#ListRestoreJobs": { "type": "operation", "input": { @@ -8093,6 +8768,9 @@ } } }, + "com.amazonaws.backup#MessageCategory": { + "type": "string" + }, "com.amazonaws.backup#Metadata": { "type": "map", "key": { @@ -8712,6 +9390,9 @@ "target": "com.amazonaws.backup#RecoveryPointMember" } }, + "com.amazonaws.backup#Region": { + "type": "string" + }, "com.amazonaws.backup#ReportDeliveryChannel": { "type": "structure", "members": { @@ -9036,6 +9717,59 @@ "com.amazonaws.backup#RestoreJobId": { "type": "string" }, + "com.amazonaws.backup#RestoreJobState": { + "type": "enum", + "members": { + "CREATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATED" + } + }, + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "RUNNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RUNNING" + } + }, + "ABORTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ABORTED" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETED" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "AGGREGATE_ALL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AGGREGATE_ALL" + } + }, + "ANY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ANY" + } + } + } + }, "com.amazonaws.backup#RestoreJobStatus": { "type": "enum", "members": { @@ -9071,6 +9805,63 @@ } } }, + "com.amazonaws.backup#RestoreJobSummary": { + "type": "structure", + "members": { + "Region": { + "target": "com.amazonaws.backup#Region", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Regions within the job summary.

" + } + }, + "AccountId": { + "target": "com.amazonaws.backup#AccountId", + "traits": { + "smithy.api#documentation": "

The account ID that owns the jobs within the summary.

" + } + }, + "State": { + "target": "com.amazonaws.backup#RestoreJobState", + "traits": { + "smithy.api#documentation": "

This value is job count for jobs \n with the specified state.

" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

This value is the job count for the specified resource type. \n The request GetSupportedResourceTypes returns \n strings for supported resource types.

" + } + }, + "Count": { + "target": "com.amazonaws.backup#integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The value as a number of jobs in a job summary.

" + } + }, + "StartTime": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The value of time in number format of a job start time.

\n

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to\n milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018\n 12:11:30.087 AM.

" + } + }, + "EndTime": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The value of time in number format of a job end time.

\n

This value is the time in Unix format, Coordinated Universal Time (UTC), and accurate to\n milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018\n 12:11:30.087 AM.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is a summary of restore jobs created \n or running within the most recent 30 days.

\n

The returned summary may contain the following: \n Region, Account, State, ResourceType, MessageCategory, \n StartTime, EndTime, and Count of included jobs.

" + } + }, + "com.amazonaws.backup#RestoreJobSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.backup#RestoreJobSummary" + } + }, "com.amazonaws.backup#RestoreJobsList": { "type": "list", "member": {