Skip to content

Commit 0fd7c71

Browse files
author
awstools
committed
feat(client-kafka): This release adds support for Tiered Storage. UpdateStorage allows you to control the Storage Mode for supported storage tiers.
1 parent 6adb3be commit 0fd7c71

File tree

7 files changed

+898
-351
lines changed

7 files changed

+898
-351
lines changed

clients/client-kafka/src/Kafka.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ import {
168168
UpdateSecurityCommandInput,
169169
UpdateSecurityCommandOutput,
170170
} from "./commands/UpdateSecurityCommand";
171+
import {
172+
UpdateStorageCommand,
173+
UpdateStorageCommandInput,
174+
UpdateStorageCommandOutput,
175+
} from "./commands/UpdateStorageCommand";
171176
import { KafkaClient } from "./KafkaClient";
172177

173178
/**
@@ -1275,4 +1280,36 @@ export class Kafka extends KafkaClient {
12751280
return this.send(command, optionsOrCb);
12761281
}
12771282
}
1283+
1284+
/**
1285+
* Updates cluster broker volume size (or) sets cluster storage mode to TIERED.
1286+
*/
1287+
public updateStorage(
1288+
args: UpdateStorageCommandInput,
1289+
options?: __HttpHandlerOptions
1290+
): Promise<UpdateStorageCommandOutput>;
1291+
public updateStorage(
1292+
args: UpdateStorageCommandInput,
1293+
cb: (err: any, data?: UpdateStorageCommandOutput) => void
1294+
): void;
1295+
public updateStorage(
1296+
args: UpdateStorageCommandInput,
1297+
options: __HttpHandlerOptions,
1298+
cb: (err: any, data?: UpdateStorageCommandOutput) => void
1299+
): void;
1300+
public updateStorage(
1301+
args: UpdateStorageCommandInput,
1302+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateStorageCommandOutput) => void),
1303+
cb?: (err: any, data?: UpdateStorageCommandOutput) => void
1304+
): Promise<UpdateStorageCommandOutput> | void {
1305+
const command = new UpdateStorageCommand(args);
1306+
if (typeof optionsOrCb === "function") {
1307+
this.send(command, optionsOrCb);
1308+
} else if (typeof cb === "function") {
1309+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1310+
this.send(command, optionsOrCb || {}, cb);
1311+
} else {
1312+
return this.send(command, optionsOrCb);
1313+
}
1314+
}
12781315
}

