Skip to content

Commit

Permalink
AWS MSK support for Broker Removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sdk-dotnet-automation committed May 16, 2024
1 parent c2d3772 commit 1d348a4
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 0 deletions.
23 changes: 23 additions & 0 deletions generator/ServiceModels/kafka/kafka-2018-11-14.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,19 @@
}
}
},
"BrokerCountUpdateInfo" : {
"type" : "structure",
"members" : {
"CreatedBrokerIds" : {
"shape" : "__listOf__double",
"locationName" : "createdBrokerIds"
},
"DeletedBrokerIds" : {
"shape" : "__listOf__double",
"locationName" : "deletedBrokerIds"
}
}
},
"ConsumerGroupReplication": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -4306,6 +4319,10 @@
"StorageMode" : {
"shape" : "StorageMode",
"locationName" : "storageMode"
},
"BrokerCountUpdateInfo" : {
"shape": "BrokerCountUpdateInfo",
"locationName" : "brokerCountUpdateInfo"
}
}
},
Expand Down Expand Up @@ -5609,6 +5626,12 @@
"shape" : "UnprocessedScramSecret"
}
},
"__listOf__double" : {
"type" : "list",
"member" : {
"shape" : "__double"
}
},
"__listOf__string": {
"type": "list",
"member": {
Expand Down
13 changes: 13 additions & 0 deletions generator/ServiceModels/kafka/kafka-2018-11-14.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@
"UpdateConnectivityRequest$ConnectivityInfo" : "<p>Information about the broker access configuration.</p>"
}
},
"BrokerCountUpdateInfo" : {
"base" : "<p>Describes brokers being changed during a broker count update.</p>",
"refs" : {
"MutableClusterInfo$BrokerCountUpdateInfo" : "<p>Describes brokers being changed during a broker count update.</p>"
}
},
"ConsumerGroupReplication" : {
"base" : "<p>Details about consumer group replication.</p>",
"refs" : {
Expand Down Expand Up @@ -1197,6 +1203,13 @@
"BatchDisassociateScramSecretResponse$UnprocessedScramSecrets" : "<p>List of errors when disassociating secrets to cluster.</p>"
}
},
"__listOf__double" : {
"base" : null,
"refs" : {
"BrokerCountUpdateInfo$CreatedBrokerIds" : "<p>List of Broker Ids when creating new Brokers in a cluster.</p>",
"BrokerCountUpdateInfo$DeletedBrokerIds" : "<p>List of Broker Ids when deleting existing Brokers in a cluster.</p>"
}
},
"__listOf__string" : {
"base" : null,
"refs" : {
Expand Down
27 changes: 27 additions & 0 deletions generator/ServiceModels/kafka/kafka-2018-11-14.normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,22 @@
"DEFAULT"
]
},
"BrokerCountUpdateInfo" : {
"type" : "structure",
"members" : {
"CreatedBrokerIds" : {
"shape" : "__listOf__double",
"locationName" : "createdBrokerIds",
"documentation": "\n <p>Kafka Broker IDs of brokers being created.</p>\n "
},
"DeletedBrokerIds" : {
"shape" : "__listOf__double",
"locationName" : "deletedBrokerIds",
"documentation": "\n <p>Kafka Broker IDs of brokers being deleted.</p>\n "
}
},
"documentation": "\n <p>Information regarding UpdateBrokerCount.</p>\n "
},
"BrokerEBSVolumeInfo": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -5030,6 +5046,11 @@
"shape" : "StorageMode",
"locationName" : "storageMode",
"documentation" : "\n <p>This controls storage mode for supported storage tiers.</p>\n "
},
"BrokerCountUpdateInfo" : {
"shape": "BrokerCountUpdateInfo",
"locationName" : "brokerCountUpdateInfo",
"documentation" : "\n <p>Describes brokers being changed during a broker count update.</p>\n "
}
},
"documentation": "\n <p>Information about cluster attributes that can be updated via update APIs.</p>\n "
Expand Down Expand Up @@ -6591,6 +6612,12 @@
"shape" : "UnprocessedScramSecret"
}
},
"__listOf__double" : {
"type" : "list",
"member" : {
"shape" : "__double"
}
},
"__listOf__string": {
"type": "list",
"member": {
Expand Down
77 changes: 77 additions & 0 deletions sdk/src/Services/Kafka/Generated/Model/BrokerCountUpdateInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* 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.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

#pragma warning disable CS0612,CS0618,CS1570
namespace Amazon.Kafka.Model
{
/// <summary>
/// Information regarding UpdateBrokerCount.
/// </summary>
public partial class BrokerCountUpdateInfo
{
private List<double> _createdBrokerIds = AWSConfigs.InitializeCollections ? new List<double>() : null;
private List<double> _deletedBrokerIds = AWSConfigs.InitializeCollections ? new List<double>() : null;

/// <summary>
/// Gets and sets the property CreatedBrokerIds.
/// <para>
/// Kafka Broker IDs of brokers being created.
/// </para>
/// </summary>
public List<double> CreatedBrokerIds
{
get { return this._createdBrokerIds; }
set { this._createdBrokerIds = value; }
}

// Check to see if CreatedBrokerIds property is set
internal bool IsSetCreatedBrokerIds()
{
return this._createdBrokerIds != null && (this._createdBrokerIds.Count > 0 || !AWSConfigs.InitializeCollections);
}

/// <summary>
/// Gets and sets the property DeletedBrokerIds.
/// <para>
/// Kafka Broker IDs of brokers being deleted.
/// </para>
/// </summary>
public List<double> DeletedBrokerIds
{
get { return this._deletedBrokerIds; }
set { this._deletedBrokerIds = value; }
}

// Check to see if DeletedBrokerIds property is set
internal bool IsSetDeletedBrokerIds()
{
return this._deletedBrokerIds != null && (this._deletedBrokerIds.Count > 0 || !AWSConfigs.InitializeCollections);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* 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.Net;
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;

#pragma warning disable CS0612,CS0618
namespace Amazon.Kafka.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for BrokerCountUpdateInfo Object
/// </summary>
public class BrokerCountUpdateInfoUnmarshaller : IUnmarshaller<BrokerCountUpdateInfo, XmlUnmarshallerContext>, IUnmarshaller<BrokerCountUpdateInfo, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
BrokerCountUpdateInfo IUnmarshaller<BrokerCountUpdateInfo, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}

/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns>The unmarshalled object</returns>
public BrokerCountUpdateInfo Unmarshall(JsonUnmarshallerContext context)
{
BrokerCountUpdateInfo unmarshalledObject = new BrokerCountUpdateInfo();
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;

int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("createdBrokerIds", targetDepth))
{
var unmarshaller = new ListUnmarshaller<double, DoubleUnmarshaller>(DoubleUnmarshaller.Instance);
unmarshalledObject.CreatedBrokerIds = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("deletedBrokerIds", targetDepth))
{
var unmarshaller = new ListUnmarshaller<double, DoubleUnmarshaller>(DoubleUnmarshaller.Instance);
unmarshalledObject.DeletedBrokerIds = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}


private static BrokerCountUpdateInfoUnmarshaller _instance = new BrokerCountUpdateInfoUnmarshaller();

/// <summary>
/// Gets the singleton.
/// </summary>
public static BrokerCountUpdateInfoUnmarshaller Instance
{
get
{
return _instance;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public MutableClusterInfo Unmarshall(JsonUnmarshallerContext context)
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("brokerCountUpdateInfo", targetDepth))
{
var unmarshaller = BrokerCountUpdateInfoUnmarshaller.Instance;
unmarshalledObject.BrokerCountUpdateInfo = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("brokerEBSVolumeInfo", targetDepth))
{
var unmarshaller = new ListUnmarshaller<BrokerEBSVolumeInfo, BrokerEBSVolumeInfoUnmarshaller>(BrokerEBSVolumeInfoUnmarshaller.Instance);
Expand Down
19 changes: 19 additions & 0 deletions sdk/src/Services/Kafka/Generated/Model/MutableClusterInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Amazon.Kafka.Model
/// </summary>
public partial class MutableClusterInfo
{
private BrokerCountUpdateInfo _brokerCountUpdateInfo;
private List<BrokerEBSVolumeInfo> _brokerEBSVolumeInfo = AWSConfigs.InitializeCollections ? new List<BrokerEBSVolumeInfo>() : null;
private ClientAuthentication _clientAuthentication;
private ConfigurationInfo _configurationInfo;
Expand All @@ -47,6 +48,24 @@ public partial class MutableClusterInfo
private OpenMonitoring _openMonitoring;
private StorageMode _storageMode;

/// <summary>
/// Gets and sets the property BrokerCountUpdateInfo.
/// <para>
/// Describes brokers being changed during a broker count update.
/// </para>
/// </summary>
public BrokerCountUpdateInfo BrokerCountUpdateInfo
{
get { return this._brokerCountUpdateInfo; }
set { this._brokerCountUpdateInfo = value; }
}

// Check to see if BrokerCountUpdateInfo property is set
internal bool IsSetBrokerCountUpdateInfo()
{
return this._brokerCountUpdateInfo != null;
}

/// <summary>
/// Gets and sets the property BrokerEBSVolumeInfo.
/// <para>
Expand Down

0 comments on commit 1d348a4

Please sign in to comment.