Skip to content

Commit

Permalink
Add CosmosDB RP API Version 2024-08-15 (Azure#25800)
Browse files Browse the repository at this point in the history
* update CosmosDB SDK

* add custom property to include missing property and update cmdlet

* Revert "add custom property to include missing property and update cmdlet"

This reverts commit cb49e52.

* update service to use SqlDedicatedGatewayServiceResourceCreateUpdateProperties

* Correct change for CosmosDB Services

* Fixed logic to check for deleted account instance

* Introduce new parameter  to restore command

* add test recordings

---------

Co-authored-by: Praful Johari <pjohari@microsoft.com>
Co-authored-by: Kshittiz Kumar <kshkumar@microsoft.com>
Co-authored-by: Min Ho Kang <minhokang@microsoft.com>
  • Loading branch information
4 people committed Sep 15, 2024
1 parent 8f83bd3 commit d7338d0
Show file tree
Hide file tree
Showing 98 changed files with 264,404 additions and 76,053 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ private void Initialize()
this.RestorableTableResources = new RestorableTableResourcesOperations(this);
this.Service = new ServiceOperations(this);
this.BaseUri = new System.Uri("https://management.azure.com");
this.ApiVersion = "2023-11-15";
this.ApiVersion = "2024-08-15";
this.AcceptLanguage = "en-US";
this.LongRunningOperationRetryTimeout = 30;
this.GenerateClientRequestId = true;
Expand Down Expand Up @@ -515,6 +515,8 @@ private void Initialize()
DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter<BackupPolicy>("type"));
SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter<ServiceResourceProperties>("serviceType"));
DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter<ServiceResourceProperties>("serviceType"));
SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter<ServiceResourceCreateUpdateProperties>("serviceType"));
DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter<ServiceResourceCreateUpdateProperties>("serviceType"));
CustomInitialize();
DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter());
DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public ApiProperties()
/// Initializes a new instance of the ApiProperties class.
/// </summary>

/// <param name="serverVersion">Describes the ServerVersion of an a MongoDB account.
/// Possible values include: &#39;3.2&#39;, &#39;3.6&#39;, &#39;4.0&#39;, &#39;4.2&#39;</param>
/// <param name="serverVersion">Describes the version of the MongoDB account.
/// Possible values include: &#39;3.2&#39;, &#39;3.6&#39;, &#39;4.0&#39;, &#39;4.2&#39;, &#39;5.0&#39;, &#39;6.0&#39;, &#39;7.0&#39;</param>
public ApiProperties(string serverVersion = default(string))

{
Expand All @@ -37,7 +37,7 @@ public ApiProperties()


/// <summary>
/// Gets or sets describes the ServerVersion of an a MongoDB account. Possible values include: &#39;3.2&#39;, &#39;3.6&#39;, &#39;4.0&#39;, &#39;4.2&#39;
/// Gets or sets describes the version of the MongoDB account. Possible values include: &#39;3.2&#39;, &#39;3.6&#39;, &#39;4.0&#39;, &#39;4.2&#39;, &#39;5.0&#39;, &#39;6.0&#39;, &#39;7.0&#39;
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "serverVersion")]
public string ServerVersion {get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

namespace Microsoft.Azure.Management.CosmosDB.Models
{

/// <summary>
/// Defines values for AzureConnectionType.
/// </summary>


public static class AzureConnectionType
{
public const string None = "None";
public const string VPN = "VPN";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ public ClusterResourceProperties()

/// <param name="provisionError">Error related to resource provisioning.
/// </param>
public ClusterResourceProperties(string provisioningState = default(string), string restoreFromBackupId = default(string), string delegatedManagementSubnetId = default(string), string cassandraVersion = default(string), string clusterNameOverride = default(string), string authenticationMethod = default(string), string initialCassandraAdminPassword = default(string), SeedNode prometheusEndpoint = default(SeedNode), bool? repairEnabled = default(bool?), System.Collections.Generic.IList<Certificate> clientCertificates = default(System.Collections.Generic.IList<Certificate>), System.Collections.Generic.IList<Certificate> externalGossipCertificates = default(System.Collections.Generic.IList<Certificate>), System.Collections.Generic.IList<Certificate> gossipCertificates = default(System.Collections.Generic.IList<Certificate>), System.Collections.Generic.IList<SeedNode> externalSeedNodes = default(System.Collections.Generic.IList<SeedNode>), System.Collections.Generic.IList<SeedNode> seedNodes = default(System.Collections.Generic.IList<SeedNode>), int? hoursBetweenBackups = default(int?), bool? deallocated = default(bool?), bool? cassandraAuditLoggingEnabled = default(bool?), CassandraError provisionError = default(CassandraError))

/// <param name="azureConnectionMethod">How to connect to the azure services needed for running the cluster
/// Possible values include: &#39;None&#39;, &#39;VPN&#39;</param>

/// <param name="privateLinkResourceId">If the Connection Method is VPN, this is the Id of the private link
/// resource that the datacenters need to connect to.
/// </param>
public ClusterResourceProperties(string provisioningState = default(string), string restoreFromBackupId = default(string), string delegatedManagementSubnetId = default(string), string cassandraVersion = default(string), string clusterNameOverride = default(string), string authenticationMethod = default(string), string initialCassandraAdminPassword = default(string), SeedNode prometheusEndpoint = default(SeedNode), bool? repairEnabled = default(bool?), System.Collections.Generic.IList<Certificate> clientCertificates = default(System.Collections.Generic.IList<Certificate>), System.Collections.Generic.IList<Certificate> externalGossipCertificates = default(System.Collections.Generic.IList<Certificate>), System.Collections.Generic.IList<Certificate> gossipCertificates = default(System.Collections.Generic.IList<Certificate>), System.Collections.Generic.IList<SeedNode> externalSeedNodes = default(System.Collections.Generic.IList<SeedNode>), System.Collections.Generic.IList<SeedNode> seedNodes = default(System.Collections.Generic.IList<SeedNode>), int? hoursBetweenBackups = default(int?), bool? deallocated = default(bool?), bool? cassandraAuditLoggingEnabled = default(bool?), CassandraError provisionError = default(CassandraError), string azureConnectionMethod = default(string), string privateLinkResourceId = default(string))

{
this.ProvisioningState = provisioningState;
Expand All @@ -128,6 +135,8 @@ public ClusterResourceProperties()
this.Deallocated = deallocated;
this.CassandraAuditLoggingEnabled = cassandraAuditLoggingEnabled;
this.ProvisionError = provisionError;
this.AzureConnectionMethod = azureConnectionMethod;
this.PrivateLinkResourceId = privateLinkResourceId;
CustomInit();
}

Expand Down Expand Up @@ -279,5 +288,19 @@ public ClusterResourceProperties()
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "provisionError")]
public CassandraError ProvisionError {get; set; }

/// <summary>
/// Gets or sets how to connect to the azure services needed for running the
/// cluster Possible values include: &#39;None&#39;, &#39;VPN&#39;
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "azureConnectionMethod")]
public string AzureConnectionMethod {get; set; }

