Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4003,7 +4003,7 @@ internal DatabasesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 201 && (int)_statusCode != 202)
if ((int)_statusCode != 200 && (int)_statusCode != 202)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: Swagger change was Azure/azure-rest-api-specs#1166

{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
Expand Down Expand Up @@ -4046,7 +4046,7 @@ internal DatabasesOperations(SqlManagementClient client)
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 201)
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
Expand Down
1,809 changes: 1,809 additions & 0 deletions src/SDKs/SqlManagement/Management.Sql/Generated/FailoverGroupsOperations.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,10 @@ public partial interface ISqlManagementClient : System.IDisposable
/// </summary>
IRecommendedElasticPoolsOperations RecommendedElasticPools { get; }

/// <summary>
/// Gets the IFailoverGroupsOperations.
/// </summary>
IFailoverGroupsOperations FailoverGroups { get; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public Database()
/// encryption info for this database.</param>
/// <param name="recommendedIndex">The recommended indices for this
/// database.</param>
/// <param name="failoverGroupId">The id indicating the failover group
/// containing this database.</param>
/// <param name="failoverGroupId">The resource identifier of the
/// failover group containing this database.</param>
/// <param name="readScale">Conditional. If the database is a
/// geo-secondary, readScale indicates whether read-only connections
/// are allowed to this database or not. Not supported for
Expand All @@ -182,7 +182,7 @@ public Database()
/// apply when creating this database. If createMode is not Default,
/// this value is ignored. Not supported for DataWarehouse edition.
/// Possible values include: 'AdventureWorksLT'</param>
public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string kind = default(string), string collation = default(string), System.DateTime? creationDate = default(System.DateTime?), long? containmentState = default(long?), System.Guid? currentServiceObjectiveId = default(System.Guid?), System.Guid? databaseId = default(System.Guid?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string createMode = default(string), string sourceDatabaseId = default(string), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), System.DateTime? restorePointInTime = default(System.DateTime?), string recoveryServicesRecoveryPointResourceId = default(string), string edition = default(string), string maxSizeBytes = default(string), System.Guid? requestedServiceObjectiveId = default(System.Guid?), string requestedServiceObjectiveName = default(string), string serviceLevelObjective = default(string), string status = default(string), string elasticPoolName = default(string), string defaultSecondaryLocation = default(string), IList<ServiceTierAdvisor> serviceTierAdvisors = default(IList<ServiceTierAdvisor>), IList<TransparentDataEncryption> transparentDataEncryption = default(IList<TransparentDataEncryption>), IList<RecommendedIndex> recommendedIndex = default(IList<RecommendedIndex>), System.Guid? failoverGroupId = default(System.Guid?), ReadScale? readScale = default(ReadScale?), string sampleName = default(string))
public Database(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string kind = default(string), string collation = default(string), System.DateTime? creationDate = default(System.DateTime?), long? containmentState = default(long?), System.Guid? currentServiceObjectiveId = default(System.Guid?), System.Guid? databaseId = default(System.Guid?), System.DateTime? earliestRestoreDate = default(System.DateTime?), string createMode = default(string), string sourceDatabaseId = default(string), System.DateTime? sourceDatabaseDeletionDate = default(System.DateTime?), System.DateTime? restorePointInTime = default(System.DateTime?), string recoveryServicesRecoveryPointResourceId = default(string), string edition = default(string), string maxSizeBytes = default(string), System.Guid? requestedServiceObjectiveId = default(System.Guid?), string requestedServiceObjectiveName = default(string), string serviceLevelObjective = default(string), string status = default(string), string elasticPoolName = default(string), string defaultSecondaryLocation = default(string), IList<ServiceTierAdvisor> serviceTierAdvisors = default(IList<ServiceTierAdvisor>), IList<TransparentDataEncryption> transparentDataEncryption = default(IList<TransparentDataEncryption>), IList<RecommendedIndex> recommendedIndex = default(IList<RecommendedIndex>), string failoverGroupId = default(string), ReadScale? readScale = default(ReadScale?), string sampleName = default(string))
: base(location, id, name, type, tags)
{
Kind = kind;
Expand Down Expand Up @@ -453,10 +453,11 @@ public Database()
public IList<RecommendedIndex> RecommendedIndex { get; private set; }

/// <summary>
/// Gets the id indicating the failover group containing this database.
/// Gets the resource identifier of the failover group containing this
/// database.
/// </summary>
[JsonProperty(PropertyName = "properties.failoverGroupId")]
public System.Guid? FailoverGroupId { get; private set; }
public string FailoverGroupId { get; private set; }

/// <summary>
/// Gets or sets conditional. If the database is a geo-secondary,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Sql;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// A failover group.
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class FailoverGroup : ProxyResource
{
/// <summary>
/// Initializes a new instance of the FailoverGroup class.
/// </summary>
public FailoverGroup()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the FailoverGroup class.
/// </summary>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type.</param>
/// <param name="location">Resource location.</param>
/// <param name="tags">Resource tags.</param>
/// <param name="readWriteEndpoint">Read-write endpoint of the failover
/// group instance.</param>
/// <param name="readOnlyEndpoint">Read-only endpoint of the failover
/// group instance.</param>
/// <param name="replicationRole">Local replication role of the
/// failover group instance. Possible values include: 'Primary',
/// 'Secondary'</param>
/// <param name="replicationState">Replication state of the failover
/// group instance.</param>
/// <param name="partnerServers">List of partner server information for
/// the failover group.</param>
/// <param name="databases">List of databases in the failover
/// group.</param>
public FailoverGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), FailoverGroupReadWriteEndpoint readWriteEndpoint = default(FailoverGroupReadWriteEndpoint), FailoverGroupReadOnlyEndpoint readOnlyEndpoint = default(FailoverGroupReadOnlyEndpoint), string replicationRole = default(string), string replicationState = default(string), IList<PartnerInfo> partnerServers = default(IList<PartnerInfo>), IList<string> databases = default(IList<string>))
: base(id, name, type)
{
Location = location;
Tags = tags;
ReadWriteEndpoint = readWriteEndpoint;
ReadOnlyEndpoint = readOnlyEndpoint;
ReplicationRole = replicationRole;
ReplicationState = replicationState;
PartnerServers = partnerServers;
Databases = databases;
CustomInit();
}

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

