From 57e3fc59a13a1983c2948c0c7f3d6dcc8fb289d1 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 28 Jul 2023 18:17:49 +0000 Subject: [PATCH] feat(client-kafka): Amazon MSK has introduced new versions of ListClusterOperations and DescribeClusterOperation APIs. These v2 APIs provide information and insights into the ongoing operations of both MSK Provisioned and MSK Serverless clusters. --- clients/client-kafka/README.md | 16 + clients/client-kafka/src/Kafka.ts | 46 ++ clients/client-kafka/src/KafkaClient.ts | 12 + .../DescribeClusterOperationV2Command.ts | 400 +++++++++++++++++ .../ListClusterOperationsV2Command.ts | 176 ++++++++ clients/client-kafka/src/commands/index.ts | 2 + clients/client-kafka/src/models/models_0.ts | 215 ++++++++++ .../ListClusterOperationsV2Paginator.ts | 50 +++ clients/client-kafka/src/pagination/index.ts | 1 + .../src/protocols/Aws_restJson1.ts | 282 ++++++++++++ codegen/sdk-codegen/aws-models/kafka.json | 403 ++++++++++++++++++ 11 files changed, 1603 insertions(+) create mode 100644 clients/client-kafka/src/commands/DescribeClusterOperationV2Command.ts create mode 100644 clients/client-kafka/src/commands/ListClusterOperationsV2Command.ts create mode 100644 clients/client-kafka/src/pagination/ListClusterOperationsV2Paginator.ts diff --git a/clients/client-kafka/README.md b/clients/client-kafka/README.md index 7e9439ab52c8..e3ed3ddae995 100644 --- a/clients/client-kafka/README.md +++ b/clients/client-kafka/README.md @@ -298,6 +298,14 @@ DescribeClusterOperation [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/classes/describeclusteroperationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/describeclusteroperationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/describeclusteroperationcommandoutput.html) + +
+ +DescribeClusterOperationV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/classes/describeclusteroperationv2command.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/describeclusteroperationv2commandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/describeclusteroperationv2commandoutput.html) +
@@ -370,6 +378,14 @@ ListClusterOperations [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/classes/listclusteroperationscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/listclusteroperationscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/listclusteroperationscommandoutput.html) +
+
+ +ListClusterOperationsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/classes/listclusteroperationsv2command.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/listclusteroperationsv2commandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kafka/interfaces/listclusteroperationsv2commandoutput.html) +
diff --git a/clients/client-kafka/src/Kafka.ts b/clients/client-kafka/src/Kafka.ts index 9ce51e01e9e9..a551773c6eb6 100644 --- a/clients/client-kafka/src/Kafka.ts +++ b/clients/client-kafka/src/Kafka.ts @@ -62,6 +62,11 @@ import { DescribeClusterOperationCommandInput, DescribeClusterOperationCommandOutput, } from "./commands/DescribeClusterOperationCommand"; +import { + DescribeClusterOperationV2Command, + DescribeClusterOperationV2CommandInput, + DescribeClusterOperationV2CommandOutput, +} from "./commands/DescribeClusterOperationV2Command"; import { DescribeClusterV2Command, DescribeClusterV2CommandInput, @@ -107,6 +112,11 @@ import { ListClusterOperationsCommandInput, ListClusterOperationsCommandOutput, } from "./commands/ListClusterOperationsCommand"; +import { + ListClusterOperationsV2Command, + ListClusterOperationsV2CommandInput, + ListClusterOperationsV2CommandOutput, +} from "./commands/ListClusterOperationsV2Command"; import { ListClustersCommand, ListClustersCommandInput, @@ -234,6 +244,7 @@ const commands = { DeleteVpcConnectionCommand, DescribeClusterCommand, DescribeClusterOperationCommand, + DescribeClusterOperationV2Command, DescribeClusterV2Command, DescribeConfigurationCommand, DescribeConfigurationRevisionCommand, @@ -243,6 +254,7 @@ const commands = { GetCompatibleKafkaVersionsCommand, ListClientVpcConnectionsCommand, ListClusterOperationsCommand, + ListClusterOperationsV2Command, ListClustersCommand, ListClustersV2Command, ListConfigurationRevisionsCommand, @@ -456,6 +468,23 @@ export interface Kafka { cb: (err: any, data?: DescribeClusterOperationCommandOutput) => void ): void; + /** + * @see {@link DescribeClusterOperationV2Command} + */ + describeClusterOperationV2( + args: DescribeClusterOperationV2CommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeClusterOperationV2( + args: DescribeClusterOperationV2CommandInput, + cb: (err: any, data?: DescribeClusterOperationV2CommandOutput) => void + ): void; + describeClusterOperationV2( + args: DescribeClusterOperationV2CommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeClusterOperationV2CommandOutput) => void + ): void; + /** * @see {@link DescribeClusterV2Command} */ @@ -609,6 +638,23 @@ export interface Kafka { cb: (err: any, data?: ListClusterOperationsCommandOutput) => void ): void; + /** + * @see {@link ListClusterOperationsV2Command} + */ + listClusterOperationsV2( + args: ListClusterOperationsV2CommandInput, + options?: __HttpHandlerOptions + ): Promise; + listClusterOperationsV2( + args: ListClusterOperationsV2CommandInput, + cb: (err: any, data?: ListClusterOperationsV2CommandOutput) => void + ): void; + listClusterOperationsV2( + args: ListClusterOperationsV2CommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListClusterOperationsV2CommandOutput) => void + ): void; + /** * @see {@link ListClustersCommand} */ diff --git a/clients/client-kafka/src/KafkaClient.ts b/clients/client-kafka/src/KafkaClient.ts index c0dff72f49f5..e1e978fa0bc3 100644 --- a/clients/client-kafka/src/KafkaClient.ts +++ b/clients/client-kafka/src/KafkaClient.ts @@ -85,6 +85,10 @@ import { DescribeClusterOperationCommandInput, DescribeClusterOperationCommandOutput, } from "./commands/DescribeClusterOperationCommand"; +import { + DescribeClusterOperationV2CommandInput, + DescribeClusterOperationV2CommandOutput, +} from "./commands/DescribeClusterOperationV2Command"; import { DescribeClusterV2CommandInput, DescribeClusterV2CommandOutput } from "./commands/DescribeClusterV2Command"; import { DescribeConfigurationCommandInput, @@ -115,6 +119,10 @@ import { ListClusterOperationsCommandInput, ListClusterOperationsCommandOutput, } from "./commands/ListClusterOperationsCommand"; +import { + ListClusterOperationsV2CommandInput, + ListClusterOperationsV2CommandOutput, +} from "./commands/ListClusterOperationsV2Command"; import { ListClustersCommandInput, ListClustersCommandOutput } from "./commands/ListClustersCommand"; import { ListClustersV2CommandInput, ListClustersV2CommandOutput } from "./commands/ListClustersV2Command"; import { @@ -186,6 +194,7 @@ export type ServiceInputTypes = | DeleteVpcConnectionCommandInput | DescribeClusterCommandInput | DescribeClusterOperationCommandInput + | DescribeClusterOperationV2CommandInput | DescribeClusterV2CommandInput | DescribeConfigurationCommandInput | DescribeConfigurationRevisionCommandInput @@ -195,6 +204,7 @@ export type ServiceInputTypes = | GetCompatibleKafkaVersionsCommandInput | ListClientVpcConnectionsCommandInput | ListClusterOperationsCommandInput + | ListClusterOperationsV2CommandInput | ListClustersCommandInput | ListClustersV2CommandInput | ListConfigurationRevisionsCommandInput @@ -236,6 +246,7 @@ export type ServiceOutputTypes = | DeleteVpcConnectionCommandOutput | DescribeClusterCommandOutput | DescribeClusterOperationCommandOutput + | DescribeClusterOperationV2CommandOutput | DescribeClusterV2CommandOutput | DescribeConfigurationCommandOutput | DescribeConfigurationRevisionCommandOutput @@ -245,6 +256,7 @@ export type ServiceOutputTypes = | GetCompatibleKafkaVersionsCommandOutput | ListClientVpcConnectionsCommandOutput | ListClusterOperationsCommandOutput + | ListClusterOperationsV2CommandOutput | ListClustersCommandOutput | ListClustersV2CommandOutput | ListConfigurationRevisionsCommandOutput diff --git a/clients/client-kafka/src/commands/DescribeClusterOperationV2Command.ts b/clients/client-kafka/src/commands/DescribeClusterOperationV2Command.ts new file mode 100644 index 000000000000..37c9a2686d8c --- /dev/null +++ b/clients/client-kafka/src/commands/DescribeClusterOperationV2Command.ts @@ -0,0 +1,400 @@ +// 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, +} from "@smithy/types"; + +import { KafkaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KafkaClient"; +import { DescribeClusterOperationV2Request, DescribeClusterOperationV2Response } from "../models/models_0"; +import { de_DescribeClusterOperationV2Command, se_DescribeClusterOperationV2Command } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DescribeClusterOperationV2Command}. + */ +export interface DescribeClusterOperationV2CommandInput extends DescribeClusterOperationV2Request {} +/** + * @public + * + * The output of {@link DescribeClusterOperationV2Command}. + */ +export interface DescribeClusterOperationV2CommandOutput extends DescribeClusterOperationV2Response, __MetadataBearer {} + +/** + * @public + *

Returns a description of the cluster operation specified by the ARN.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { KafkaClient, DescribeClusterOperationV2Command } from "@aws-sdk/client-kafka"; // ES Modules import + * // const { KafkaClient, DescribeClusterOperationV2Command } = require("@aws-sdk/client-kafka"); // CommonJS import + * const client = new KafkaClient(config); + * const input = { // DescribeClusterOperationV2Request + * ClusterOperationArn: "STRING_VALUE", // required + * }; + * const command = new DescribeClusterOperationV2Command(input); + * const response = await client.send(command); + * // { // DescribeClusterOperationV2Response + * // ClusterOperationInfo: { // ClusterOperationV2 + * // ClusterArn: "STRING_VALUE", + * // ClusterType: "PROVISIONED" || "SERVERLESS", + * // StartTime: new Date("TIMESTAMP"), + * // EndTime: new Date("TIMESTAMP"), + * // ErrorInfo: { // ErrorInfo + * // ErrorCode: "STRING_VALUE", + * // ErrorString: "STRING_VALUE", + * // }, + * // OperationArn: "STRING_VALUE", + * // OperationState: "STRING_VALUE", + * // OperationType: "STRING_VALUE", + * // Provisioned: { // ClusterOperationV2Provisioned + * // OperationSteps: [ // __listOfClusterOperationStep + * // { // ClusterOperationStep + * // StepInfo: { // ClusterOperationStepInfo + * // StepStatus: "STRING_VALUE", + * // }, + * // StepName: "STRING_VALUE", + * // }, + * // ], + * // SourceClusterInfo: { // MutableClusterInfo + * // BrokerEBSVolumeInfo: [ // __listOfBrokerEBSVolumeInfo + * // { // BrokerEBSVolumeInfo + * // KafkaBrokerNodeId: "STRING_VALUE", // required + * // ProvisionedThroughput: { // ProvisionedThroughput + * // Enabled: true || false, + * // VolumeThroughput: Number("int"), + * // }, + * // VolumeSizeGB: Number("int"), + * // }, + * // ], + * // ConfigurationInfo: { // ConfigurationInfo + * // Arn: "STRING_VALUE", // required + * // Revision: Number("long"), // required + * // }, + * // NumberOfBrokerNodes: Number("int"), + * // EnhancedMonitoring: "DEFAULT" || "PER_BROKER" || "PER_TOPIC_PER_BROKER" || "PER_TOPIC_PER_PARTITION", + * // OpenMonitoring: { // OpenMonitoring + * // Prometheus: { // Prometheus + * // JmxExporter: { // JmxExporter + * // EnabledInBroker: true || false, // required + * // }, + * // NodeExporter: { // NodeExporter + * // EnabledInBroker: true || false, // required + * // }, + * // }, + * // }, + * // KafkaVersion: "STRING_VALUE", + * // LoggingInfo: { // LoggingInfo + * // BrokerLogs: { // BrokerLogs + * // CloudWatchLogs: { // CloudWatchLogs + * // Enabled: true || false, // required + * // LogGroup: "STRING_VALUE", + * // }, + * // Firehose: { // Firehose + * // DeliveryStream: "STRING_VALUE", + * // Enabled: true || false, // required + * // }, + * // S3: { // S3 + * // Bucket: "STRING_VALUE", + * // Enabled: true || false, // required + * // Prefix: "STRING_VALUE", + * // }, + * // }, + * // }, + * // InstanceType: "STRING_VALUE", + * // ClientAuthentication: { // ClientAuthentication + * // Sasl: { // Sasl + * // Scram: { // Scram + * // Enabled: true || false, + * // }, + * // Iam: { // Iam + * // Enabled: true || false, + * // }, + * // }, + * // Tls: { // Tls + * // CertificateAuthorityArnList: [ // __listOf__string + * // "STRING_VALUE", + * // ], + * // Enabled: true || false, + * // }, + * // Unauthenticated: { // Unauthenticated + * // Enabled: true || false, + * // }, + * // }, + * // EncryptionInfo: { // EncryptionInfo + * // EncryptionAtRest: { // EncryptionAtRest + * // DataVolumeKMSKeyId: "STRING_VALUE", // required + * // }, + * // EncryptionInTransit: { // EncryptionInTransit + * // ClientBroker: "TLS" || "TLS_PLAINTEXT" || "PLAINTEXT", + * // InCluster: true || false, + * // }, + * // }, + * // ConnectivityInfo: { // ConnectivityInfo + * // PublicAccess: { // PublicAccess + * // Type: "STRING_VALUE", + * // }, + * // VpcConnectivity: { // VpcConnectivity + * // ClientAuthentication: { // VpcConnectivityClientAuthentication + * // Sasl: { // VpcConnectivitySasl + * // Scram: { // VpcConnectivityScram + * // Enabled: true || false, + * // }, + * // Iam: { // VpcConnectivityIam + * // Enabled: true || false, + * // }, + * // }, + * // Tls: { // VpcConnectivityTls + * // Enabled: true || false, + * // }, + * // }, + * // }, + * // }, + * // StorageMode: "LOCAL" || "TIERED", + * // }, + * // TargetClusterInfo: { + * // BrokerEBSVolumeInfo: [ + * // { + * // KafkaBrokerNodeId: "STRING_VALUE", // required + * // ProvisionedThroughput: { + * // Enabled: true || false, + * // VolumeThroughput: Number("int"), + * // }, + * // VolumeSizeGB: Number("int"), + * // }, + * // ], + * // ConfigurationInfo: { + * // Arn: "STRING_VALUE", // required + * // Revision: Number("long"), // required + * // }, + * // NumberOfBrokerNodes: Number("int"), + * // EnhancedMonitoring: "DEFAULT" || "PER_BROKER" || "PER_TOPIC_PER_BROKER" || "PER_TOPIC_PER_PARTITION", + * // OpenMonitoring: { + * // Prometheus: { + * // JmxExporter: { + * // EnabledInBroker: true || false, // required + * // }, + * // NodeExporter: { + * // EnabledInBroker: true || false, // required + * // }, + * // }, + * // }, + * // KafkaVersion: "STRING_VALUE", + * // LoggingInfo: { + * // BrokerLogs: { + * // CloudWatchLogs: { + * // Enabled: true || false, // required + * // LogGroup: "STRING_VALUE", + * // }, + * // Firehose: { + * // DeliveryStream: "STRING_VALUE", + * // Enabled: true || false, // required + * // }, + * // S3: { + * // Bucket: "STRING_VALUE", + * // Enabled: true || false, // required + * // Prefix: "STRING_VALUE", + * // }, + * // }, + * // }, + * // InstanceType: "STRING_VALUE", + * // ClientAuthentication: { + * // Sasl: { + * // Scram: { + * // Enabled: true || false, + * // }, + * // Iam: { + * // Enabled: true || false, + * // }, + * // }, + * // Tls: { + * // CertificateAuthorityArnList: [ + * // "STRING_VALUE", + * // ], + * // Enabled: true || false, + * // }, + * // Unauthenticated: { + * // Enabled: true || false, + * // }, + * // }, + * // EncryptionInfo: { + * // EncryptionAtRest: { + * // DataVolumeKMSKeyId: "STRING_VALUE", // required + * // }, + * // EncryptionInTransit: { + * // ClientBroker: "TLS" || "TLS_PLAINTEXT" || "PLAINTEXT", + * // InCluster: true || false, + * // }, + * // }, + * // ConnectivityInfo: { + * // PublicAccess: { + * // Type: "STRING_VALUE", + * // }, + * // VpcConnectivity: { + * // ClientAuthentication: { + * // Sasl: { + * // Scram: { + * // Enabled: true || false, + * // }, + * // Iam: { + * // Enabled: true || false, + * // }, + * // }, + * // Tls: { + * // Enabled: true || false, + * // }, + * // }, + * // }, + * // }, + * // StorageMode: "LOCAL" || "TIERED", + * // }, + * // VpcConnectionInfo: { // VpcConnectionInfo + * // VpcConnectionArn: "STRING_VALUE", + * // Owner: "STRING_VALUE", + * // UserIdentity: { // UserIdentity + * // Type: "AWSACCOUNT" || "AWSSERVICE", + * // PrincipalId: "STRING_VALUE", + * // }, + * // CreationTime: new Date("TIMESTAMP"), + * // }, + * // }, + * // Serverless: { // ClusterOperationV2Serverless + * // VpcConnectionInfo: { // VpcConnectionInfoServerless + * // CreationTime: new Date("TIMESTAMP"), + * // Owner: "STRING_VALUE", + * // UserIdentity: { + * // Type: "AWSACCOUNT" || "AWSSERVICE", + * // PrincipalId: "STRING_VALUE", + * // }, + * // VpcConnectionArn: "STRING_VALUE", + * // }, + * // }, + * // }, + * // }; + * + * ``` + * + * @param DescribeClusterOperationV2CommandInput - {@link DescribeClusterOperationV2CommandInput} + * @returns {@link DescribeClusterOperationV2CommandOutput} + * @see {@link DescribeClusterOperationV2CommandInput} for command's `input` shape. + * @see {@link DescribeClusterOperationV2CommandOutput} for command's `response` shape. + * @see {@link KafkaClientResolvedConfig | config} for KafkaClient's `config` shape. + * + * @throws {@link BadRequestException} (client fault) + *

Returns information about an error.

+ * + * @throws {@link ForbiddenException} (client fault) + *

Returns information about an error.

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

Returns information about an error.

+ * + * @throws {@link NotFoundException} (client fault) + *

Returns information about an error.

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

Returns information about an error.

+ * + * @throws {@link TooManyRequestsException} (client fault) + *

Returns information about an error.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

Returns information about an error.

+ * + * @throws {@link KafkaServiceException} + *

Base exception class for all service exceptions from Kafka service.

+ * + */ +export class DescribeClusterOperationV2Command extends $Command< + DescribeClusterOperationV2CommandInput, + DescribeClusterOperationV2CommandOutput, + KafkaClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + 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: DescribeClusterOperationV2CommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: KafkaClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DescribeClusterOperationV2Command.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "KafkaClient"; + const commandName = "DescribeClusterOperationV2Command"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DescribeClusterOperationV2CommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DescribeClusterOperationV2Command(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_DescribeClusterOperationV2Command(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-kafka/src/commands/ListClusterOperationsV2Command.ts b/clients/client-kafka/src/commands/ListClusterOperationsV2Command.ts new file mode 100644 index 000000000000..91f143c95daa --- /dev/null +++ b/clients/client-kafka/src/commands/ListClusterOperationsV2Command.ts @@ -0,0 +1,176 @@ +// 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, +} from "@smithy/types"; + +import { KafkaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KafkaClient"; +import { ListClusterOperationsV2Request, ListClusterOperationsV2Response } from "../models/models_0"; +import { de_ListClusterOperationsV2Command, se_ListClusterOperationsV2Command } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListClusterOperationsV2Command}. + */ +export interface ListClusterOperationsV2CommandInput extends ListClusterOperationsV2Request {} +/** + * @public + * + * The output of {@link ListClusterOperationsV2Command}. + */ +export interface ListClusterOperationsV2CommandOutput extends ListClusterOperationsV2Response, __MetadataBearer {} + +/** + * @public + *

Returns a list of all the operations that have been performed on the specified MSK cluster.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { KafkaClient, ListClusterOperationsV2Command } from "@aws-sdk/client-kafka"; // ES Modules import + * // const { KafkaClient, ListClusterOperationsV2Command } = require("@aws-sdk/client-kafka"); // CommonJS import + * const client = new KafkaClient(config); + * const input = { // ListClusterOperationsV2Request + * ClusterArn: "STRING_VALUE", // required + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListClusterOperationsV2Command(input); + * const response = await client.send(command); + * // { // ListClusterOperationsV2Response + * // ClusterOperationInfoList: [ // __listOfClusterOperationV2Summary + * // { // ClusterOperationV2Summary + * // ClusterArn: "STRING_VALUE", + * // ClusterType: "PROVISIONED" || "SERVERLESS", + * // StartTime: new Date("TIMESTAMP"), + * // EndTime: new Date("TIMESTAMP"), + * // OperationArn: "STRING_VALUE", + * // OperationState: "STRING_VALUE", + * // OperationType: "STRING_VALUE", + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListClusterOperationsV2CommandInput - {@link ListClusterOperationsV2CommandInput} + * @returns {@link ListClusterOperationsV2CommandOutput} + * @see {@link ListClusterOperationsV2CommandInput} for command's `input` shape. + * @see {@link ListClusterOperationsV2CommandOutput} for command's `response` shape. + * @see {@link KafkaClientResolvedConfig | config} for KafkaClient's `config` shape. + * + * @throws {@link BadRequestException} (client fault) + *

Returns information about an error.

+ * + * @throws {@link ForbiddenException} (client fault) + *

Returns information about an error.

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

Returns information about an error.

+ * + * @throws {@link NotFoundException} (client fault) + *

Returns information about an error.

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

Returns information about an error.

+ * + * @throws {@link TooManyRequestsException} (client fault) + *

Returns information about an error.

+ * + * @throws {@link UnauthorizedException} (client fault) + *

Returns information about an error.

+ * + * @throws {@link KafkaServiceException} + *

Base exception class for all service exceptions from Kafka service.

+ * + */ +export class ListClusterOperationsV2Command extends $Command< + ListClusterOperationsV2CommandInput, + ListClusterOperationsV2CommandOutput, + KafkaClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + 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: ListClusterOperationsV2CommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: KafkaClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListClusterOperationsV2Command.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "KafkaClient"; + const commandName = "ListClusterOperationsV2Command"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListClusterOperationsV2CommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListClusterOperationsV2Command(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListClusterOperationsV2Command(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-kafka/src/commands/index.ts b/clients/client-kafka/src/commands/index.ts index 3d97a3c0b499..0f8ee0e0f31c 100644 --- a/clients/client-kafka/src/commands/index.ts +++ b/clients/client-kafka/src/commands/index.ts @@ -11,6 +11,7 @@ export * from "./DeleteConfigurationCommand"; export * from "./DeleteVpcConnectionCommand"; export * from "./DescribeClusterCommand"; export * from "./DescribeClusterOperationCommand"; +export * from "./DescribeClusterOperationV2Command"; export * from "./DescribeClusterV2Command"; export * from "./DescribeConfigurationCommand"; export * from "./DescribeConfigurationRevisionCommand"; @@ -20,6 +21,7 @@ export * from "./GetClusterPolicyCommand"; export * from "./GetCompatibleKafkaVersionsCommand"; export * from "./ListClientVpcConnectionsCommand"; export * from "./ListClusterOperationsCommand"; +export * from "./ListClusterOperationsV2Command"; export * from "./ListClustersCommand"; export * from "./ListClustersV2Command"; export * from "./ListConfigurationRevisionsCommand"; diff --git a/clients/client-kafka/src/models/models_0.ts b/clients/client-kafka/src/models/models_0.ts index 4397ccefdde6..50e39af0f9eb 100644 --- a/clients/client-kafka/src/models/models_0.ts +++ b/clients/client-kafka/src/models/models_0.ts @@ -1176,6 +1176,47 @@ export interface ClusterOperationInfo { VpcConnectionInfo?: VpcConnectionInfo; } +/** + * @public + *

Returns information about a cluster operation.

+ */ +export interface ClusterOperationV2Summary { + /** + *

ARN of the cluster.

+ */ + ClusterArn?: string; + + /** + *

Type of the backend cluster.

+ */ + ClusterType?: ClusterType | string; + + /** + *

The time at which operation was started.

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

The time at which the operation finished.

+ */ + EndTime?: Date; + + /** + *

ARN of the cluster operation.

+ */ + OperationArn?: string; + + /** + *

State of the cluster operation.

+ */ + OperationState?: string; + + /** + *

Type of the cluster operation.

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

Contains source Apache Kafka versions and compatible target Apache Kafka versions.

@@ -1743,6 +1784,125 @@ export interface BatchDisassociateScramSecretResponse { UnprocessedScramSecrets?: UnprocessedScramSecret[]; } +/** + * @public + *

Returns information about a provisioned cluster operation.

+ */ +export interface ClusterOperationV2Provisioned { + /** + *

Steps completed during the operation.

+ */ + OperationSteps?: ClusterOperationStep[]; + + /** + *

Information about cluster attributes before a cluster is updated.

+ */ + SourceClusterInfo?: MutableClusterInfo; + + /** + *

Information about cluster attributes after a cluster is updated.

+ */ + TargetClusterInfo?: MutableClusterInfo; + + /** + *

Description of the VPC connection for CreateVpcConnection and DeleteVpcConnection operations.

+ */ + VpcConnectionInfo?: VpcConnectionInfo; +} + +/** + * @public + * Description of the VPC connection. + */ +export interface VpcConnectionInfoServerless { + /** + *

The time when Amazon MSK creates the VPC Connnection.

+ */ + CreationTime?: Date; + + /** + *

The owner of the VPC Connection.

+ */ + Owner?: string; + + /** + *

Description of the requester that calls the API operation.

+ */ + UserIdentity?: UserIdentity; + + /** + *

The Amazon Resource Name (ARN) of the VPC connection.

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

Returns information about a serverless cluster operation.

+ */ +export interface ClusterOperationV2Serverless { + /** + *

Description of the VPC connection for CreateVpcConnection and DeleteVpcConnection operations.

+ */ + VpcConnectionInfo?: VpcConnectionInfoServerless; +} + +/** + * @public + *

Returns information about a cluster operation.

+ */ +export interface ClusterOperationV2 { + /** + *

ARN of the cluster.

+ */ + ClusterArn?: string; + + /** + *

Type of the backend cluster.

+ */ + ClusterType?: ClusterType | string; + + /** + *

The time at which operation was started.

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

The time at which the operation finished.

+ */ + EndTime?: Date; + + /** + *

If cluster operation failed from an error, it describes the error.

+ */ + ErrorInfo?: ErrorInfo; + + /** + *

ARN of the cluster operation.

+ */ + OperationArn?: string; + + /** + *

State of the cluster operation.

+ */ + OperationState?: string; + + /** + *

Type of the cluster operation.

+ */ + OperationType?: string; + + /** + *

Properties of a provisioned cluster.

+ */ + Provisioned?: ClusterOperationV2Provisioned; + + /** + *

Properties of a serverless cluster.

+ */ + Serverless?: ClusterOperationV2Serverless; +} + /** * @public *

Returns information about an error.

@@ -2248,6 +2408,26 @@ export interface DescribeClusterOperationResponse { ClusterOperationInfo?: ClusterOperationInfo; } +/** + * @public + */ +export interface DescribeClusterOperationV2Request { + /** + * ARN of the cluster operation to describe. + */ + ClusterOperationArn: string | undefined; +} + +/** + * @public + */ +export interface DescribeClusterOperationV2Response { + /** + *

Cluster operation information

+ */ + ClusterOperationInfo?: ClusterOperationV2; +} + /** * @public */ @@ -2607,6 +2787,41 @@ export interface ListClusterOperationsResponse { NextToken?: string; } +/** + * @public + */ +export interface ListClusterOperationsV2Request { + /** + * The arn of the cluster whose operations are being requested. + */ + ClusterArn: string | undefined; + + /** + * The maxResults of the query. + */ + MaxResults?: number; + + /** + * The nextToken of the query. + */ + NextToken?: string; +} + +/** + * @public + */ +export interface ListClusterOperationsV2Response { + /** + *

An array of cluster operation information objects.

+ */ + ClusterOperationInfoList?: ClusterOperationV2Summary[]; + + /** + *

If the response of ListClusterOperationsV2 is truncated, it returns a NextToken in the response. This NextToken should be sent in the subsequent request to ListClusterOperationsV2.

+ */ + NextToken?: string; +} + /** * @public */ diff --git a/clients/client-kafka/src/pagination/ListClusterOperationsV2Paginator.ts b/clients/client-kafka/src/pagination/ListClusterOperationsV2Paginator.ts new file mode 100644 index 000000000000..9fe9ec997b7e --- /dev/null +++ b/clients/client-kafka/src/pagination/ListClusterOperationsV2Paginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListClusterOperationsV2Command, + ListClusterOperationsV2CommandInput, + ListClusterOperationsV2CommandOutput, +} from "../commands/ListClusterOperationsV2Command"; +import { KafkaClient } from "../KafkaClient"; +import { KafkaPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: KafkaClient, + input: ListClusterOperationsV2CommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListClusterOperationsV2Command(input), ...args); +}; +/** + * @public + */ +export async function* paginateListClusterOperationsV2( + config: KafkaPaginationConfiguration, + input: ListClusterOperationsV2CommandInput, + ...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: ListClusterOperationsV2CommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof KafkaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Kafka | KafkaClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kafka/src/pagination/index.ts b/clients/client-kafka/src/pagination/index.ts index f6d59b77fb30..66ff68e8c6a1 100644 --- a/clients/client-kafka/src/pagination/index.ts +++ b/clients/client-kafka/src/pagination/index.ts @@ -2,6 +2,7 @@ export * from "./Interfaces"; export * from "./ListClientVpcConnectionsPaginator"; export * from "./ListClusterOperationsPaginator"; +export * from "./ListClusterOperationsV2Paginator"; export * from "./ListClustersPaginator"; export * from "./ListClustersV2Paginator"; export * from "./ListConfigurationRevisionsPaginator"; diff --git a/clients/client-kafka/src/protocols/Aws_restJson1.ts b/clients/client-kafka/src/protocols/Aws_restJson1.ts index bc98871ec778..98daabd82f71 100644 --- a/clients/client-kafka/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafka/src/protocols/Aws_restJson1.ts @@ -60,6 +60,10 @@ import { DescribeClusterOperationCommandInput, DescribeClusterOperationCommandOutput, } from "../commands/DescribeClusterOperationCommand"; +import { + DescribeClusterOperationV2CommandInput, + DescribeClusterOperationV2CommandOutput, +} from "../commands/DescribeClusterOperationV2Command"; import { DescribeClusterV2CommandInput, DescribeClusterV2CommandOutput } from "../commands/DescribeClusterV2Command"; import { DescribeConfigurationCommandInput, @@ -90,6 +94,10 @@ import { ListClusterOperationsCommandInput, ListClusterOperationsCommandOutput, } from "../commands/ListClusterOperationsCommand"; +import { + ListClusterOperationsV2CommandInput, + ListClusterOperationsV2CommandOutput, +} from "../commands/ListClusterOperationsV2Command"; import { ListClustersCommandInput, ListClustersCommandOutput } from "../commands/ListClustersCommand"; import { ListClustersV2CommandInput, ListClustersV2CommandOutput } from "../commands/ListClustersV2Command"; import { @@ -151,6 +159,10 @@ import { ClusterOperationInfo, ClusterOperationStep, ClusterOperationStepInfo, + ClusterOperationV2, + ClusterOperationV2Provisioned, + ClusterOperationV2Serverless, + ClusterOperationV2Summary, CompatibleKafkaVersion, Configuration, ConfigurationInfo, @@ -202,6 +214,7 @@ import { VpcConfig, VpcConnection, VpcConnectionInfo, + VpcConnectionInfoServerless, VpcConnectivity, VpcConnectivityClientAuthentication, VpcConnectivityIam, @@ -564,6 +577,37 @@ export const se_DescribeClusterOperationCommand = async ( }); }; +/** + * serializeAws_restJson1DescribeClusterOperationV2Command + */ +export const se_DescribeClusterOperationV2Command = async ( + input: DescribeClusterOperationV2CommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/api/v2/operations/{ClusterOperationArn}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "ClusterOperationArn", + () => input.ClusterOperationArn!, + "{ClusterOperationArn}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1DescribeClusterV2Command */ @@ -795,6 +839,35 @@ export const se_ListClusterOperationsCommand = async ( }); }; +/** + * serializeAws_restJson1ListClusterOperationsV2Command + */ +export const se_ListClusterOperationsV2Command = async ( + input: ListClusterOperationsV2CommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/api/v2/clusters/{ClusterArn}/operations"; + resolvedPath = __resolvedPath(resolvedPath, input, "ClusterArn", () => input.ClusterArn!, "{ClusterArn}", false); + const query: any = map({ + 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_restJson1ListClustersCommand */ @@ -2269,6 +2342,71 @@ const de_DescribeClusterOperationCommandError = async ( } }; +/** + * deserializeAws_restJson1DescribeClusterOperationV2Command + */ +export const de_DescribeClusterOperationV2Command = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_DescribeClusterOperationV2CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ClusterOperationInfo: [, (_) => de_ClusterOperationV2(_, context), `clusterOperationInfo`], + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DescribeClusterOperationV2CommandError + */ +const de_DescribeClusterOperationV2CommandError = 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 "BadRequestException": + case "com.amazonaws.kafka#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ForbiddenException": + case "com.amazonaws.kafka#ForbiddenException": + throw await de_ForbiddenExceptionRes(parsedOutput, context); + case "InternalServerErrorException": + case "com.amazonaws.kafka#InternalServerErrorException": + throw await de_InternalServerErrorExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.kafka#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.kafka#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.kafka#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.kafka#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1DescribeClusterV2Command */ @@ -2839,6 +2977,72 @@ const de_ListClusterOperationsCommandError = async ( } }; +/** + * deserializeAws_restJson1ListClusterOperationsV2Command + */ +export const de_ListClusterOperationsV2Command = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListClusterOperationsV2CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ClusterOperationInfoList: [, (_) => de___listOfClusterOperationV2Summary(_, context), `clusterOperationInfoList`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListClusterOperationsV2CommandError + */ +const de_ListClusterOperationsV2CommandError = 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 "BadRequestException": + case "com.amazonaws.kafka#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ForbiddenException": + case "com.amazonaws.kafka#ForbiddenException": + throw await de_ForbiddenExceptionRes(parsedOutput, context); + case "InternalServerErrorException": + case "com.amazonaws.kafka#InternalServerErrorException": + throw await de_InternalServerErrorExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.kafka#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.kafka#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.kafka#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.kafka#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1ListClustersCommand */ @@ -4905,6 +5109,18 @@ const de___listOfClusterOperationStep = (output: any, context: __SerdeContext): return retVal; }; +/** + * deserializeAws_restJson1__listOfClusterOperationV2Summary + */ +const de___listOfClusterOperationV2Summary = (output: any, context: __SerdeContext): ClusterOperationV2Summary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_ClusterOperationV2Summary(entry, context); + }); + return retVal; +}; + /** * deserializeAws_restJson1__listOfCompatibleKafkaVersion */ @@ -5184,6 +5400,60 @@ const de_ClusterOperationStepInfo = (output: any, context: __SerdeContext): Clus }) as any; }; +/** + * deserializeAws_restJson1ClusterOperationV2 + */ +const de_ClusterOperationV2 = (output: any, context: __SerdeContext): ClusterOperationV2 => { + return take(output, { + ClusterArn: [, __expectString, `clusterArn`], + ClusterType: [, __expectString, `clusterType`], + EndTime: [, (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `endTime`], + ErrorInfo: [, (_: any) => de_ErrorInfo(_, context), `errorInfo`], + OperationArn: [, __expectString, `operationArn`], + OperationState: [, __expectString, `operationState`], + OperationType: [, __expectString, `operationType`], + Provisioned: [, (_: any) => de_ClusterOperationV2Provisioned(_, context), `provisioned`], + Serverless: [, (_: any) => de_ClusterOperationV2Serverless(_, context), `serverless`], + StartTime: [, (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `startTime`], + }) as any; +}; + +/** + * deserializeAws_restJson1ClusterOperationV2Provisioned + */ +const de_ClusterOperationV2Provisioned = (output: any, context: __SerdeContext): ClusterOperationV2Provisioned => { + return take(output, { + OperationSteps: [, (_: any) => de___listOfClusterOperationStep(_, context), `operationSteps`], + SourceClusterInfo: [, (_: any) => de_MutableClusterInfo(_, context), `sourceClusterInfo`], + TargetClusterInfo: [, (_: any) => de_MutableClusterInfo(_, context), `targetClusterInfo`], + VpcConnectionInfo: [, (_: any) => de_VpcConnectionInfo(_, context), `vpcConnectionInfo`], + }) as any; +}; + +/** + * deserializeAws_restJson1ClusterOperationV2Serverless + */ +const de_ClusterOperationV2Serverless = (output: any, context: __SerdeContext): ClusterOperationV2Serverless => { + return take(output, { + VpcConnectionInfo: [, (_: any) => de_VpcConnectionInfoServerless(_, context), `vpcConnectionInfo`], + }) as any; +}; + +/** + * deserializeAws_restJson1ClusterOperationV2Summary + */ +const de_ClusterOperationV2Summary = (output: any, context: __SerdeContext): ClusterOperationV2Summary => { + return take(output, { + ClusterArn: [, __expectString, `clusterArn`], + ClusterType: [, __expectString, `clusterType`], + EndTime: [, (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `endTime`], + OperationArn: [, __expectString, `operationArn`], + OperationState: [, __expectString, `operationState`], + OperationType: [, __expectString, `operationType`], + StartTime: [, (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `startTime`], + }) as any; +}; + /** * deserializeAws_restJson1CompatibleKafkaVersion */ @@ -5626,6 +5896,18 @@ const de_VpcConnectionInfo = (output: any, context: __SerdeContext): VpcConnecti }) as any; }; +/** + * deserializeAws_restJson1VpcConnectionInfoServerless + */ +const de_VpcConnectionInfoServerless = (output: any, context: __SerdeContext): VpcConnectionInfoServerless => { + return take(output, { + CreationTime: [, (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `creationTime`], + Owner: [, __expectString, `owner`], + UserIdentity: [, (_: any) => de_UserIdentity(_, context), `userIdentity`], + VpcConnectionArn: [, __expectString, `vpcConnectionArn`], + }) as any; +}; + /** * deserializeAws_restJson1VpcConnectivity */ diff --git a/codegen/sdk-codegen/aws-models/kafka.json b/codegen/sdk-codegen/aws-models/kafka.json index f732d01bd9c4..557cf84b3ff7 100644 --- a/codegen/sdk-codegen/aws-models/kafka.json +++ b/codegen/sdk-codegen/aws-models/kafka.json @@ -902,6 +902,192 @@ "smithy.api#documentation": "

State information about the operation step.

" } }, + "com.amazonaws.kafka#ClusterOperationV2": { + "type": "structure", + "members": { + "ClusterArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

ARN of the cluster.

", + "smithy.api#jsonName": "clusterArn" + } + }, + "ClusterType": { + "target": "com.amazonaws.kafka#ClusterType", + "traits": { + "smithy.api#documentation": "

Type of the backend cluster.

", + "smithy.api#jsonName": "clusterType" + } + }, + "StartTime": { + "target": "com.amazonaws.kafka#__timestampIso8601", + "traits": { + "smithy.api#documentation": "

The time at which operation was started.

", + "smithy.api#jsonName": "startTime" + } + }, + "EndTime": { + "target": "com.amazonaws.kafka#__timestampIso8601", + "traits": { + "smithy.api#documentation": "

The time at which the operation finished.

", + "smithy.api#jsonName": "endTime" + } + }, + "ErrorInfo": { + "target": "com.amazonaws.kafka#ErrorInfo", + "traits": { + "smithy.api#documentation": "

If cluster operation failed from an error, it describes the error.

", + "smithy.api#jsonName": "errorInfo" + } + }, + "OperationArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

ARN of the cluster operation.

", + "smithy.api#jsonName": "operationArn" + } + }, + "OperationState": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

State of the cluster operation.

", + "smithy.api#jsonName": "operationState" + } + }, + "OperationType": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

Type of the cluster operation.

", + "smithy.api#jsonName": "operationType" + } + }, + "Provisioned": { + "target": "com.amazonaws.kafka#ClusterOperationV2Provisioned", + "traits": { + "smithy.api#documentation": "

Properties of a provisioned cluster.

", + "smithy.api#jsonName": "provisioned" + } + }, + "Serverless": { + "target": "com.amazonaws.kafka#ClusterOperationV2Serverless", + "traits": { + "smithy.api#documentation": "

Properties of a serverless cluster.

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

Returns information about a cluster operation.

" + } + }, + "com.amazonaws.kafka#ClusterOperationV2Provisioned": { + "type": "structure", + "members": { + "OperationSteps": { + "target": "com.amazonaws.kafka#__listOfClusterOperationStep", + "traits": { + "smithy.api#documentation": "

Steps completed during the operation.

", + "smithy.api#jsonName": "operationSteps" + } + }, + "SourceClusterInfo": { + "target": "com.amazonaws.kafka#MutableClusterInfo", + "traits": { + "smithy.api#documentation": "

Information about cluster attributes before a cluster is updated.

", + "smithy.api#jsonName": "sourceClusterInfo" + } + }, + "TargetClusterInfo": { + "target": "com.amazonaws.kafka#MutableClusterInfo", + "traits": { + "smithy.api#documentation": "

Information about cluster attributes after a cluster is updated.

", + "smithy.api#jsonName": "targetClusterInfo" + } + }, + "VpcConnectionInfo": { + "target": "com.amazonaws.kafka#VpcConnectionInfo", + "traits": { + "smithy.api#documentation": "

Description of the VPC connection for CreateVpcConnection and DeleteVpcConnection operations.

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

Returns information about a provisioned cluster operation.

" + } + }, + "com.amazonaws.kafka#ClusterOperationV2Serverless": { + "type": "structure", + "members": { + "VpcConnectionInfo": { + "target": "com.amazonaws.kafka#VpcConnectionInfoServerless", + "traits": { + "smithy.api#documentation": "

Description of the VPC connection for CreateVpcConnection and DeleteVpcConnection operations.

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

Returns information about a serverless cluster operation.

" + } + }, + "com.amazonaws.kafka#ClusterOperationV2Summary": { + "type": "structure", + "members": { + "ClusterArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

ARN of the cluster.

", + "smithy.api#jsonName": "clusterArn" + } + }, + "ClusterType": { + "target": "com.amazonaws.kafka#ClusterType", + "traits": { + "smithy.api#documentation": "

Type of the backend cluster.

", + "smithy.api#jsonName": "clusterType" + } + }, + "StartTime": { + "target": "com.amazonaws.kafka#__timestampIso8601", + "traits": { + "smithy.api#documentation": "

The time at which operation was started.

", + "smithy.api#jsonName": "startTime" + } + }, + "EndTime": { + "target": "com.amazonaws.kafka#__timestampIso8601", + "traits": { + "smithy.api#documentation": "

The time at which the operation finished.

", + "smithy.api#jsonName": "endTime" + } + }, + "OperationArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

ARN of the cluster operation.

", + "smithy.api#jsonName": "operationArn" + } + }, + "OperationState": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

State of the cluster operation.

", + "smithy.api#jsonName": "operationState" + } + }, + "OperationType": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

Type of the cluster operation.

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

Returns information about a cluster operation.

" + } + }, "com.amazonaws.kafka#ClusterState": { "type": "enum", "members": { @@ -2112,6 +2298,77 @@ "smithy.api#output": {} } }, + "com.amazonaws.kafka#DescribeClusterOperationV2": { + "type": "operation", + "input": { + "target": "com.amazonaws.kafka#DescribeClusterOperationV2Request" + }, + "output": { + "target": "com.amazonaws.kafka#DescribeClusterOperationV2Response" + }, + "errors": [ + { + "target": "com.amazonaws.kafka#BadRequestException" + }, + { + "target": "com.amazonaws.kafka#ForbiddenException" + }, + { + "target": "com.amazonaws.kafka#InternalServerErrorException" + }, + { + "target": "com.amazonaws.kafka#NotFoundException" + }, + { + "target": "com.amazonaws.kafka#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.kafka#TooManyRequestsException" + }, + { + "target": "com.amazonaws.kafka#UnauthorizedException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a description of the cluster operation specified by the ARN.

", + "smithy.api#http": { + "method": "GET", + "uri": "/api/v2/operations/{ClusterOperationArn}", + "code": 200 + } + } + }, + "com.amazonaws.kafka#DescribeClusterOperationV2Request": { + "type": "structure", + "members": { + "ClusterOperationArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "ARN of the cluster operation to describe.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.kafka#DescribeClusterOperationV2Response": { + "type": "structure", + "members": { + "ClusterOperationInfo": { + "target": "com.amazonaws.kafka#ClusterOperationV2", + "traits": { + "smithy.api#documentation": "

Cluster operation information

", + "smithy.api#jsonName": "clusterOperationInfo" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.kafka#DescribeClusterRequest": { "type": "structure", "members": { @@ -3102,6 +3359,9 @@ { "target": "com.amazonaws.kafka#DescribeClusterOperation" }, + { + "target": "com.amazonaws.kafka#DescribeClusterOperationV2" + }, { "target": "com.amazonaws.kafka#DescribeClusterV2" }, @@ -3129,6 +3389,9 @@ { "target": "com.amazonaws.kafka#ListClusterOperations" }, + { + "target": "com.amazonaws.kafka#ListClusterOperationsV2" + }, { "target": "com.amazonaws.kafka#ListClusters" }, @@ -4421,6 +4684,104 @@ "smithy.api#output": {} } }, + "com.amazonaws.kafka#ListClusterOperationsV2": { + "type": "operation", + "input": { + "target": "com.amazonaws.kafka#ListClusterOperationsV2Request" + }, + "output": { + "target": "com.amazonaws.kafka#ListClusterOperationsV2Response" + }, + "errors": [ + { + "target": "com.amazonaws.kafka#BadRequestException" + }, + { + "target": "com.amazonaws.kafka#ForbiddenException" + }, + { + "target": "com.amazonaws.kafka#InternalServerErrorException" + }, + { + "target": "com.amazonaws.kafka#NotFoundException" + }, + { + "target": "com.amazonaws.kafka#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.kafka#TooManyRequestsException" + }, + { + "target": "com.amazonaws.kafka#UnauthorizedException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a list of all the operations that have been performed on the specified MSK cluster.

", + "smithy.api#http": { + "method": "GET", + "uri": "/api/v2/clusters/{ClusterArn}/operations", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "ClusterOperationInfoList", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.kafka#ListClusterOperationsV2Request": { + "type": "structure", + "members": { + "ClusterArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "The arn of the cluster whose operations are being requested.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "MaxResults": { + "target": "com.amazonaws.kafka#MaxResults", + "traits": { + "smithy.api#documentation": "The maxResults of the query.", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "The nextToken of the query.", + "smithy.api#httpQuery": "nextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.kafka#ListClusterOperationsV2Response": { + "type": "structure", + "members": { + "ClusterOperationInfoList": { + "target": "com.amazonaws.kafka#__listOfClusterOperationV2Summary", + "traits": { + "smithy.api#documentation": "

An array of cluster operation information objects.

", + "smithy.api#jsonName": "clusterOperationInfoList" + } + }, + "NextToken": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

If the response of ListClusterOperationsV2 is truncated, it returns a NextToken in the response. This NextToken should be sent in the subsequent request to ListClusterOperationsV2.

", + "smithy.api#jsonName": "nextToken" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.kafka#ListClusters": { "type": "operation", "input": { @@ -7466,6 +7827,42 @@ "smithy.api#documentation": "

Description of the VPC connection.

" } }, + "com.amazonaws.kafka#VpcConnectionInfoServerless": { + "type": "structure", + "members": { + "CreationTime": { + "target": "com.amazonaws.kafka#__timestampIso8601", + "traits": { + "smithy.api#documentation": "

The time when Amazon MSK creates the VPC Connnection.

", + "smithy.api#jsonName": "creationTime" + } + }, + "Owner": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

The owner of the VPC Connection.

", + "smithy.api#jsonName": "owner" + } + }, + "UserIdentity": { + "target": "com.amazonaws.kafka#UserIdentity", + "traits": { + "smithy.api#documentation": "

Description of the requester that calls the API operation.

", + "smithy.api#jsonName": "userIdentity" + } + }, + "VpcConnectionArn": { + "target": "com.amazonaws.kafka#__string", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the VPC connection.

", + "smithy.api#jsonName": "vpcConnectionArn" + } + } + }, + "traits": { + "smithy.api#documentation": "Description of the VPC connection." + } + }, "com.amazonaws.kafka#VpcConnectionState": { "type": "enum", "members": { @@ -7735,6 +8132,12 @@ "target": "com.amazonaws.kafka#ClusterOperationStep" } }, + "com.amazonaws.kafka#__listOfClusterOperationV2Summary": { + "type": "list", + "member": { + "target": "com.amazonaws.kafka#ClusterOperationV2Summary" + } + }, "com.amazonaws.kafka#__listOfCompatibleKafkaVersion": { "type": "list", "member": {