clients/client-kafka/src/KafkaClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ import {
130130
import { UpdateConnectivityCommandInput, UpdateConnectivityCommandOutput } from "./commands/UpdateConnectivityCommand";
131131
import { UpdateMonitoringCommandInput, UpdateMonitoringCommandOutput } from "./commands/UpdateMonitoringCommand";
132132
import { UpdateSecurityCommandInput, UpdateSecurityCommandOutput } from "./commands/UpdateSecurityCommand";
133+
import { UpdateStorageCommandInput, UpdateStorageCommandOutput } from "./commands/UpdateStorageCommand";
133134
import {
134135
ClientInputEndpointParameters,
135136
ClientResolvedEndpointParameters,
@@ -173,7 +174,8 @@ export type ServiceInputTypes =
173174
| UpdateConfigurationCommandInput
174175
| UpdateConnectivityCommandInput
175176
| UpdateMonitoringCommandInput
176-
| UpdateSecurityCommandInput;
177+
| UpdateSecurityCommandInput
178+
| UpdateStorageCommandInput;
177179

178180
export type ServiceOutputTypes =
179181
| BatchAssociateScramSecretCommandOutput
@@ -210,7 +212,8 @@ export type ServiceOutputTypes =
210212
| UpdateConfigurationCommandOutput
211213
| UpdateConnectivityCommandOutput
212214
| UpdateMonitoringCommandOutput
213-
| UpdateSecurityCommandOutput;
215+
| UpdateSecurityCommandOutput
216+
| UpdateStorageCommandOutput;
214217

215218
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
216219
/**
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import { KafkaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KafkaClient";
17+
import {
18+
UpdateStorageRequest,
19+
UpdateStorageRequestFilterSensitiveLog,
20+
UpdateStorageResponse,
21+
UpdateStorageResponseFilterSensitiveLog,
22+
} from "../models/models_0";
23+
import {
24+
deserializeAws_restJson1UpdateStorageCommand,
25+
serializeAws_restJson1UpdateStorageCommand,
26+
} from "../protocols/Aws_restJson1";
27+
28+
export interface UpdateStorageCommandInput extends UpdateStorageRequest {}
29+
export interface UpdateStorageCommandOutput extends UpdateStorageResponse, __MetadataBearer {}
30+
31+
/**
32+
* Updates cluster broker volume size (or) sets cluster storage mode to TIERED.
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { KafkaClient, UpdateStorageCommand } from "@aws-sdk/client-kafka"; // ES Modules import
37+
* // const { KafkaClient, UpdateStorageCommand } = require("@aws-sdk/client-kafka"); // CommonJS import
38+
* const client = new KafkaClient(config);
39+
* const command = new UpdateStorageCommand(input);
40+
* const response = await client.send(command);
41+
* ```
42+
*
43+
* @see {@link UpdateStorageCommandInput} for command's `input` shape.
44+
* @see {@link UpdateStorageCommandOutput} for command's `response` shape.
45+
* @see {@link KafkaClientResolvedConfig | config} for KafkaClient's `config` shape.
46+
*
47+
*/
48+
export class UpdateStorageCommand extends $Command<
49+
UpdateStorageCommandInput,
50+
UpdateStorageCommandOutput,
51+
KafkaClientResolvedConfig
52+
> {
53+
// Start section: command_properties
54+
// End section: command_properties
55+
56+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
57+
return {
58+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
59+
Endpoint: { type: "builtInParams", name: "endpoint" },
60+
Region: { type: "builtInParams", name: "region" },
61+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
62+
};
63+
}
64+
65+
constructor(readonly input: UpdateStorageCommandInput) {
66+
// Start section: command_constructor
67+
super();
68+
// End section: command_constructor
69+
}
70+
71+
/**
72+
* @internal
73+
*/
74+
resolveMiddleware(
75+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
76+
configuration: KafkaClientResolvedConfig,
77+
options?: __HttpHandlerOptions
78+
): Handler<UpdateStorageCommandInput, UpdateStorageCommandOutput> {
79+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
80+
this.middlewareStack.use(getEndpointPlugin(configuration, UpdateStorageCommand.getEndpointParameterInstructions()));
81+
82+
const stack = clientStack.concat(this.middlewareStack);
83+
84+
const { logger } = configuration;
85+
const clientName = "KafkaClient";
86+
const commandName = "UpdateStorageCommand";
87+
const handlerExecutionContext: HandlerExecutionContext = {
88+
logger,
89+
clientName,
90+
commandName,
91+
inputFilterSensitiveLog: UpdateStorageRequestFilterSensitiveLog,
92+
outputFilterSensitiveLog: UpdateStorageResponseFilterSensitiveLog,
93+
};
94+
const { requestHandler } = configuration;
95+
return stack.resolve(
96+
(request: FinalizeHandlerArguments<any>) =>
97+
requestHandler.handle(request.request as __HttpRequest, options || {}),
98+
handlerExecutionContext
99+
);
100+
}
101+
102+
private serialize(input: UpdateStorageCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
103+
return serializeAws_restJson1UpdateStorageCommand(input, context);
104+
}
105+
106+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateStorageCommandOutput> {
107+
return deserializeAws_restJson1UpdateStorageCommand(output, context);
108+
}
109+
110+
// Start section: command_body_extra
111+
// End section: command_body_extra
112+
}

clients/client-kafka/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ export * from "./UpdateConfigurationCommand";
3434
export * from "./UpdateConnectivityCommand";
3535
export * from "./UpdateMonitoringCommand";
3636
export * from "./UpdateSecurityCommand";
37+
export * from "./UpdateStorageCommand";

clients/client-kafka/src/models/models_0.ts

Lines changed: 91 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-cl
44
import { KafkaServiceException as __BaseException } from "./KafkaServiceException";
55

66
/**
7-
* Contains information about provisioned throughput for EBS storage volumes attached to kafka broker nodes.
7+
* <p>Contains information about provisioned throughput for EBS storage volumes attached to kafka broker nodes.</p>
88
*/
99
export interface ProvisionedThroughput {
1010
/**
11-
* Provisioned throughput is enabled or not.
11+
* <p>Provisioned throughput is enabled or not.</p>
1212
*/
1313
Enabled?: boolean;
1414

1515
/**
16-
* Throughput value of the EBS volumes for the data drive on each kafka broker node in MiB per second.
16+
* <p>Throughput value of the EBS volumes for the data drive on each kafka broker node in MiB per second.</p>
1717
*/
1818
VolumeThroughput?: number;
1919
}
@@ -28,7 +28,7 @@ export interface BrokerEBSVolumeInfo {
2828
KafkaBrokerNodeId: string | undefined;
2929

3030
/**
31-
* EBS volume provisioned throughput information.
31+
* <p>EBS volume provisioned throughput information.</p>
3232
*/
3333
ProvisionedThroughput?: ProvisionedThroughput;
3434

@@ -72,7 +72,7 @@ export interface ConnectivityInfo {
7272
*/
7373
export interface EBSStorageInfo {
7474
/**
75-
* EBS volume provisioned throughput information.
75+
* <p>EBS volume provisioned throughput information.</p>
7676
*/
7777
ProvisionedThroughput?: ProvisionedThroughput;
7878

@@ -358,6 +358,11 @@ export interface OpenMonitoringInfo {
358358
Prometheus: PrometheusInfo | undefined;
359359
}
360360

361+
export enum StorageMode {
362+
LOCAL = "LOCAL",
363+
TIERED = "TIERED",
364+
}
365+
361366
/**
362367
* <p>Provisioned cluster.</p>
363368
*/
@@ -411,6 +416,11 @@ export interface Provisioned {
411416
* <p>The connection string to use to connect to the Apache ZooKeeper cluster on a TLS port.</p>
412417
*/
413418
ZookeeperConnectStringTls?: string;
419+
420+
/**
421+
* <p>This controls storage mode for supported storage tiers.</p>
422+
*/
423+
StorageMode?: StorageMode | string;
414424
}
415425

416426
/**
@@ -669,6 +679,11 @@ export interface ClusterInfo {
669679
* <p>The connection string to use to connect to zookeeper cluster on Tls port.</p>
670680
*/
671681
ZookeeperConnectStringTls?: string;
682+
683+
/**
684+
* <p>This controls storage mode for supported storage tiers.</p>
685+
*/
686+
StorageMode?: StorageMode | string;
672687
}
673688

674689
/**
@@ -784,6 +799,11 @@ export interface MutableClusterInfo {
784799
* <p>Information about the broker access configuration.</p>
785800
*/
786801
ConnectivityInfo?: ConnectivityInfo;
802+
803+
/**
804+
* <p>This controls storage mode for supported storage tiers.</p>
805+
*/
806+
StorageMode?: StorageMode | string;
787807
}
788808

789809
/**
@@ -1406,6 +1426,11 @@ export interface CreateClusterRequest {
14061426
* <p>Create tags when creating the cluster.</p>
14071427
*/
14081428
Tags?: Record<string, string>;
1429+
1430+
/**
1431+
* <p>This controls storage mode for supported storage tiers.</p>
1432+
*/
1433+
StorageMode?: StorageMode | string;
14091434
}
14101435

14111436
export interface CreateClusterResponse {
@@ -1473,6 +1498,11 @@ export interface ProvisionedRequest {
14731498
* <p>The number of broker nodes in the cluster.</p>
14741499
*/
14751500
NumberOfBrokerNodes: number | undefined;
1501+
1502+
/**
1503+
* <p>This controls storage mode for supported storage tiers.</p>
1504+
*/
1505+
StorageMode?: StorageMode | string;
14761506
}
14771507

14781508
/**
@@ -2410,6 +2440,48 @@ export interface UpdateSecurityResponse {
24102440
ClusterOperationArn?: string;
24112441
}
24122442

2443+
/**
2444+
* <p>Request object for UpdateStorage api. Its used to update the storage attributes for the cluster.</p>
2445+
*/
2446+
export interface UpdateStorageRequest {
2447+
/**
2448+
* <p>The Amazon Resource Name (ARN) of the cluster to be updated.</p>
2449+
*/
2450+
ClusterArn: string | undefined;
2451+
2452+
/**
2453+
* <p>The version of cluster to update from. A successful operation will then generate a new version.</p>
2454+
*/
2455+
CurrentVersion: string | undefined;
2456+
2457+
/**
2458+
* <p>EBS volume provisioned throughput information.</p>
2459+
*/
2460+
ProvisionedThroughput?: ProvisionedThroughput;
2461+
2462+
/**
2463+
* <p>Controls storage mode for supported storage tiers.</p>
2464+
*/
2465+
StorageMode?: StorageMode | string;
2466+
2467+
/**
2468+
* <p>size of the EBS volume to update.</p>
2469+
*/
2470+
VolumeSizeGB?: number;
2471+
}
2472+
2473+
export interface UpdateStorageResponse {
2474+
/**
2475+
* <p>The Amazon Resource Name (ARN) of the cluster.</p>
2476+
*/
2477+
ClusterArn?: string;
2478+
2479+
/**
2480+
* <p>The Amazon Resource Name (ARN) of the cluster operation.</p>
2481+
*/
2482+
ClusterOperationArn?: string;
2483+
}
2484+
24132485
/**
24142486
* @internal
24152487
*/
@@ -3271,3 +3343,17 @@ export const UpdateSecurityRequestFilterSensitiveLog = (obj: UpdateSecurityReque
32713343
export const UpdateSecurityResponseFilterSensitiveLog = (obj: UpdateSecurityResponse): any => ({
32723344
...obj,
32733345
});
3346+
3347+
/**
3348+
* @internal
3349+
*/
3350+
export const UpdateStorageRequestFilterSensitiveLog = (obj: UpdateStorageRequest): any => ({
3351+
...obj,
3352+
});
3353+
3354+
/**
3355+
* @internal
3356+
*/
3357+
export const UpdateStorageResponseFilterSensitiveLog = (obj: UpdateStorageResponse): any => ({
3358+
...obj,
3359+
});

0 commit comments

Comments
 (0)