/// <summary>
/// Gets resource location.
/// </summary>
[JsonProperty(PropertyName = "location")]
public string Location { get; private set; }

/// <summary>
/// Gets or sets resource tags.
/// </summary>
[JsonProperty(PropertyName = "tags")]
public IDictionary<string, string> Tags { get; set; }

/// <summary>
/// Gets or sets read-write endpoint of the failover group instance.
/// </summary>
[JsonProperty(PropertyName = "properties.readWriteEndpoint")]
public FailoverGroupReadWriteEndpoint ReadWriteEndpoint { get; set; }

/// <summary>
/// Gets or sets read-only endpoint of the failover group instance.
/// </summary>
[JsonProperty(PropertyName = "properties.readOnlyEndpoint")]
public FailoverGroupReadOnlyEndpoint ReadOnlyEndpoint { get; set; }

/// <summary>
/// Gets local replication role of the failover group instance.
/// Possible values include: 'Primary', 'Secondary'
/// </summary>
[JsonProperty(PropertyName = "properties.replicationRole")]
public string ReplicationRole { get; private set; }

/// <summary>
/// Gets replication state of the failover group instance.
/// </summary>
[JsonProperty(PropertyName = "properties.replicationState")]
public string ReplicationState { get; private set; }

/// <summary>
/// Gets or sets list of partner server information for the failover
/// group.
/// </summary>
[JsonProperty(PropertyName = "properties.partnerServers")]
public IList<PartnerInfo> PartnerServers { get; set; }