/// <summary>
/// Gets if the Connection Method is VPN, this is the Id of the private link
/// resource that the datacenters need to connect to.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkResourceId")]
public string PrivateLinkResourceId {get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ public DataCenterResourceProperties()

/// <param name="provisionError">Error related to resource provisioning.
/// </param>
public DataCenterResourceProperties(string provisioningState = default(string), string dataCenterLocation = default(string), string delegatedSubnetId = default(string), int? nodeCount = default(int?), System.Collections.Generic.IList<SeedNode> seedNodes = default(System.Collections.Generic.IList<SeedNode>), string base64EncodedCassandraYamlFragment = default(string), string managedDiskCustomerKeyUri = default(string), string backupStorageCustomerKeyUri = default(string), string sku = default(string), string diskSku = default(string), int? diskCapacity = default(int?), bool? availabilityZone = default(bool?), AuthenticationMethodLdapProperties authenticationMethodLdapProperties = default(AuthenticationMethodLdapProperties), bool? deallocated = default(bool?), CassandraError provisionError = default(CassandraError))

/// <param name="privateEndpointIPAddress">Ip of the VPN Endpoint for this data center.
/// </param>
public DataCenterResourceProperties(string provisioningState = default(string), string dataCenterLocation = default(string), string delegatedSubnetId = default(string), int? nodeCount = default(int?), System.Collections.Generic.IList<SeedNode> seedNodes = default(System.Collections.Generic.IList<SeedNode>), string base64EncodedCassandraYamlFragment = default(string), string managedDiskCustomerKeyUri = default(string), string backupStorageCustomerKeyUri = default(string), string sku = default(string), string diskSku = default(string), int? diskCapacity = default(int?), bool? availabilityZone = default(bool?), AuthenticationMethodLdapProperties authenticationMethodLdapProperties = default(AuthenticationMethodLdapProperties), bool? deallocated = default(bool?), CassandraError provisionError = default(CassandraError), string privateEndpointIPAddress = default(string))

{
this.ProvisioningState = provisioningState;
Expand All @@ -106,6 +109,7 @@ public DataCenterResourceProperties()
this.AuthenticationMethodLdapProperties = authenticationMethodLdapProperties;
this.Deallocated = deallocated;
this.ProvisionError = provisionError;
this.PrivateEndpointIPAddress = privateEndpointIPAddress;
CustomInit();
}

Expand Down Expand Up @@ -227,5 +231,11 @@ public DataCenterResourceProperties()
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "provisionError")]
public CassandraError ProvisionError {get; set; }

