///<summary>/// Modify the specified integer parameters with new values from user input.///</summary>///<param name="groupName">The group name for the parameters.</param>///<param name="parameters">The list of integer parameters to modify.</param>///<param name="newValue">Optional int value to set for parameters.</param>///<returns>The name of the group that was modified.</returns>publicasync Task<string> ModifyIntegerParametersInGroupAsync(string groupName, List<Parameter> parameters, int newValue = 0){foreach (var p in parameters)
{if (p.IsModifiable && p.DataType == "integer")
{while (newValue == 0)
{
Console.WriteLine(
$"Enter a new value for {p.ParameterName} from the allowed values {p.AllowedValues} ");
var choice = Console.ReadLine();
int.TryParse(choice, out newValue);
}
p.ParameterValue = newValue.ToString();
}
}
var request = new ModifyDBClusterParameterGroupRequest
{
Parameters = parameters,
DBClusterParameterGroupName = groupName,
};
var result = await _amazonRDS.ModifyDBClusterParameterGroupAsync(request);
return result.DBClusterParameterGroupName;
}
classAuroraWrapper:"""Encapsulates Aurora DB cluster actions."""def__init__(self, rds_client):"""
:param rds_client: A Boto3 Amazon Relational Database Service (Amazon RDS) client.
"""
self.rds_client = rds_client
@classmethoddeffrom_client(cls):"""
Instantiates this class from a Boto3 client.
"""
rds_client = boto3.client("rds")
return cls(rds_client)
defupdate_parameters(self, parameter_group_name, update_parameters):"""
Updates parameters in a custom DB cluster parameter group.
:param parameter_group_name: The name of the parameter group to update.
:param update_parameters: The parameters to update in the group.
:return: Data about the modified parameter group.
"""try:
response = self.rds_client.modify_db_cluster_parameter_group(
DBClusterParameterGroupName=parameter_group_name,
Parameters=update_parameters,
)
except ClientError as err:
logger.error(
"Couldn't update parameters in %s. Here's why: %s: %s",
parameter_group_name,
err.response["Error"]["Code"],
err.response["Error"]["Message"],
)
raiseelse:
return response
///<summary>/// Modify the specified integer parameters with new values from user input.///</summary>///<param name="groupName">The group name for the parameters.</param>///<param name="parameters">The list of integer parameters to modify.</param>///<param name="newValue">Optional int value to set for parameters.</param>///<returns>The name of the group that was modified.</returns>publicasync Task<string> ModifyIntegerParametersInGroupAsync(string groupName, List<Parameter> parameters, int newValue = 0){foreach (var p in parameters)
{if (p.IsModifiable && p.DataType == "integer")
{while (newValue == 0)
{
Console.WriteLine(
$"Enter a new value for {p.ParameterName} from the allowed values {p.AllowedValues} ");
var choice = Console.ReadLine();
int.TryParse(choice, out newValue);
}
p.ParameterValue = newValue.ToString();
}
}
var request = new ModifyDBClusterParameterGroupRequest
{
Parameters = parameters,
DBClusterParameterGroupName = groupName,
};
var result = await _amazonRDS.ModifyDBClusterParameterGroupAsync(request);
return result.DBClusterParameterGroupName;
}