Skip to content

Commit

Permalink
Amazon MSK has updated the CreateCluster and UpdateBrokerStorage API …
Browse files Browse the repository at this point in the history
…that allows you to specify volume throughput during cluster creation and broker volume updates.
  • Loading branch information
aws-sdk-dotnet-automation committed Jan 27, 2022
1 parent 0a0a267 commit b2f2d1d
Show file tree
Hide file tree
Showing 12 changed files with 363 additions and 4 deletions.
22 changes: 21 additions & 1 deletion generator/ServiceModels/kafka/kafka-2018-11-14.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,13 +1158,16 @@
"shape": "__string",
"locationName": "kafkaBrokerNodeId"
},
"ProvisionedThroughput" : {
"shape" : "ProvisionedThroughput",
"locationName" : "provisionedThroughput"
},
"VolumeSizeGB": {
"shape": "__integer",
"locationName": "volumeSizeGB"
}
},
"required": [
"VolumeSizeGB",
"KafkaBrokerNodeId"
]
},
Expand Down Expand Up @@ -1935,6 +1938,10 @@
"EBSStorageInfo": {
"type": "structure",
"members": {
"ProvisionedThroughput" : {
"shape" : "ProvisionedThroughput",
"locationName" : "provisionedThroughput"
},
"VolumeSize": {
"shape": "__integerMin1Max16384",
"locationName": "volumeSize"
Expand Down Expand Up @@ -3479,6 +3486,19 @@
}
}
},
"ProvisionedThroughput" : {
"type" : "structure",
"members" : {
"Enabled" : {
"shape" : "__boolean",
"locationName" : "enabled"
},
"VolumeThroughput" : {
"shape" : "__integer",
"locationName" : "volumeThroughput"
}
}
},
"PublicAccess":{
"type":"structure",
"members":{
Expand Down
11 changes: 10 additions & 1 deletion generator/ServiceModels/kafka/kafka-2018-11-14.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,13 @@
"OpenMonitoringInfo$Prometheus" : "<p>Prometheus settings.</p>"
}
},
"ProvisionedThroughput" : {
"base" : "Contains information about provisioned throughput for EBS storage volumes attached to kafka broker nodes.",
"refs" : {
"BrokerEBSVolumeInfo$ProvisionedThroughput" : "EBS volume provisioned throughput information.",
"EBSStorageInfo$ProvisionedThroughput" : "EBS volume provisioned throughput information."
}
},
"PublicAccess" : {
"base" : "<p>Broker public access control.</p>",
"refs" : {
Expand Down Expand Up @@ -668,6 +675,7 @@
"JmxExporterInfo$EnabledInBroker" : "<p>JMX Exporter being enabled in broker.</p>",
"NodeExporter$EnabledInBroker" : "<p>Indicates whether you want to enable or disable the Node Exporter.</p>",
"NodeExporterInfo$EnabledInBroker" : "<p>Node Exporter being enabled in broker.</p>",
"ProvisionedThroughput$Enabled" : "Provisioned throughput is enabled or not.",
"S3$Enabled" : "<p>Specifies whether broker logs get sent to the specified Amazon S3 destination.</p>",
"Scram$Enabled" : "<p>SASL/SCRAM authentication is enabled or not.</p>",
"Tls$Enabled" : "<p>TLS authentication is enabled or not.</p>",
Expand All @@ -687,7 +695,8 @@
"BrokerEBSVolumeInfo$VolumeSizeGB" : "\n <p>Size of the EBS volume to update.</p>\n ",
"ClusterInfo$NumberOfBrokerNodes" : "\n <p>The number of broker nodes in the cluster.</p>\n ",
"CreateClusterRequest$NumberOfBrokerNodes" : "\n <p>The number of broker nodes in the cluster.</p>\n ",
"MutableClusterInfo$NumberOfBrokerNodes" : "\n <p>The number of broker nodes in the cluster.</p>\n "
"MutableClusterInfo$NumberOfBrokerNodes" : "\n <p>The number of broker nodes in the cluster.</p>\n ",
"ProvisionedThroughput$VolumeThroughput" : "Throughput value of the EBS volumes for the data drive on each kafka broker node in MiB per second."
}
},
"__integerMin1Max15" : {
Expand Down
27 changes: 26 additions & 1 deletion generator/ServiceModels/kafka/kafka-2018-11-14.normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,11 @@
"locationName": "kafkaBrokerNodeId",
"documentation": "\n <p>The ID of the broker to update.</p>\n "
},
"ProvisionedThroughput" : {
"shape" : "ProvisionedThroughput",
"locationName" : "provisionedThroughput",
"documentation" : "EBS volume provisioned throughput information."
},
"VolumeSizeGB": {
"shape": "__integer",
"locationName": "volumeSizeGB",
Expand All @@ -1431,7 +1436,6 @@
},
"documentation": "\n <p>Specifies the EBS volume upgrade information. The broker identifier must be set to the keyword ALL. This means the changes apply to all the brokers in the cluster.</p>\n ",
"required": [
"VolumeSizeGB",
"KafkaBrokerNodeId"
]
},
Expand Down Expand Up @@ -2667,6 +2671,11 @@
"EBSStorageInfo": {
"type": "structure",
"members": {
"ProvisionedThroughput" : {
"shape" : "ProvisionedThroughput",
"locationName" : "provisionedThroughput",
"documentation" : "EBS volume provisioned throughput information."
},
"VolumeSize": {
"shape": "__integerMin1Max16384",
"locationName": "volumeSize",
Expand Down Expand Up @@ -3422,6 +3431,22 @@
},
"documentation" : "\n <p>Prometheus settings.</p>\n "
},
"ProvisionedThroughput" : {
"type" : "structure",
"members" : {
"Enabled" : {
"shape" : "__boolean",
"locationName" : "enabled",
"documentation" : "Provisioned throughput is enabled or not."
},
"VolumeThroughput" : {
"shape" : "__integer",
"locationName" : "volumeThroughput",
"documentation" : "Throughput value of the EBS volumes for the data drive on each kafka broker node in MiB per second."
}
},
"documentation" : "Contains information about provisioned throughput for EBS storage volumes attached to kafka broker nodes."
},
"PublicAccess" : {
"type" : "structure",
"members" : {
Expand Down
18 changes: 17 additions & 1 deletion sdk/src/Services/Kafka/Generated/Model/BrokerEBSVolumeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace Amazon.Kafka.Model
public partial class BrokerEBSVolumeInfo
{
private string _kafkaBrokerNodeId;
private ProvisionedThroughput _provisionedThroughput;
private int? _volumeSizeGB;

/// <summary>
Expand All @@ -56,13 +57,28 @@ internal bool IsSetKafkaBrokerNodeId()
return this._kafkaBrokerNodeId != null;
}

/// <summary>
/// Gets and sets the property ProvisionedThroughput. EBS volume provisioned throughput
/// information.
/// </summary>
public ProvisionedThroughput ProvisionedThroughput
{
get { return this._provisionedThroughput; }
set { this._provisionedThroughput = value; }
}

// Check to see if ProvisionedThroughput property is set
internal bool IsSetProvisionedThroughput()
{
return this._provisionedThroughput != null;
}

/// <summary>
/// Gets and sets the property VolumeSizeGB.
/// <para>
/// Size of the EBS volume to update.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public int VolumeSizeGB
{
get { return this._volumeSizeGB.GetValueOrDefault(); }
Expand Down
17 changes: 17 additions & 0 deletions sdk/src/Services/Kafka/Generated/Model/EBSStorageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,25 @@ namespace Amazon.Kafka.Model
/// </summary>
public partial class EBSStorageInfo
{
private ProvisionedThroughput _provisionedThroughput;
private int? _volumeSize;

/// <summary>
/// Gets and sets the property ProvisionedThroughput. EBS volume provisioned throughput
/// information.
/// </summary>
public ProvisionedThroughput ProvisionedThroughput
{
get { return this._provisionedThroughput; }
set { this._provisionedThroughput = value; }
}

// Check to see if ProvisionedThroughput property is set
internal bool IsSetProvisionedThroughput()
{
return this._provisionedThroughput != null;
}

/// <summary>
/// Gets and sets the property VolumeSize.
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ public void Marshall(BrokerEBSVolumeInfo requestObject, JsonMarshallerContext co
context.Writer.Write(requestObject.KafkaBrokerNodeId);
}

if(requestObject.IsSetProvisionedThroughput())
{
context.Writer.WritePropertyName("provisionedThroughput");
context.Writer.WriteObjectStart();

var marshaller = ProvisionedThroughputMarshaller.Instance;
marshaller.Marshall(requestObject.ProvisionedThroughput, context);

context.Writer.WriteObjectEnd();
}

if(requestObject.IsSetVolumeSizeGB())
{
context.Writer.WritePropertyName("volumeSizeGB");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public BrokerEBSVolumeInfo Unmarshall(JsonUnmarshallerContext context)
unmarshalledObject.KafkaBrokerNodeId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("provisionedThroughput", targetDepth))
{
var unmarshaller = ProvisionedThroughputUnmarshaller.Instance;
unmarshalledObject.ProvisionedThroughput = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("volumeSizeGB", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ public class EBSStorageInfoMarshaller : IRequestMarshaller<EBSStorageInfo, JsonM
/// <returns></returns>
public void Marshall(EBSStorageInfo requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetProvisionedThroughput())
{
context.Writer.WritePropertyName("provisionedThroughput");
context.Writer.WriteObjectStart();

var marshaller = ProvisionedThroughputMarshaller.Instance;
marshaller.Marshall(requestObject.ProvisionedThroughput, context);

context.Writer.WriteObjectEnd();
}

if(requestObject.IsSetVolumeSize())
{
context.Writer.WritePropertyName("volumeSize");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public EBSStorageInfo Unmarshall(JsonUnmarshallerContext context)
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("provisionedThroughput", targetDepth))
{
var unmarshaller = ProvisionedThroughputUnmarshaller.Instance;
unmarshalledObject.ProvisionedThroughput = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("volumeSize", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

/*
* Do not modify this file. This file is generated from the kafka-2018-11-14.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;

using Amazon.Kafka.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.Kafka.Model.Internal.MarshallTransformations
{
/// <summary>
/// ProvisionedThroughput Marshaller
/// </summary>
public class ProvisionedThroughputMarshaller : IRequestMarshaller<ProvisionedThroughput, JsonMarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="requestObject"></param>
/// <param name="context"></param>
/// <returns></returns>
public void Marshall(ProvisionedThroughput requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetEnabled())
{
context.Writer.WritePropertyName("enabled");
context.Writer.Write(requestObject.Enabled);
}

if(requestObject.IsSetVolumeThroughput())
{
context.Writer.WritePropertyName("volumeThroughput");
context.Writer.Write(requestObject.VolumeThroughput);
}

}

/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static ProvisionedThroughputMarshaller Instance = new ProvisionedThroughputMarshaller();

}
}
Loading

0 comments on commit b2f2d1d

Please sign in to comment.