/// <summary>
/// Gets or sets ip of the VPN Endpoint for this data center.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointIpAddress")]
public string PrivateEndpointIPAddress {get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

namespace Microsoft.Azure.Management.CosmosDB.Models
{
using System.Linq;

/// <summary>
/// Properties for Create or Update request for DataTransferServiceResource
/// </summary>
[Newtonsoft.Json.JsonObject("DataTransfer")]
public partial class DataTransferServiceResourceCreateUpdateProperties : ServiceResourceCreateUpdateProperties
{
/// <summary>
/// Initializes a new instance of the DataTransferServiceResourceCreateUpdateProperties class.
/// </summary>
public DataTransferServiceResourceCreateUpdateProperties()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the DataTransferServiceResourceCreateUpdateProperties class.
/// </summary>

/// <param name="instanceSize">Instance type for the service.
/// Possible values include: &#39;Cosmos.D4s&#39;, &#39;Cosmos.D8s&#39;, &#39;Cosmos.D16s&#39;</param>

/// <param name="instanceCount">Instance count for the service.
/// </param>
public DataTransferServiceResourceCreateUpdateProperties(string instanceSize = default(string), int? instanceCount = default(int?))

: base(instanceSize, instanceCount)
{
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown if validation fails
/// </exception>
public override void Validate()
{
base.Validate();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ public DatabaseAccountCreateUpdateParameters()
/// Cassandra and Mongo APIs only work with Tls 1.2.
/// Possible values include: &#39;Tls&#39;, &#39;Tls11&#39;, &#39;Tls12&#39;</param>

/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity Preview feature on
/// the account
/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity feature on the
/// account
/// </param>

/// <param name="customerManagedKeyStatus">Indicates the status of the Customer Managed Key feature on the account. In
Expand Down Expand Up @@ -422,8 +422,8 @@ static DatabaseAccountCreateUpdateParameters()
public string MinimalTlsVersion {get; set; }

/// <summary>
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview
/// feature on the account
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature
/// on the account
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")]
public bool? EnableBurstCapacity {get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public DatabaseAccountCreateUpdateProperties()
/// Cassandra and Mongo APIs only work with Tls 1.2.
/// Possible values include: &#39;Tls&#39;, &#39;Tls11&#39;, &#39;Tls12&#39;</param>

/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity Preview feature on
/// the account
/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity feature on the
/// account
/// </param>

/// <param name="customerManagedKeyStatus">Indicates the status of the Customer Managed Key feature on the account. In
Expand Down Expand Up @@ -377,8 +377,8 @@ static DatabaseAccountCreateUpdateProperties()
public string MinimalTlsVersion {get; set; }

/// <summary>
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview
/// feature on the account
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature
/// on the account
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")]
public bool? EnableBurstCapacity {get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public DatabaseAccountGetProperties()
/// Cassandra and Mongo APIs only work with Tls 1.2.
/// Possible values include: &#39;Tls&#39;, &#39;Tls11&#39;, &#39;Tls12&#39;</param>

/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity Preview feature on
/// the account
/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity feature on the
/// account
/// </param>

/// <param name="customerManagedKeyStatus">Indicates the status of the Customer Managed Key feature on the account. In
Expand Down Expand Up @@ -466,8 +466,8 @@ public DatabaseAccountGetProperties()
public string MinimalTlsVersion {get; set; }

/// <summary>
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview
/// feature on the account
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature
/// on the account
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")]
public bool? EnableBurstCapacity {get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public DatabaseAccountGetResults()
/// Cassandra and Mongo APIs only work with Tls 1.2.
/// Possible values include: &#39;Tls&#39;, &#39;Tls11&#39;, &#39;Tls12&#39;</param>

/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity Preview feature on
/// the account
/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity feature on the
/// account
/// </param>

/// <param name="customerManagedKeyStatus">Indicates the status of the Customer Managed Key feature on the account. In
Expand Down Expand Up @@ -521,8 +521,8 @@ public DatabaseAccountGetResults()
public string MinimalTlsVersion {get; set; }

/// <summary>
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview
/// feature on the account
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature
/// on the account
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")]
public bool? EnableBurstCapacity {get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ public DatabaseAccountUpdateParameters()
/// Cassandra and Mongo APIs only work with Tls 1.2.
/// Possible values include: &#39;Tls&#39;, &#39;Tls11&#39;, &#39;Tls12&#39;</param>

/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity Preview feature on
/// the account
/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity feature on the
/// account
/// </param>

/// <param name="customerManagedKeyStatus">Indicates the status of the Customer Managed Key feature on the account. In
Expand Down Expand Up @@ -395,8 +395,8 @@ public DatabaseAccountUpdateParameters()
public string MinimalTlsVersion {get; set; }

/// <summary>
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview
/// feature on the account
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature
/// on the account
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")]
public bool? EnableBurstCapacity {get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public DatabaseAccountUpdateProperties()
/// Cassandra and Mongo APIs only work with Tls 1.2.
/// Possible values include: &#39;Tls&#39;, &#39;Tls11&#39;, &#39;Tls12&#39;</param>

/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity Preview feature on
/// the account
/// <param name="enableBurstCapacity">Flag to indicate enabling/disabling of Burst Capacity feature on the
/// account
/// </param>

/// <param name="customerManagedKeyStatus">Indicates the status of the Customer Managed Key feature on the account. In
Expand Down Expand Up @@ -350,8 +350,8 @@ public DatabaseAccountUpdateProperties()
public string MinimalTlsVersion {get; set; }

/// <summary>
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview
/// feature on the account
/// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature
/// on the account
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")]
public bool? EnableBurstCapacity {get; set; }
Expand Down
Loading

0 comments on commit d7338d0

Please sign in to comment.