Skip to content

Commit afb2e14

Browse files
AWS ElastiCache SDK now supports using MemcachedUpgradeConfig parameter with ModifyCacheCluster API to enable updating Memcached cache node types. Please refer to updated AWS ElastiCache public documentation for detailed information on API usage and implementation.
1 parent c5efa06 commit afb2e14

File tree

9 files changed

+285
-6
lines changed

9 files changed

+285
-6
lines changed

generator/ServiceModels/elasticache/elasticache-2015-02-02.api.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,8 @@
35443544
"AuthToken":{"shape":"String"},
35453545
"AuthTokenUpdateStrategy":{"shape":"AuthTokenUpdateStrategyType"},
35463546
"LogDeliveryConfigurations":{"shape":"LogDeliveryConfigurationRequestList"},
3547-
"IpDiscovery":{"shape":"IpDiscovery"}
3547+
"IpDiscovery":{"shape":"IpDiscovery"},
3548+
"ScaleConfig":{"shape":"ScaleConfig"}
35483549
}
35493550
},
35503551
"ModifyCacheClusterResult":{
@@ -4026,7 +4027,8 @@
40264027
"AuthTokenStatus":{"shape":"AuthTokenUpdateStatus"},
40274028
"LogDeliveryConfigurations":{"shape":"PendingLogDeliveryConfigurationList"},
40284029
"TransitEncryptionEnabled":{"shape":"BooleanOptional"},
4029-
"TransitEncryptionMode":{"shape":"TransitEncryptionMode"}
4030+
"TransitEncryptionMode":{"shape":"TransitEncryptionMode"},
4031+
"ScaleConfig":{"shape":"ScaleConfig"}
40304032
}
40314033
},
40324034
"PreferredAvailabilityZoneList":{
@@ -4441,6 +4443,13 @@
44414443
"CacheSecurityGroup":{"shape":"CacheSecurityGroup"}
44424444
}
44434445
},
4446+
"ScaleConfig":{
4447+
"type":"structure",
4448+
"members":{
4449+
"ScalePercentage":{"shape":"IntegerOptional"},
4450+
"ScaleIntervalMinutes":{"shape":"IntegerOptional"}
4451+
}
4452+
},
44444453
"SecurityGroupIdsList":{
44454454
"type":"list",
44464455
"member":{

generator/ServiceModels/elasticache/elasticache-2015-02-02.docs.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,8 @@
13171317
"PendingModifiedValues$NumCacheNodes": "<p>The new number of cache nodes for the cluster.</p> <p>For clusters running Valkey or Redis OSS, this value must be 1. For clusters running Memcached, this value must be between 1 and 40.</p>",
13181318
"PurchaseReservedCacheNodesOfferingMessage$CacheNodeCount": "<p>The number of cache node instances to reserve.</p> <p>Default: <code>1</code> </p>",
13191319
"ReplicationGroup$SnapshotRetentionLimit": "<p>The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For example, if you set <code>SnapshotRetentionLimit</code> to 5, a snapshot that was taken today is retained for 5 days before being deleted.</p> <important> <p> If the value of <code>SnapshotRetentionLimit</code> is set to zero (0), backups are turned off.</p> </important>",
1320+
"ScaleConfig$ScalePercentage": "<p>The percentage by which to scale the Memcached cluster, either horizontally by adding nodes or vertically by increasing resources.</p>",
1321+
"ScaleConfig$ScaleIntervalMinutes": "<p>The time interval in seconds between scaling operations when performing gradual scaling for a Memcached cluster.</p>",
13201322
"ServerlessCache$SnapshotRetentionLimit": "<p>The current setting for the number of serverless cache snapshots the system will retain. Available for Valkey, Redis OSS and Serverless Memcached only.</p>",
13211323
"Snapshot$NumCacheNodes": "<p>The number of cache nodes in the source cluster.</p> <p>For clusters running Valkey or Redis OSS, this value must be 1. For clusters running Memcached, this value must be between 1 and 40.</p>",
13221324
"Snapshot$Port": "<p>The port number used by each cache nodes in the source cluster.</p>",
@@ -2054,6 +2056,13 @@
20542056
"refs": {
20552057
}
20562058
},
2059+
"ScaleConfig": {
2060+
"base": "<p>Configuration settings for horizontal or vertical scaling operations on Memcached clusters.</p>",
2061+
"refs": {
2062+
"ModifyCacheClusterMessage$ScaleConfig": "<p>Configures horizontal or vertical scaling for Memcached clusters, specifying the scaling percentage and interval.</p>",
2063+
"PendingModifiedValues$ScaleConfig": "<p>The scaling configuration changes that are pending for the Memcached cluster.</p>"
2064+
}
2065+
},
20572066
"SecurityGroupIdsList": {
20582067
"base": null,
20592068
"refs": {
@@ -2531,7 +2540,7 @@
25312540
"ModifyCacheClusterMessage$NotificationTopicArn": "<p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications are sent.</p> <note> <p>The Amazon SNS topic owner must be same as the cluster owner.</p> </note>",
25322541
"ModifyCacheClusterMessage$CacheParameterGroupName": "<p>The name of the cache parameter group to apply to this cluster. This change is asynchronously applied as soon as possible for parameters when the <code>ApplyImmediately</code> parameter is specified as <code>true</code> for this request.</p>",
25332542
"ModifyCacheClusterMessage$NotificationTopicStatus": "<p>The status of the Amazon SNS notification topic. Notifications are sent only if the status is <code>active</code>.</p> <p>Valid values: <code>active</code> | <code>inactive</code> </p>",
2534-
"ModifyCacheClusterMessage$Engine": "<p>Modifies the engine listed in a cluster message. The options are redis, memcached or valkey.</p>",
2543+
"ModifyCacheClusterMessage$Engine": "<p>The engine type used by the cache cluster. The options are valkey, memcached or redis.</p>",
25352544
"ModifyCacheClusterMessage$EngineVersion": "<p>The upgraded version of the cache engine to be run on the cache nodes.</p> <p> <b>Important:</b> You can upgrade to a newer engine version (see <a href=\"https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement\">Selecting a Cache Engine and Version</a>), but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing cluster and create it anew with the earlier engine version. </p>",
25362545
"ModifyCacheClusterMessage$SnapshotWindow": "<p>The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your cluster. </p>",
25372546
"ModifyCacheClusterMessage$CacheNodeType": "<p>A valid cache node type that you want to scale this cluster up to.</p>",

generator/ServiceModels/elasticache/elasticache-2015-02-02.normal.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5167,7 +5167,7 @@
51675167
},
51685168
"Engine":{
51695169
"shape":"String",
5170-
"documentation":"<p>Modifies the engine listed in a cluster message. The options are redis, memcached or valkey.</p>"
5170+
"documentation":"<p>The engine type used by the cache cluster. The options are valkey, memcached or redis.</p>"
51715171
},
51725172
"EngineVersion":{
51735173
"shape":"String",
@@ -5204,6 +5204,10 @@
52045204
"IpDiscovery":{
52055205
"shape":"IpDiscovery",
52065206
"documentation":"<p>The network type you choose when modifying a cluster, either <code>ipv4</code> | <code>ipv6</code>. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the <a href=\"http://aws.amazon.com/ec2/nitro/\">Nitro system</a>.</p>"
5207+
},
5208+
"ScaleConfig":{
5209+
"shape":"ScaleConfig",
5210+
"documentation":"<p>Configures horizontal or vertical scaling for Memcached clusters, specifying the scaling percentage and interval.</p>"
52075211
}
52085212
},
52095213
"documentation":"<p>Represents the input of a <code>ModifyCacheCluster</code> operation.</p>"
@@ -6103,6 +6107,10 @@
61036107
"TransitEncryptionMode":{
61046108
"shape":"TransitEncryptionMode",
61056109
"documentation":"<p>A setting that allows you to migrate your clients to use in-transit encryption, with no downtime.</p>"
6110+
},
6111+
"ScaleConfig":{
6112+
"shape":"ScaleConfig",
6113+
"documentation":"<p>The scaling configuration changes that are pending for the Memcached cluster.</p>"
61066114
}
61076115
},
61086116
"documentation":"<p>A group of settings that are applied to the cluster in the future, or that are currently being applied.</p>"
@@ -6832,6 +6840,20 @@
68326840
"CacheSecurityGroup":{"shape":"CacheSecurityGroup"}
68336841
}
68346842
},
6843+
"ScaleConfig":{
6844+
"type":"structure",
6845+
"members":{
6846+
"ScalePercentage":{
6847+
"shape":"IntegerOptional",
6848+
"documentation":"<p>The percentage by which to scale the Memcached cluster, either horizontally by adding nodes or vertically by increasing resources.</p>"
6849+
},
6850+
"ScaleIntervalMinutes":{
6851+
"shape":"IntegerOptional",
6852+
"documentation":"<p>The time interval in seconds between scaling operations when performing gradual scaling for a Memcached cluster.</p>"
6853+
}
6854+
},
6855+
"documentation":"<p>Configuration settings for horizontal or vertical scaling operations on Memcached clusters.</p>"
6856+
},
68356857
"SecurityGroupIdsList":{
68366858
"type":"list",
68376859
"member":{

sdk/src/Services/ElastiCache/Generated/Model/Internal/MarshallTransformations/ModifyCacheClusterRequestMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ public IRequest Marshall(ModifyCacheClusterRequest publicRequest)
187187
{
188188
request.Parameters.Add("PreferredMaintenanceWindow", StringUtils.FromString(publicRequest.PreferredMaintenanceWindow));
189189
}
190+
if(publicRequest.IsSetScaleConfig())
191+
{
192+
if(publicRequest.ScaleConfig.IsSetScaleIntervalMinutes())
193+
{
194+
request.Parameters.Add("ScaleConfig" + "." + "ScaleIntervalMinutes", StringUtils.FromInt(publicRequest.ScaleConfig.ScaleIntervalMinutes));
195+
}
196+
if(publicRequest.ScaleConfig.IsSetScalePercentage())
197+
{
198+
request.Parameters.Add("ScaleConfig" + "." + "ScalePercentage", StringUtils.FromInt(publicRequest.ScaleConfig.ScalePercentage));
199+
}
200+
}
190201
if(publicRequest.IsSetSecurityGroupIds())
191202
{
192203
int publicRequestlistValueIndex = 1;

sdk/src/Services/ElastiCache/Generated/Model/Internal/MarshallTransformations/PendingModifiedValuesUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public PendingModifiedValues Unmarshall(XmlUnmarshallerContext context)
101101
unmarshalledObject.NumCacheNodes = unmarshaller.Unmarshall(context);
102102
continue;
103103
}
104+
if (context.TestExpression("ScaleConfig", targetDepth))
105+
{
106+
var unmarshaller = ScaleConfigUnmarshaller.Instance;
107+
unmarshalledObject.ScaleConfig = unmarshaller.Unmarshall(context);
108+
continue;
109+
}
104110
if (context.TestExpression("TransitEncryptionEnabled", targetDepth))
105111
{
106112
var unmarshaller = BoolUnmarshaller.Instance;
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the elasticache-2015-02-02.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Net;
24+
using System.Text;
25+
using System.Xml.Serialization;
26+
27+
using Amazon.ElastiCache.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
#pragma warning disable CS0612,CS0618
33+
namespace Amazon.ElastiCache.Model.Internal.MarshallTransformations
34+
{
35+
/// <summary>
36+
/// Response Unmarshaller for ScaleConfig Object
37+
/// </summary>
38+
public class ScaleConfigUnmarshaller : IUnmarshaller<ScaleConfig, XmlUnmarshallerContext>, IUnmarshaller<ScaleConfig, JsonUnmarshallerContext>
39+
{
40+
/// <summary>
41+
/// Unmarshaller the response from the service to the response class.
42+
/// </summary>
43+
/// <param name="context"></param>
44+
/// <returns></returns>
45+
public ScaleConfig Unmarshall(XmlUnmarshallerContext context)
46+
{
47+
ScaleConfig unmarshalledObject = new ScaleConfig();
48+
int originalDepth = context.CurrentDepth;
49+
int targetDepth = originalDepth + 1;
50+
51+
if (context.IsStartOfDocument)
52+
targetDepth += 2;
53+
54+
while (context.ReadAtDepth(originalDepth))
55+
{
56+
if (context.IsStartElement || context.IsAttribute)
57+
{
58+
if (context.TestExpression("ScaleIntervalMinutes", targetDepth))
59+
{
60+
var unmarshaller = IntUnmarshaller.Instance;
61+
unmarshalledObject.ScaleIntervalMinutes = unmarshaller.Unmarshall(context);
62+
continue;
63+
}
64+
if (context.TestExpression("ScalePercentage", targetDepth))
65+
{
66+
var unmarshaller = IntUnmarshaller.Instance;
67+
unmarshalledObject.ScalePercentage = unmarshaller.Unmarshall(context);
68+
continue;
69+
}
70+
}
71+
else if (context.IsEndElement && context.CurrentDepth < originalDepth)
72+
{
73+
return unmarshalledObject;
74+
}
75+
}
76+
77+
return unmarshalledObject;
78+
}
79+
80+
/// <summary>
81+
/// Unmarshaller error response to exception.
82+
/// </summary>
83+
/// <param name="context"></param>
84+
/// <returns></returns>
85+
public ScaleConfig Unmarshall(JsonUnmarshallerContext context)
86+
{
87+
return null;
88+
}
89+
90+
91+
private static ScaleConfigUnmarshaller _instance = new ScaleConfigUnmarshaller();
92+
93+
/// <summary>
94+
/// Gets the singleton.
95+
/// </summary>
96+
public static ScaleConfigUnmarshaller Instance
97+
{
98+
get
99+
{
100+
return _instance;
101+
}
102+
}
103+
}
104+
}

sdk/src/Services/ElastiCache/Generated/Model/ModifyCacheClusterRequest.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public partial class ModifyCacheClusterRequest : AmazonElastiCacheRequest
5555
private string _notificationTopicStatus;
5656
private int? _numCacheNodes;
5757
private string _preferredMaintenanceWindow;
58+
private ScaleConfig _scaleConfig;
5859
private List<string> _securityGroupIds = AWSConfigs.InitializeCollections ? new List<string>() : null;
5960
private int? _snapshotRetentionLimit;
6061
private string _snapshotWindow;
@@ -358,8 +359,7 @@ internal bool IsSetCacheSecurityGroupNames()
358359
/// <summary>
359360
/// Gets and sets the property Engine.
360361
/// <para>
361-
/// Modifies the engine listed in a cluster message. The options are redis, memcached
362-
/// or valkey.
362+
/// The engine type used by the cache cluster. The options are valkey, memcached or redis.
363363
/// </para>
364364
/// </summary>
365365
public string Engine
@@ -734,6 +734,25 @@ internal bool IsSetPreferredMaintenanceWindow()
734734
return this._preferredMaintenanceWindow != null;
735735
}
736736

737+
/// <summary>
738+
/// Gets and sets the property ScaleConfig.
739+
/// <para>
740+
/// Configures horizontal or vertical scaling for Memcached clusters, specifying the scaling
741+
/// percentage and interval.
742+
/// </para>
743+
/// </summary>
744+
public ScaleConfig ScaleConfig
745+
{
746+
get { return this._scaleConfig; }
747+
set { this._scaleConfig = value; }
748+
}
749+
750+
// Check to see if ScaleConfig property is set
751+
internal bool IsSetScaleConfig()
752+
{
753+
return this._scaleConfig != null;
754+
}
755+
737756
/// <summary>
738757
/// Gets and sets the property SecurityGroupIds.
739758
/// <para>

sdk/src/Services/ElastiCache/Generated/Model/PendingModifiedValues.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public partial class PendingModifiedValues
4141
private string _engineVersion;
4242
private List<PendingLogDeliveryConfiguration> _logDeliveryConfigurations = AWSConfigs.InitializeCollections ? new List<PendingLogDeliveryConfiguration>() : null;
4343
private int? _numCacheNodes;
44+
private ScaleConfig _scaleConfig;
4445
private bool? _transitEncryptionEnabled;
4546
private TransitEncryptionMode _transitEncryptionMode;
4647

@@ -163,6 +164,24 @@ internal bool IsSetNumCacheNodes()
163164
return this._numCacheNodes.HasValue;
164165
}
165166

167+
/// <summary>
168+
/// Gets and sets the property ScaleConfig.
169+
/// <para>
170+
/// The scaling configuration changes that are pending for the Memcached cluster.
171+
/// </para>
172+
/// </summary>
173+
public ScaleConfig ScaleConfig
174+
{
175+
get { return this._scaleConfig; }
176+
set { this._scaleConfig = value; }
177+
}
178+
179+
// Check to see if ScaleConfig property is set
180+
internal bool IsSetScaleConfig()
181+
{
182+
return this._scaleConfig != null;
183+
}
184+
166185
/// <summary>
167186
/// Gets and sets the property TransitEncryptionEnabled.
168187
/// <para>

0 commit comments

Comments
 (0)