/// <summary>
/// Gets or sets list of databases in the failover group.
/// </summary>
[JsonProperty(PropertyName = "properties.databases")]
public IList<string> Databases { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Sql;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Read-only endpoint of the failover group instance.
/// </summary>
public partial class FailoverGroupReadOnlyEndpoint
{
/// <summary>
/// Initializes a new instance of the FailoverGroupReadOnlyEndpoint
/// class.
/// </summary>
public FailoverGroupReadOnlyEndpoint()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the FailoverGroupReadOnlyEndpoint
/// class.
/// </summary>
/// <param name="failoverPolicy">Failover policy of the read-only
/// endpoint for the failover group. Possible values include:
/// 'Disabled', 'Enabled'</param>
public FailoverGroupReadOnlyEndpoint(string failoverPolicy = default(string))
{
FailoverPolicy = failoverPolicy;
CustomInit();
}

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

/// <summary>
/// Gets or sets failover policy of the read-only endpoint for the
/// failover group. Possible values include: 'Disabled', 'Enabled'
/// </summary>
[JsonProperty(PropertyName = "failoverPolicy")]
public string FailoverPolicy { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Sql;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Read-write endpoint of the failover group instance.
/// </summary>
public partial class FailoverGroupReadWriteEndpoint
{
/// <summary>
/// Initializes a new instance of the FailoverGroupReadWriteEndpoint
/// class.
/// </summary>
public FailoverGroupReadWriteEndpoint()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the FailoverGroupReadWriteEndpoint
/// class.
/// </summary>
/// <param name="failoverPolicy">Failover policy of the read-write
/// endpoint for the failover group. Possible values include: 'Manual',
/// 'Automatic'</param>
/// <param name="failoverWithDataLossGracePeriodMinutes">Grace period
/// before failover with data loss is attempted for the read-write
/// endpoint.</param>
public FailoverGroupReadWriteEndpoint(string failoverPolicy = default(string), int? failoverWithDataLossGracePeriodMinutes = default(int?))
{
FailoverPolicy = failoverPolicy;
FailoverWithDataLossGracePeriodMinutes = failoverWithDataLossGracePeriodMinutes;
CustomInit();
}

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

/// <summary>
/// Gets or sets failover policy of the read-write endpoint for the
/// failover group. Possible values include: 'Manual', 'Automatic'
/// </summary>
[JsonProperty(PropertyName = "failoverPolicy")]
public string FailoverPolicy { get; set; }

/// <summary>
/// Gets or sets grace period before failover with data loss is
/// attempted for the read-write endpoint.
/// </summary>
[JsonProperty(PropertyName = "failoverWithDataLossGracePeriodMinutes")]
public int? FailoverWithDataLossGracePeriodMinutes { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Sql;

/// <summary>
/// Defines values for FailoverGroupReplicationRole.
/// </summary>
public static class FailoverGroupReplicationRole
{
public const string Primary = "Primary";
public const string Secondary = "Secondary";
}
}
54 changes: 54 additions & 0 deletions src/SDKs/SqlManagement/Management.Sql/Generated/Models/Page1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Sql;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;

/// <summary>
/// Defines a page in Azure responses.
/// </summary>
/// <typeparam name="T">Type of the page content items</typeparam>
[JsonObject]
public class Page1<T> : IPage<T>
{
/// <summary>
/// Gets the link to the next page.
/// </summary>
[JsonProperty("nextLink")]
public string NextPageLink { get; private set; }

[JsonProperty("value")]
private IList<T> Items{ get; set; }

/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>A an enumerator that can be used to iterate through the collection.</returns>
public IEnumerator<T> GetEnumerator()
{
return Items == null ? System.Linq.Enumerable.Empty<T>().GetEnumerator() : Items.GetEnumerator();
}

/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>A an enumerator that can be used to iterate through the collection.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
Loading