Skip to content
1 change: 1 addition & 0 deletions src/CosmosDB/CosmosDB/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

## Upcoming Release
* Introduced NetworkAclBypass and NetworkAclBypassResourceIds for Database Account cmdlets.
* Introduced ServerVersion option to Update-AzCosmosDBAccount.

## Version 1.0.0
* General availability of 'Az.CosmosDB' module
Expand Down
4 changes: 0 additions & 4 deletions src/CosmosDB/CosmosDB/CosmosDBAccount/NewAzCosmosDBAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public class NewAzCosmosDBAccount : NewOrUpdateAzCosmosDBAccount
[Parameter(Mandatory = false, HelpMessage = Constants.EnableFreeTierHelpMessage)]
public bool? EnableFreeTier { get; set; }

[Parameter(Mandatory = false, HelpMessage = Constants.ServerVersionHelpMessage)]
[PSArgumentCompleter(SDKModel.ServerVersion.ThreeFullStopTwo, SDKModel.ServerVersion.ThreeFullStopSix)]
public string ServerVersion { get; set; }

[Parameter(Mandatory = false, HelpMessage = Constants.LocationHelpMessage)]
[ValidateNotNullOrEmpty]
public string[] Location { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public class NewOrUpdateAzCosmosDBAccount : AzureCosmosDBCmdletBase
[ValidateNotNullOrEmpty]
public string[] NetworkAclBypassResourceId { get; set; }

[Parameter(Mandatory = false, HelpMessage = Constants.ServerVersionHelpMessage)]
[PSArgumentCompleter(SDKModel.ServerVersion.ThreeFullStopTwo, SDKModel.ServerVersion.ThreeFullStopSix, SDKModel.ServerVersion.FourFullStopZero)]
public string ServerVersion { get; set; }

public ConsistencyPolicy PopoulateConsistencyPolicy(string DefaultConsistencyLevel, int? MaxStalenessIntervalInSeconds, int? MaxStalenessPrefix)
{
ConsistencyPolicy consistencyPolicy = new ConsistencyPolicy();
Expand Down
10 changes: 10 additions & 0 deletions src/CosmosDB/CosmosDB/CosmosDBAccount/UpdateAzCosmosDBAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ public override void ExecuteCmdlet()
databaseAccountUpdateParameters.IpRules = base.PopulateIpRules(IpRule);
}

if (ServerVersion != null)
{
if (databaseAccountUpdateParameters.ApiProperties == null)
{
databaseAccountUpdateParameters.ApiProperties = new ApiProperties();
}

databaseAccountUpdateParameters.ApiProperties.ServerVersion = ServerVersion;
}

if (NetworkAclBypassResourceId != null)
{
Collection<string> networkAclBypassResourceId = new Collection<string>(NetworkAclBypassResourceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public PSApiProperties(ApiProperties apiProperties)
//
// Summary:
// Gets or sets describes the ServerVersion of an a MongoDB account. Possible values
// include: '3.2', '3.6'
// include: '3.2', '3.6', '4.0'
public string ServerVersion { get; set; }
}
}