diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs index 1daf136f2c64..62e4aa90d0ac 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs @@ -226,6 +226,21 @@ public partial interface ISqlManagementClient : System.IDisposable /// IServerKeysOperations ServerKeys { get; } + /// + /// Gets the ISyncAgentsOperations. + /// + ISyncAgentsOperations SyncAgents { get; } + + /// + /// Gets the ISyncGroupsOperations. + /// + ISyncGroupsOperations SyncGroups { get; } + + /// + /// Gets the ISyncMembersOperations. + /// + ISyncMembersOperations SyncMembers { get; } + /// /// Gets the IVirtualNetworkRulesOperations. /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncAgentsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncAgentsOperations.cs new file mode 100644 index 000000000000..09e3ef4b7096 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncAgentsOperations.cs @@ -0,0 +1,308 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SyncAgentsOperations operations. + /// + public partial interface ISyncAgentsOperations + { + /// + /// Gets a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists sync agents in a server. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Generates a sync agent key. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GenerateKeyWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListLinkedDatabasesWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists sync agents in a server. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListLinkedDatabasesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncGroupsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncGroupsOperations.cs new file mode 100644 index 000000000000..7d654d5b25b9 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncGroupsOperations.cs @@ -0,0 +1,603 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SyncGroupsOperations operations. + /// + public partial interface ISyncGroupsOperations + { + /// + /// Gets a collection of sync database ids. + /// + /// + /// The name of the region where the resource is located. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListSyncDatabaseIdsWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes a hub database schema. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListHubSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a collection of sync group logs. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. Possible values include: 'All', + /// 'Error', 'Warning', 'Success' + /// + /// + /// The continuation token for this operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListLogsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Cancels a sync group synchronization. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CancelSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Triggers a sync group synchronization. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TriggerSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists sync groups under a hub database. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes a hub database schema. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a collection of sync database ids. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListSyncDatabaseIdsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListHubSchemasNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a collection of sync group logs. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListLogsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists sync groups under a hub database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncMembersOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncMembersOperations.cs new file mode 100644 index 000000000000..d56ab64cf9c2 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISyncMembersOperations.cs @@ -0,0 +1,464 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SyncMembersOperations operations. + /// + public partial interface ISyncMembersOperations + { + /// + /// Gets a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists sync members in the given sync group. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySyncGroupWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a sync member database schema. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListMemberSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes a sync member database schema. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing sync member. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes a sync member database schema. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists sync members in the given sync group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySyncGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a sync member database schema. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListMemberSchemasNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgent.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgent.cs new file mode 100644 index 000000000000..74f4e0054875 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgent.cs @@ -0,0 +1,114 @@ +// 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.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.Linq; + + /// + /// An Azure SQL Database sync agent. + /// + [Rest.Serialization.JsonTransformation] + public partial class SyncAgent : ProxyResource + { + /// + /// Initializes a new instance of the SyncAgent class. + /// + public SyncAgent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncAgent class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Name of the sync agent. + /// ARM resource id of the sync database + /// in the sync agent. + /// Last alive time of the sync + /// agent. + /// State of the sync agent. Possible values + /// include: 'Online', 'Offline', 'NeverConnected' + /// If the sync agent version is up to + /// date. + /// Expiration time of the sync agent + /// version. + /// Version of the sync agent. + public SyncAgent(string id = default(string), string name = default(string), string type = default(string), string syncAgentName = default(string), string syncDatabaseId = default(string), System.DateTime? lastAliveTime = default(System.DateTime?), string state = default(string), bool? isUpToDate = default(bool?), System.DateTime? expiryTime = default(System.DateTime?), string version = default(string)) + : base(id, name, type) + { + SyncAgentName = syncAgentName; + SyncDatabaseId = syncDatabaseId; + LastAliveTime = lastAliveTime; + State = state; + IsUpToDate = isUpToDate; + ExpiryTime = expiryTime; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the sync agent. + /// + [JsonProperty(PropertyName = "properties.name")] + public string SyncAgentName { get; private set; } + + /// + /// Gets or sets ARM resource id of the sync database in the sync + /// agent. + /// + [JsonProperty(PropertyName = "properties.syncDatabaseId")] + public string SyncDatabaseId { get; set; } + + /// + /// Gets last alive time of the sync agent. + /// + [JsonProperty(PropertyName = "properties.lastAliveTime")] + public System.DateTime? LastAliveTime { get; private set; } + + /// + /// Gets state of the sync agent. Possible values include: 'Online', + /// 'Offline', 'NeverConnected' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets if the sync agent version is up to date. + /// + [JsonProperty(PropertyName = "properties.isUpToDate")] + public bool? IsUpToDate { get; private set; } + + /// + /// Gets expiration time of the sync agent version. + /// + [JsonProperty(PropertyName = "properties.expiryTime")] + public System.DateTime? ExpiryTime { get; private set; } + + /// + /// Gets version of the sync agent. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentKeyProperties.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentKeyProperties.cs new file mode 100644 index 000000000000..6b2690b9f66d --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentKeyProperties.cs @@ -0,0 +1,52 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of an Azure SQL Database sync agent key. + /// + public partial class SyncAgentKeyProperties + { + /// + /// Initializes a new instance of the SyncAgentKeyProperties class. + /// + public SyncAgentKeyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncAgentKeyProperties class. + /// + /// Key of sync agent. + public SyncAgentKeyProperties(string syncAgentKey = default(string)) + { + SyncAgentKey = syncAgentKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets key of sync agent. + /// + [JsonProperty(PropertyName = "syncAgentKey")] + public string SyncAgentKey { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentLinkedDatabase.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentLinkedDatabase.cs new file mode 100644 index 000000000000..c27f5cd9d32b --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentLinkedDatabase.cs @@ -0,0 +1,107 @@ +// 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.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.Linq; + + /// + /// An Azure SQL Database sync agent linked database. + /// + [Rest.Serialization.JsonTransformation] + public partial class SyncAgentLinkedDatabase : ProxyResource + { + /// + /// Initializes a new instance of the SyncAgentLinkedDatabase class. + /// + public SyncAgentLinkedDatabase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncAgentLinkedDatabase class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Type of the sync agent linked database. + /// Possible values include: 'AzureSqlDatabase', + /// 'SqlServerDatabase' + /// Id of the sync agent linked + /// database. + /// Description of the sync agent linked + /// database. + /// Server name of the sync agent linked + /// database. + /// Database name of the sync agent linked + /// database. + /// User name of the sync agent linked + /// database. + public SyncAgentLinkedDatabase(string id = default(string), string name = default(string), string type = default(string), string databaseType = default(string), string databaseId = default(string), string description = default(string), string serverName = default(string), string databaseName = default(string), string userName = default(string)) + : base(id, name, type) + { + DatabaseType = databaseType; + DatabaseId = databaseId; + Description = description; + ServerName = serverName; + DatabaseName = databaseName; + UserName = userName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets type of the sync agent linked database. Possible values + /// include: 'AzureSqlDatabase', 'SqlServerDatabase' + /// + [JsonProperty(PropertyName = "properties.databaseType")] + public string DatabaseType { get; private set; } + + /// + /// Gets id of the sync agent linked database. + /// + [JsonProperty(PropertyName = "properties.databaseId")] + public string DatabaseId { get; private set; } + + /// + /// Gets description of the sync agent linked database. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets server name of the sync agent linked database. + /// + [JsonProperty(PropertyName = "properties.serverName")] + public string ServerName { get; private set; } + + /// + /// Gets database name of the sync agent linked database. + /// + [JsonProperty(PropertyName = "properties.databaseName")] + public string DatabaseName { get; private set; } + + /// + /// Gets user name of the sync agent linked database. + /// + [JsonProperty(PropertyName = "properties.userName")] + public string UserName { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentState.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentState.cs new file mode 100644 index 000000000000..d869a886a71a --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncAgentState.cs @@ -0,0 +1,24 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + + /// + /// Defines values for SyncAgentState. + /// + public static class SyncAgentState + { + public const string Online = "Online"; + public const string Offline = "Offline"; + public const string NeverConnected = "NeverConnected"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncConflictResolutionPolicy.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncConflictResolutionPolicy.cs new file mode 100644 index 000000000000..68a867dc3b07 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncConflictResolutionPolicy.cs @@ -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. +// 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; + + /// + /// Defines values for SyncConflictResolutionPolicy. + /// + public static class SyncConflictResolutionPolicy + { + public const string HubWin = "HubWin"; + public const string MemberWin = "MemberWin"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncDatabaseIdProperties.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncDatabaseIdProperties.cs new file mode 100644 index 000000000000..b721d7a9a050 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncDatabaseIdProperties.cs @@ -0,0 +1,52 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of the sync database id. + /// + public partial class SyncDatabaseIdProperties + { + /// + /// Initializes a new instance of the SyncDatabaseIdProperties class. + /// + public SyncDatabaseIdProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncDatabaseIdProperties class. + /// + /// ARM resource id of sync database. + public SyncDatabaseIdProperties(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets ARM resource id of sync database. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncDirection.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncDirection.cs new file mode 100644 index 000000000000..80a5c40e87d1 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncDirection.cs @@ -0,0 +1,24 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + + /// + /// Defines values for SyncDirection. + /// + public static class SyncDirection + { + public const string Bidirectional = "Bidirectional"; + public const string OneWayMemberToHub = "OneWayMemberToHub"; + public const string OneWayHubToMember = "OneWayHubToMember"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaProperties.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaProperties.cs new file mode 100644 index 000000000000..556488966f3f --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaProperties.cs @@ -0,0 +1,64 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of the database full schema. + /// + public partial class SyncFullSchemaProperties + { + /// + /// Initializes a new instance of the SyncFullSchemaProperties class. + /// + public SyncFullSchemaProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncFullSchemaProperties class. + /// + /// List of tables in the database full + /// schema. + /// Last update time of the database + /// schema. + public SyncFullSchemaProperties(IList tables = default(IList), System.DateTime? lastUpdateTime = default(System.DateTime?)) + { + Tables = tables; + LastUpdateTime = lastUpdateTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of tables in the database full schema. + /// + [JsonProperty(PropertyName = "tables")] + public IList Tables { get; private set; } + + /// + /// Gets last update time of the database schema. + /// + [JsonProperty(PropertyName = "lastUpdateTime")] + public System.DateTime? LastUpdateTime { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaTable.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaTable.cs new file mode 100644 index 000000000000..c44c662426de --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaTable.cs @@ -0,0 +1,87 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of the table in the database full schema. + /// + public partial class SyncFullSchemaTable + { + /// + /// Initializes a new instance of the SyncFullSchemaTable class. + /// + public SyncFullSchemaTable() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncFullSchemaTable class. + /// + /// List of columns in the table of database full + /// schema. + /// Error id of the table. + /// If there is error in the table. + /// Name of the table. + /// Quoted name of the table. + public SyncFullSchemaTable(IList columns = default(IList), string errorId = default(string), bool? hasError = default(bool?), string name = default(string), string quotedName = default(string)) + { + Columns = columns; + ErrorId = errorId; + HasError = hasError; + Name = name; + QuotedName = quotedName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of columns in the table of database full schema. + /// + [JsonProperty(PropertyName = "columns")] + public IList Columns { get; private set; } + + /// + /// Gets error id of the table. + /// + [JsonProperty(PropertyName = "errorId")] + public string ErrorId { get; private set; } + + /// + /// Gets if there is error in the table. + /// + [JsonProperty(PropertyName = "hasError")] + public bool? HasError { get; private set; } + + /// + /// Gets name of the table. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets quoted name of the table. + /// + [JsonProperty(PropertyName = "quotedName")] + public string QuotedName { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaTableColumn.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaTableColumn.cs new file mode 100644 index 000000000000..e994bd6797d9 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncFullSchemaTableColumn.cs @@ -0,0 +1,101 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of the column in the table of database full schema. + /// + public partial class SyncFullSchemaTableColumn + { + /// + /// Initializes a new instance of the SyncFullSchemaTableColumn class. + /// + public SyncFullSchemaTableColumn() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncFullSchemaTableColumn class. + /// + /// Data size of the column. + /// Data type of the column. + /// Error id of the column. + /// If there is error in the table. + /// If it is the primary key of the + /// table. + /// Name of the column. + /// Quoted name of the column. + public SyncFullSchemaTableColumn(string dataSize = default(string), string dataType = default(string), string errorId = default(string), bool? hasError = default(bool?), bool? isPrimaryKey = default(bool?), string name = default(string), string quotedName = default(string)) + { + DataSize = dataSize; + DataType = dataType; + ErrorId = errorId; + HasError = hasError; + IsPrimaryKey = isPrimaryKey; + Name = name; + QuotedName = quotedName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets data size of the column. + /// + [JsonProperty(PropertyName = "dataSize")] + public string DataSize { get; private set; } + + /// + /// Gets data type of the column. + /// + [JsonProperty(PropertyName = "dataType")] + public string DataType { get; private set; } + + /// + /// Gets error id of the column. + /// + [JsonProperty(PropertyName = "errorId")] + public string ErrorId { get; private set; } + + /// + /// Gets if there is error in the table. + /// + [JsonProperty(PropertyName = "hasError")] + public bool? HasError { get; private set; } + + /// + /// Gets if it is the primary key of the table. + /// + [JsonProperty(PropertyName = "isPrimaryKey")] + public bool? IsPrimaryKey { get; private set; } + + /// + /// Gets name of the column. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets quoted name of the column. + /// + [JsonProperty(PropertyName = "quotedName")] + public string QuotedName { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroup.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroup.cs new file mode 100644 index 000000000000..38573b406a49 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroup.cs @@ -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. +// 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.Linq; + + /// + /// An Azure SQL Database sync group. + /// + [Rest.Serialization.JsonTransformation] + public partial class SyncGroup : ProxyResource + { + /// + /// Initializes a new instance of the SyncGroup class. + /// + public SyncGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroup class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Sync interval of the sync group. + /// Last sync time of the sync + /// group. + /// Conflict resolution policy + /// of the sync group. Possible values include: 'HubWin', + /// 'MemberWin' + /// ARM resource id of the sync database + /// in the sync group. + /// User name for the sync group hub + /// database credential. + /// Password for the sync group hub + /// database credential. + /// Sync state of the sync group. Possible + /// values include: 'NotReady', 'Error', 'Warning', 'Progressing', + /// 'Good' + /// Sync schema of the sync group. + public SyncGroup(string id = default(string), string name = default(string), string type = default(string), int? interval = default(int?), System.DateTime? lastSyncTime = default(System.DateTime?), string conflictResolutionPolicy = default(string), string syncDatabaseId = default(string), string hubDatabaseUserName = default(string), string hubDatabasePassword = default(string), string syncState = default(string), SyncGroupSchema schema = default(SyncGroupSchema)) + : base(id, name, type) + { + Interval = interval; + LastSyncTime = lastSyncTime; + ConflictResolutionPolicy = conflictResolutionPolicy; + SyncDatabaseId = syncDatabaseId; + HubDatabaseUserName = hubDatabaseUserName; + HubDatabasePassword = hubDatabasePassword; + SyncState = syncState; + Schema = schema; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets sync interval of the sync group. + /// + [JsonProperty(PropertyName = "properties.interval")] + public int? Interval { get; set; } + + /// + /// Gets last sync time of the sync group. + /// + [JsonProperty(PropertyName = "properties.lastSyncTime")] + public System.DateTime? LastSyncTime { get; private set; } + + /// + /// Gets or sets conflict resolution policy of the sync group. Possible + /// values include: 'HubWin', 'MemberWin' + /// + [JsonProperty(PropertyName = "properties.conflictResolutionPolicy")] + public string ConflictResolutionPolicy { get; set; } + + /// + /// Gets or sets ARM resource id of the sync database in the sync + /// group. + /// + [JsonProperty(PropertyName = "properties.syncDatabaseId")] + public string SyncDatabaseId { get; set; } + + /// + /// Gets or sets user name for the sync group hub database credential. + /// + [JsonProperty(PropertyName = "properties.hubDatabaseUserName")] + public string HubDatabaseUserName { get; set; } + + /// + /// Gets or sets password for the sync group hub database credential. + /// + [JsonProperty(PropertyName = "properties.hubDatabasePassword")] + public string HubDatabasePassword { get; set; } + + /// + /// Gets sync state of the sync group. Possible values include: + /// 'NotReady', 'Error', 'Warning', 'Progressing', 'Good' + /// + [JsonProperty(PropertyName = "properties.syncState")] + public string SyncState { get; private set; } + + /// + /// Gets or sets sync schema of the sync group. + /// + [JsonProperty(PropertyName = "properties.schema")] + public SyncGroupSchema Schema { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupLogProperties.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupLogProperties.cs new file mode 100644 index 000000000000..5b055b618a05 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupLogProperties.cs @@ -0,0 +1,95 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of an Azure SQL Database sync group log. + /// + public partial class SyncGroupLogProperties + { + /// + /// Initializes a new instance of the SyncGroupLogProperties class. + /// + public SyncGroupLogProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupLogProperties class. + /// + /// Timestamp of the sync group log. + /// Type of the sync group log. Possible values + /// include: 'All', 'Error', 'Warning', 'Success' + /// Source of the sync group log. + /// Details of the sync group log. + /// TracingId of the sync group log. + /// OperationStatus of the sync group + /// log. + public SyncGroupLogProperties(System.DateTime? timestamp = default(System.DateTime?), string type = default(string), string source = default(string), string details = default(string), System.Guid? tracingId = default(System.Guid?), string operationStatus = default(string)) + { + Timestamp = timestamp; + Type = type; + Source = source; + Details = details; + TracingId = tracingId; + OperationStatus = operationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets timestamp of the sync group log. + /// + [JsonProperty(PropertyName = "timestamp")] + public System.DateTime? Timestamp { get; private set; } + + /// + /// Gets type of the sync group log. Possible values include: 'All', + /// 'Error', 'Warning', 'Success' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets source of the sync group log. + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; private set; } + + /// + /// Gets details of the sync group log. + /// + [JsonProperty(PropertyName = "details")] + public string Details { get; private set; } + + /// + /// Gets tracingId of the sync group log. + /// + [JsonProperty(PropertyName = "tracingId")] + public System.Guid? TracingId { get; private set; } + + /// + /// Gets operationStatus of the sync group log. + /// + [JsonProperty(PropertyName = "operationStatus")] + public string OperationStatus { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupLogType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupLogType.cs new file mode 100644 index 000000000000..23d120444dc7 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupLogType.cs @@ -0,0 +1,25 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + + /// + /// Defines values for SyncGroupLogType. + /// + public static class SyncGroupLogType + { + public const string All = "All"; + public const string Error = "Error"; + public const string Warning = "Warning"; + public const string Success = "Success"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchema.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchema.cs new file mode 100644 index 000000000000..c7abc0672856 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchema.cs @@ -0,0 +1,63 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of sync group schema. + /// + public partial class SyncGroupSchema + { + /// + /// Initializes a new instance of the SyncGroupSchema class. + /// + public SyncGroupSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupSchema class. + /// + /// List of tables in sync group schema. + /// Name of master sync member where + /// the schema is from. + public SyncGroupSchema(IList tables = default(IList), string masterSyncMemberName = default(string)) + { + Tables = tables; + MasterSyncMemberName = masterSyncMemberName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of tables in sync group schema. + /// + [JsonProperty(PropertyName = "tables")] + public IList Tables { get; set; } + + /// + /// Gets or sets name of master sync member where the schema is from. + /// + [JsonProperty(PropertyName = "masterSyncMemberName")] + public string MasterSyncMemberName { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchemaTable.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchemaTable.cs new file mode 100644 index 000000000000..db50f6fc1392 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchemaTable.cs @@ -0,0 +1,63 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of table in sync group schema. + /// + public partial class SyncGroupSchemaTable + { + /// + /// Initializes a new instance of the SyncGroupSchemaTable class. + /// + public SyncGroupSchemaTable() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupSchemaTable class. + /// + /// List of columns in sync group schema. + /// Quoted name of sync group schema + /// table. + public SyncGroupSchemaTable(IList columns = default(IList), string quotedName = default(string)) + { + Columns = columns; + QuotedName = quotedName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of columns in sync group schema. + /// + [JsonProperty(PropertyName = "columns")] + public IList Columns { get; set; } + + /// + /// Gets or sets quoted name of sync group schema table. + /// + [JsonProperty(PropertyName = "quotedName")] + public string QuotedName { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchemaTableColumn.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchemaTableColumn.cs new file mode 100644 index 000000000000..34abeb2d558b --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupSchemaTableColumn.cs @@ -0,0 +1,69 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of column in sync group table. + /// + public partial class SyncGroupSchemaTableColumn + { + /// + /// Initializes a new instance of the SyncGroupSchemaTableColumn class. + /// + public SyncGroupSchemaTableColumn() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncGroupSchemaTableColumn class. + /// + /// Quoted name of sync group table + /// column. + /// Data size of the column. + /// Data type of the column. + public SyncGroupSchemaTableColumn(string quotedName = default(string), string dataSize = default(string), string dataType = default(string)) + { + QuotedName = quotedName; + DataSize = dataSize; + DataType = dataType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets quoted name of sync group table column. + /// + [JsonProperty(PropertyName = "quotedName")] + public string QuotedName { get; set; } + + /// + /// Gets or sets data size of the column. + /// + [JsonProperty(PropertyName = "dataSize")] + public string DataSize { get; set; } + + /// + /// Gets or sets data type of the column. + /// + [JsonProperty(PropertyName = "dataType")] + public string DataType { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupState.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupState.cs new file mode 100644 index 000000000000..46c79f63d274 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncGroupState.cs @@ -0,0 +1,26 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + + /// + /// Defines values for SyncGroupState. + /// + public static class SyncGroupState + { + public const string NotReady = "NotReady"; + public const string Error = "Error"; + public const string Warning = "Warning"; + public const string Progressing = "Progressing"; + public const string Good = "Good"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMember.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMember.cs new file mode 100644 index 000000000000..59845dabb711 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMember.cs @@ -0,0 +1,148 @@ +// 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.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.Linq; + + /// + /// An Azure SQL Database sync member. + /// + [Rest.Serialization.JsonTransformation] + public partial class SyncMember : ProxyResource + { + /// + /// Initializes a new instance of the SyncMember class. + /// + public SyncMember() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SyncMember class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Database type of the sync member. + /// Possible values include: 'AzureSqlDatabase', + /// 'SqlServerDatabase' + /// ARM resource id of the sync agent in the + /// sync member. + /// SQL Server database id of the + /// sync member. + /// Server name of the member database in the + /// sync member + /// Database name of the member database in + /// the sync member. + /// User name of the member database in the sync + /// member. + /// Password of the member database in the sync + /// member. + /// Sync direction of the sync member. + /// Possible values include: 'Bidirectional', 'OneWayMemberToHub', + /// 'OneWayHubToMember' + /// Sync state of the sync member. Possible + /// values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', + /// 'DisabledTombstoneCleanup', 'DisabledBackupRestore', + /// 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', + /// 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', + /// 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', + /// 'Reprovisioning', 'ReprovisionFailed', 'UnReprovisioned' + public SyncMember(string id = default(string), string name = default(string), string type = default(string), string databaseType = default(string), string syncAgentId = default(string), System.Guid? sqlServerDatabaseId = default(System.Guid?), string serverName = default(string), string databaseName = default(string), string userName = default(string), string password = default(string), string syncDirection = default(string), string syncState = default(string)) + : base(id, name, type) + { + DatabaseType = databaseType; + SyncAgentId = syncAgentId; + SqlServerDatabaseId = sqlServerDatabaseId; + ServerName = serverName; + DatabaseName = databaseName; + UserName = userName; + Password = password; + SyncDirection = syncDirection; + SyncState = syncState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets database type of the sync member. Possible values + /// include: 'AzureSqlDatabase', 'SqlServerDatabase' + /// + [JsonProperty(PropertyName = "properties.databaseType")] + public string DatabaseType { get; set; } + + /// + /// Gets or sets ARM resource id of the sync agent in the sync member. + /// + [JsonProperty(PropertyName = "properties.syncAgentId")] + public string SyncAgentId { get; set; } + + /// + /// Gets or sets SQL Server database id of the sync member. + /// + [JsonProperty(PropertyName = "properties.sqlServerDatabaseId")] + public System.Guid? SqlServerDatabaseId { get; set; } + + /// + /// Gets or sets server name of the member database in the sync member + /// + [JsonProperty(PropertyName = "properties.serverName")] + public string ServerName { get; set; } + + /// + /// Gets or sets database name of the member database in the sync + /// member. + /// + [JsonProperty(PropertyName = "properties.databaseName")] + public string DatabaseName { get; set; } + + /// + /// Gets or sets user name of the member database in the sync member. + /// + [JsonProperty(PropertyName = "properties.userName")] + public string UserName { get; set; } + + /// + /// Gets or sets password of the member database in the sync member. + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; set; } + + /// + /// Gets or sets sync direction of the sync member. Possible values + /// include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' + /// + [JsonProperty(PropertyName = "properties.syncDirection")] + public string SyncDirection { get; set; } + + /// + /// Gets sync state of the sync member. Possible values include: + /// 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', + /// 'DisabledTombstoneCleanup', 'DisabledBackupRestore', + /// 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', + /// 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', + /// 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', + /// 'Reprovisioning', 'ReprovisionFailed', 'UnReprovisioned' + /// + [JsonProperty(PropertyName = "properties.syncState")] + public string SyncState { get; private set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMemberDbType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMemberDbType.cs new file mode 100644 index 000000000000..2b374432d035 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMemberDbType.cs @@ -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. +// 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; + + /// + /// Defines values for SyncMemberDbType. + /// + public static class SyncMemberDbType + { + public const string AzureSqlDatabase = "AzureSqlDatabase"; + public const string SqlServerDatabase = "SqlServerDatabase"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMemberState.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMemberState.cs new file mode 100644 index 000000000000..0de297c522f6 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SyncMemberState.cs @@ -0,0 +1,39 @@ +// 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.Sql.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Sql; + + /// + /// Defines values for SyncMemberState. + /// + public static class SyncMemberState + { + public const string SyncInProgress = "SyncInProgress"; + public const string SyncSucceeded = "SyncSucceeded"; + public const string SyncFailed = "SyncFailed"; + public const string DisabledTombstoneCleanup = "DisabledTombstoneCleanup"; + public const string DisabledBackupRestore = "DisabledBackupRestore"; + public const string SyncSucceededWithWarnings = "SyncSucceededWithWarnings"; + public const string SyncCancelling = "SyncCancelling"; + public const string SyncCancelled = "SyncCancelled"; + public const string UnProvisioned = "UnProvisioned"; + public const string Provisioning = "Provisioning"; + public const string Provisioned = "Provisioned"; + public const string ProvisionFailed = "ProvisionFailed"; + public const string DeProvisioning = "DeProvisioning"; + public const string DeProvisioned = "DeProvisioned"; + public const string DeProvisionFailed = "DeProvisionFailed"; + public const string Reprovisioning = "Reprovisioning"; + public const string ReprovisionFailed = "ReprovisionFailed"; + public const string UnReprovisioned = "UnReprovisioned"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs index 1baad3689eaa..4d56852dd328 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs @@ -231,6 +231,21 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IServerKeysOperations ServerKeys { get; private set; } + /// + /// Gets the ISyncAgentsOperations. + /// + public virtual ISyncAgentsOperations SyncAgents { get; private set; } + + /// + /// Gets the ISyncGroupsOperations. + /// + public virtual ISyncGroupsOperations SyncGroups { get; private set; } + + /// + /// Gets the ISyncMembersOperations. + /// + public virtual ISyncMembersOperations SyncMembers { get; private set; } + /// /// Gets the IVirtualNetworkRulesOperations. /// @@ -469,6 +484,9 @@ private void Initialize() EncryptionProtectors = new EncryptionProtectorsOperations(this); FailoverGroups = new FailoverGroupsOperations(this); ServerKeys = new ServerKeysOperations(this); + SyncAgents = new SyncAgentsOperations(this); + SyncGroups = new SyncGroupsOperations(this); + SyncMembers = new SyncMembersOperations(this); VirtualNetworkRules = new VirtualNetworkRulesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SyncAgentsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncAgentsOperations.cs new file mode 100644 index 000000000000..0d9dfc2c26eb --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncAgentsOperations.cs @@ -0,0 +1,1681 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SyncAgentsOperations operations. + /// + internal partial class SyncAgentsOperations : IServiceOperations, ISyncAgentsOperations + { + /// + /// Initializes a new instance of the SyncAgentsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SyncAgentsOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (syncAgentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncAgentName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("syncAgentName", syncAgentName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{syncAgentName}", System.Uri.EscapeDataString(syncAgentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists sync agents in a server. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Generates a sync agent key. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GenerateKeyWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (syncAgentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncAgentName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("syncAgentName", syncAgentName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GenerateKey", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{syncAgentName}", System.Uri.EscapeDataString(syncAgentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListLinkedDatabasesWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (syncAgentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncAgentName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("syncAgentName", syncAgentName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListLinkedDatabases", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{syncAgentName}", System.Uri.EscapeDataString(syncAgentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (syncAgentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncAgentName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("syncAgentName", syncAgentName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{syncAgentName}", System.Uri.EscapeDataString(syncAgentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a sync agent. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string syncAgentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (syncAgentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncAgentName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("syncAgentName", syncAgentName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{syncAgentName}", System.Uri.EscapeDataString(syncAgentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists sync agents in a server. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByServerNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListLinkedDatabasesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListLinkedDatabasesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SyncAgentsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncAgentsOperationsExtensions.cs new file mode 100644 index 000000000000..f4f4e5c4d6d9 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncAgentsOperationsExtensions.cs @@ -0,0 +1,477 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SyncAgentsOperations. + /// + public static partial class SyncAgentsOperationsExtensions + { + /// + /// Gets a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + public static SyncAgent Get(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName) + { + return operations.GetAsync(resourceGroupName, serverName, syncAgentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + public static SyncAgent CreateOrUpdate(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, syncAgentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + public static void Delete(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName) + { + operations.DeleteAsync(resourceGroupName, serverName, syncAgentName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists sync agents in a server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + public static IPage ListByServer(this ISyncAgentsOperations operations, string resourceGroupName, string serverName) + { + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + } + + /// + /// Lists sync agents in a server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByServerAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Generates a sync agent key. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + public static SyncAgentKeyProperties GenerateKey(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName) + { + return operations.GenerateKeyAsync(resourceGroupName, serverName, syncAgentName).GetAwaiter().GetResult(); + } + + /// + /// Generates a sync agent key. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The cancellation token. + /// + public static async Task GenerateKeyAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GenerateKeyWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + public static IPage ListLinkedDatabases(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName) + { + return operations.ListLinkedDatabasesAsync(resourceGroupName, serverName, syncAgentName).GetAwaiter().GetResult(); + } + + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The cancellation token. + /// + public static async Task> ListLinkedDatabasesAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListLinkedDatabasesWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + public static SyncAgent BeginCreateOrUpdate(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, syncAgentName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The requested sync agent resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, SyncAgent parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + public static void BeginDelete(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName) + { + operations.BeginDeleteAsync(resourceGroupName, serverName, syncAgentName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server on which the sync agent is hosted. + /// + /// + /// The name of the sync agent. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISyncAgentsOperations operations, string resourceGroupName, string serverName, string syncAgentName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, syncAgentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists sync agents in a server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByServerNext(this ISyncAgentsOperations operations, string nextPageLink) + { + return operations.ListByServerNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists sync agents in a server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByServerNextAsync(this ISyncAgentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByServerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListLinkedDatabasesNext(this ISyncAgentsOperations operations, string nextPageLink) + { + return operations.ListLinkedDatabasesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists databases linked to a sync agent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListLinkedDatabasesNextAsync(this ISyncAgentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListLinkedDatabasesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SyncGroupsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncGroupsOperations.cs new file mode 100644 index 000000000000..777e3c12f99d --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncGroupsOperations.cs @@ -0,0 +1,3181 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SyncGroupsOperations operations. + /// + internal partial class SyncGroupsOperations : IServiceOperations, ISyncGroupsOperations + { + /// + /// Initializes a new instance of the SyncGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SyncGroupsOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets a collection of sync database ids. + /// + /// + /// The name of the region where the resource is located. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListSyncDatabaseIdsWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncDatabaseIds", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds").ToString(); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Refreshes a hub database schema. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListHubSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListHubSchemas", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a collection of sync group logs. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. Possible values include: 'All', 'Error', + /// 'Warning', 'Success' + /// + /// + /// The continuation token for this operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListLogsWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (startTime == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "startTime"); + } + if (endTime == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "endTime"); + } + if (type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "type"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("startTime", startTime); + tracingParameters.Add("endTime", endTime); + tracingParameters.Add("type", type); + tracingParameters.Add("continuationToken", continuationToken); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListLogs", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (startTime != null) + { + _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(startTime))); + } + if (endTime != null) + { + _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(endTime))); + } + if (type != null) + { + _queryParameters.Add(string.Format("type={0}", System.Uri.EscapeDataString(type))); + } + if (continuationToken != null) + { + _queryParameters.Add(string.Format("continuationToken={0}", System.Uri.EscapeDataString(continuationToken))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Cancels a sync group synchronization. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task CancelSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CancelSync", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Triggers a sync group synchronization. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task TriggerSyncWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "TriggerSync", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists sync groups under a hub database. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Refreshes a hub database schema. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRefreshHubSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRefreshHubSchema", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a collection of sync database ids. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListSyncDatabaseIdsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncDatabaseIdsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListHubSchemasNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListHubSchemasNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a collection of sync group logs. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListLogsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListLogsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists sync groups under a hub database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SyncGroupsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..cb6bbdb133dc --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncGroupsOperationsExtensions.cs @@ -0,0 +1,977 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SyncGroupsOperations. + /// + public static partial class SyncGroupsOperationsExtensions + { + /// + /// Gets a collection of sync database ids. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the region where the resource is located. + /// + public static IPage ListSyncDatabaseIds(this ISyncGroupsOperations operations, string locationName) + { + return operations.ListSyncDatabaseIdsAsync(locationName).GetAwaiter().GetResult(); + } + + /// + /// Gets a collection of sync database ids. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the region where the resource is located. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSyncDatabaseIdsAsync(this ISyncGroupsOperations operations, string locationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSyncDatabaseIdsWithHttpMessagesAsync(locationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Refreshes a hub database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static void RefreshHubSchema(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + operations.RefreshHubSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes a hub database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task RefreshHubSchemaAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static IPage ListHubSchemas(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + return operations.ListHubSchemasAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListHubSchemasAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListHubSchemasWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a collection of sync group logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. Possible values include: 'All', 'Error', + /// 'Warning', 'Success' + /// + /// + /// The continuation token for this operation. + /// + public static IPage ListLogs(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string)) + { + return operations.ListLogsAsync(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, type, continuationToken).GetAwaiter().GetResult(); + } + + /// + /// Gets a collection of sync group logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Get logs generated after this time. + /// + /// + /// Get logs generated before this time. + /// + /// + /// The types of logs to retrieve. Possible values include: 'All', 'Error', + /// 'Warning', 'Success' + /// + /// + /// The continuation token for this operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListLogsAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string startTime, string endTime, string type, string continuationToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListLogsWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, type, continuationToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Cancels a sync group synchronization. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static void CancelSync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + operations.CancelSyncAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Cancels a sync group synchronization. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task CancelSyncAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CancelSyncWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Triggers a sync group synchronization. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static void TriggerSync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + operations.TriggerSyncAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Triggers a sync group synchronization. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task TriggerSyncAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerSyncWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static SyncGroup Get(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + return operations.GetAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + public static SyncGroup CreateOrUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static void Delete(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + operations.DeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + public static SyncGroup Update(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + { + return operations.UpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists sync groups under a hub database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + public static IPage ListByDatabase(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName) + { + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Lists sync groups under a hub database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Refreshes a hub database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static void BeginRefreshHubSchema(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + operations.BeginRefreshHubSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes a hub database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRefreshHubSchemaAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRefreshHubSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + public static SyncGroup BeginCreateOrUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static void BeginDelete(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + operations.BeginDeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + public static SyncGroup BeginUpdate(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The requested sync group resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ISyncGroupsOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, SyncGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a collection of sync database ids. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListSyncDatabaseIdsNext(this ISyncGroupsOperations operations, string nextPageLink) + { + return operations.ListSyncDatabaseIdsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a collection of sync database ids. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSyncDatabaseIdsNextAsync(this ISyncGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSyncDatabaseIdsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListHubSchemasNext(this ISyncGroupsOperations operations, string nextPageLink) + { + return operations.ListHubSchemasNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a collection of hub database schemas. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListHubSchemasNextAsync(this ISyncGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListHubSchemasNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a collection of sync group logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListLogsNext(this ISyncGroupsOperations operations, string nextPageLink) + { + return operations.ListLogsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a collection of sync group logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListLogsNextAsync(this ISyncGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListLogsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists sync groups under a hub database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDatabaseNext(this ISyncGroupsOperations operations, string nextPageLink) + { + return operations.ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists sync groups under a hub database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseNextAsync(this ISyncGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SyncMembersOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncMembersOperations.cs new file mode 100644 index 000000000000..cc242922e9c8 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncMembersOperations.cs @@ -0,0 +1,2083 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SyncMembersOperations operations. + /// + internal partial class SyncMembersOperations : IServiceOperations, ISyncMembersOperations + { + /// + /// Initializes a new instance of the SyncMembersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SyncMembersOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (syncMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncMemberName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an existing sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists sync members in the given sync group. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySyncGroupWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySyncGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a sync member database schema. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListMemberSchemasWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (syncMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncMemberName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListMemberSchemas", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (syncMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncMemberName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (syncMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncMemberName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates an existing sync member. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (syncMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncMemberName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRefreshMemberSchemaWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (syncGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncGroupName"); + } + if (syncMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "syncMemberName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("syncGroupName", syncGroupName); + tracingParameters.Add("syncMemberName", syncMemberName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRefreshMemberSchema", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{syncGroupName}", System.Uri.EscapeDataString(syncGroupName)); + _url = _url.Replace("{syncMemberName}", System.Uri.EscapeDataString(syncMemberName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists sync members in the given sync group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySyncGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySyncGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a sync member database schema. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListMemberSchemasNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListMemberSchemasNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SyncMembersOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncMembersOperationsExtensions.cs new file mode 100644 index 000000000000..873e4d072724 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SyncMembersOperationsExtensions.cs @@ -0,0 +1,759 @@ +// 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.Sql +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SyncMembersOperations. + /// + public static partial class SyncMembersOperationsExtensions + { + /// + /// Gets a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + public static SyncMember Get(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + { + return operations.GetAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + } + + /// + /// Gets a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + public static SyncMember CreateOrUpdate(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + public static void Delete(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + { + operations.DeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an existing sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + public static SyncMember Update(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) + { + return operations.UpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists sync members in the given sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + public static IPage ListBySyncGroup(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName) + { + return operations.ListBySyncGroupAsync(resourceGroupName, serverName, databaseName, syncGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists sync members in the given sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySyncGroupAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySyncGroupWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + public static IPage ListMemberSchemas(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + { + return operations.ListMemberSchemasAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + } + + /// + /// Gets a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The cancellation token. + /// + public static async Task> ListMemberSchemasAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListMemberSchemasWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + public static void RefreshMemberSchema(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + { + operations.RefreshMemberSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The cancellation token. + /// + public static async Task RefreshMemberSchemaAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + public static SyncMember BeginCreateOrUpdate(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + public static void BeginDelete(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + { + operations.BeginDeleteAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an existing sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + public static SyncMember BeginUpdate(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing sync member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The requested sync member resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, SyncMember parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + public static void BeginRefreshMemberSchema(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName) + { + operations.BeginRefreshMemberSchemaAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database on which the sync group is hosted. + /// + /// + /// The name of the sync group on which the sync member is hosted. + /// + /// + /// The name of the sync member. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRefreshMemberSchemaAsync(this ISyncMembersOperations operations, string resourceGroupName, string serverName, string databaseName, string syncGroupName, string syncMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRefreshMemberSchemaWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists sync members in the given sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySyncGroupNext(this ISyncMembersOperations operations, string nextPageLink) + { + return operations.ListBySyncGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists sync members in the given sync group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySyncGroupNextAsync(this ISyncMembersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySyncGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListMemberSchemasNext(this ISyncMembersOperations operations, string nextPageLink) + { + return operations.ListMemberSchemasNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a sync member database schema. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListMemberSchemasNextAsync(this ISyncMembersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListMemberSchemasNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncAgentScenarioTests/SyncAgentCRUDTest.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncAgentScenarioTests/SyncAgentCRUDTest.json new file mode 100644 index 000000000000..784d3b634785 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncAgentScenarioTests/SyncAgentCRUDTest.json @@ -0,0 +1,1170 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourcegroups/sqlcrudtest-6557?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTY1NTc/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"Japan East\",\r\n \"tags\": {\r\n \"sqlcrudtest-6557\": \"2017-08-14 08:39:55Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "d83bed74-5b1d-48d0-9be2-8a111bd735db" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557\",\r\n \"name\": \"sqlcrudtest-6557\",\r\n \"location\": \"japaneast\",\r\n \"tags\": {\r\n \"sqlcrudtest-6557\": \"2017-08-14 08:39:55Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "239" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "f2d84619-332b-409a-bbbe-bd79759163d3" + ], + "x-ms-correlation-request-id": [ + "f2d84619-332b-409a-bbbe-bd79759163d3" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083957Z:f2d84619-332b-409a-bbbe-bd79759163d3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"Japan East\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "3f8fb4bb-7aa5-42a1-b507-5bff69f5a06c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2017-08-14T08:40:00.547Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverOperationResults/1f0253ce-7d94-440b-b7eb-6a328c873e92?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/1f0253ce-7d94-440b-b7eb-6a328c873e92?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "1f0253ce-7d94-440b-b7eb-6a328c873e92" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "e8b7920a-0f2c-4e5f-b235-70498941a1f9" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084000Z:e8b7920a-0f2c-4e5f-b235-70498941a1f9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/1f0253ce-7d94-440b-b7eb-6a328c873e92?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9qYXBhbmVhc3Qvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi8xZjAyNTNjZS03ZDk0LTQ0MGItYjdlYi02YTMyOGM4NzNlOTI/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"1f0253ce-7d94-440b-b7eb-6a328c873e92\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2017-08-14T08:40:00.547Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:40:30 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "28a57145-bf30-40f6-a5d6-e98c90fab8be" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "4eaf86de-fce6-4c1e-b419-a50f3d1eafd8" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084031Z:4eaf86de-fce6-4c1e-b419-a50f3d1eafd8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/1f0253ce-7d94-440b-b7eb-6a328c873e92?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9qYXBhbmVhc3Qvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi8xZjAyNTNjZS03ZDk0LTQ0MGItYjdlYi02YTMyOGM4NzNlOTI/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"1f0253ce-7d94-440b-b7eb-6a328c873e92\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2017-08-14T08:40:00.547Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:41:01 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "ffd87fc3-6930-4020-90f8-57b98d270646" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "9b72bc09-14ac-468f-8266-3d19e0f84b3a" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084101Z:9b72bc09-14ac-468f-8266-3d19e0f84b3a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-4413.database.windows.net\"\r\n },\r\n \"location\": \"japaneast\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413\",\r\n \"name\": \"sqlcrudtest-4413\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:41:01 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c2272472-ca2a-4d94-bb0f-d313cadd8c94" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "14cf5bc1-28ec-4c7d-acf4-205791f7fac7" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084102Z:14cf5bc1-28ec-4c7d-acf4-205791f7fac7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL2RhdGFiYXNlcy9zeW5jYWdlbnRjcnVkdGVzdC0xMzM1P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "d8726217-6992-459f-a45d-e86c4e8e75a9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2017-08-14T18:41:05.495+10:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:41:04 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335/operationResults/9104c89f-1309-4344-bbd7-95c8818faa6e?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "9104c89f-1309-4344-bbd7-95c8818faa6e" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335/azureAsyncOperation/9104c89f-1309-4344-bbd7-95c8818faa6e?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "887f48b2-d5f5-4dd8-9283-18c8a4297f5f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084105Z:887f48b2-d5f5-4dd8-9283-18c8a4297f5f" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335/azureAsyncOperation/9104c89f-1309-4344-bbd7-95c8818faa6e?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL2RhdGFiYXNlcy9zeW5jYWdlbnRjcnVkdGVzdC0xMzM1L2F6dXJlQXN5bmNPcGVyYXRpb24vOTEwNGM4OWYtMTMwOS00MzQ0LWJiZDctOTVjODgxOGZhYTZlP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtUHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"9104c89f-1309-4344-bbd7-95c8818faa6e\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:41:35 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "13cd56c0-ff8d-4f87-b4bb-cd65e59e34a4" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335/azureAsyncOperation/9104c89f-1309-4344-bbd7-95c8818faa6e?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14948" + ], + "x-ms-correlation-request-id": [ + "68273c98-fa06-46ab-a32c-adf13e50cb9e" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084136Z:68273c98-fa06-46ab-a32c-adf13e50cb9e" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335/azureAsyncOperation/9104c89f-1309-4344-bbd7-95c8818faa6e?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL2RhdGFiYXNlcy9zeW5jYWdlbnRjcnVkdGVzdC0xMzM1L2F6dXJlQXN5bmNPcGVyYXRpb24vOTEwNGM4OWYtMTMwOS00MzQ0LWJiZDctOTVjODgxOGZhYTZlP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtUHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"9104c89f-1309-4344-bbd7-95c8818faa6e\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:05 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "16f623a8-e81f-4b9d-a9f0-606017ee0735" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335/azureAsyncOperation/9104c89f-1309-4344-bbd7-95c8818faa6e?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "06418bbd-be7e-4837-a334-e3f513b0c84b" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084206Z:06418bbd-be7e-4837-a334-e3f513b0c84b" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL2RhdGFiYXNlcy9zeW5jYWdlbnRjcnVkdGVzdC0xMzM1P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335\",\r\n \"name\": \"syncagentcrudtest-1335\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"9b068693-9050-49e1-9de9-b4cff9507306\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2017-08-14T08:41:05.793Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2017-08-14T08:51:36.233Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:06 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "fd2f01c4-7011-4f37-93b9-f3a0215d2c87" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14946" + ], + "x-ms-correlation-request-id": [ + "f7a956e9-925a-408a-a7d7-5b3b84afdc85" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084207Z:f7a956e9-925a-408a-a7d7-5b3b84afdc85" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHMvc3luY2FnZW50Y3J1ZHRlc3Q1OTk3P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "219" + ], + "x-ms-client-request-id": [ + "a083aac2-d57a-4619-9c34-2076dd3149e4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateSyncAgent\",\r\n \"startTime\": \"2017-08-14T08:42:08.59Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "69" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:07 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncAgentOperationResults/4130dc46-d0d0-4e30-88f8-4a179b66dbe2?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "4130dc46-d0d0-4e30-88f8-4a179b66dbe2" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "c70966c9-0d1a-44b3-ac3c-a313bd2d1855" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084208Z:c70966c9-0d1a-44b3-ac3c-a313bd2d1855" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncAgentOperationResults/4130dc46-d0d0-4e30-88f8-4a179b66dbe2?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0FnZW50T3BlcmF0aW9uUmVzdWx0cy80MTMwZGM0Ni1kMGQwLTRlMzAtODhmOC00YTE3OWI2NmRiZTI/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997\",\r\n \"name\": \"syncagentcrudtest5997\",\r\n \"type\": \"Microsoft.Sql/servers/syncAgents\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "457" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "635b5333-7933-4ce2-aed2-511fdef86b20" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14945" + ], + "x-ms-correlation-request-id": [ + "68d48316-5227-44d4-b435-335847c292c9" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084239Z:68d48316-5227-44d4-b435-335847c292c9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHMvc3luY2FnZW50Y3J1ZHRlc3Q1OTk3P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cf0e04ee-02c6-43fc-9373-274f6bf4bf35" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335\",\r\n \"state\": \"NeverConnected\",\r\n \"isUpToDate\": true,\r\n \"expiryTime\": \"9999-12-31T23:59:59.9999999Z\",\r\n \"version\": \"4.2.0.0\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997\",\r\n \"name\": \"syncagentcrudtest5997\",\r\n \"type\": \"Microsoft.Sql/servers/syncAgents\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "da3c2c53-6618-4b64-976e-c506e5ae5881" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14944" + ], + "x-ms-correlation-request-id": [ + "7ffcaf70-1814-42c2-9999-284169d7ebfb" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084239Z:7ffcaf70-1814-42c2-9999-284169d7ebfb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0c354260-3bfb-4cbc-b98d-2f18e68b769c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/databases/syncagentcrudtest-1335\",\r\n \"state\": \"NeverConnected\",\r\n \"isUpToDate\": true,\r\n \"expiryTime\": \"9999-12-31T23:59:59.9999999Z\",\r\n \"version\": \"4.2.0.0\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997\",\r\n \"name\": \"syncagentcrudtest5997\",\r\n \"type\": \"Microsoft.Sql/servers/syncAgents\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5b3403bd-c2c8-4474-a7ad-f65577b65e8e" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14943" + ], + "x-ms-correlation-request-id": [ + "2ad3a000-5ab0-4f13-b67b-0e5e85b7126e" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084240Z:2ad3a000-5ab0-4f13-b67b-0e5e85b7126e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997/generateKey?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHMvc3luY2FnZW50Y3J1ZHRlc3Q1OTk3L2dlbmVyYXRlS2V5P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "815d95a5-b075-4192-8b8e-9da206387894" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"syncAgentKey\": \"117a045b-9cea-4623-834e-51b68256d0b8:R86zc8h4iWT/w9XehcDw+SbISmMwa+PVVz0lpiBjmrI=:c3FsY3J1ZHRlc3QtNDQxMy5kYXRhYmFzZS53aW5kb3dzLm5ldOKBh3N5bmNhZ2VudGNydWR0ZXN0LTEzMzU=\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:40 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c70ec508-27f1-485f-8a5c-1daed4ff810c" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "5a372f17-399b-4d94-bd3c-72df9f57f5c6" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084240Z:5a372f17-399b-4d94-bd3c-72df9f57f5c6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997/generateKey?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHMvc3luY2FnZW50Y3J1ZHRlc3Q1OTk3L2dlbmVyYXRlS2V5P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b567bf50-2c97-41a6-9c5e-2835232915c8" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"syncAgentKey\": \"117a045b-9cea-4623-834e-51b68256d0b8:lTEiH7UXEzaBF2hKeqPDc5aaveupsdAZrof1t2rLK5s=:c3FsY3J1ZHRlc3QtNDQxMy5kYXRhYmFzZS53aW5kb3dzLm5ldOKBh3N5bmNhZ2VudGNydWR0ZXN0LTEzMzU=\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:40 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "90ae5f4f-69d7-44ce-832f-1c9265e7b79c" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "d1b43058-d3f1-49c1-b1b2-2c71f44874e2" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084240Z:d1b43058-d3f1-49c1-b1b2-2c71f44874e2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997/linkedDatabases?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHMvc3luY2FnZW50Y3J1ZHRlc3Q1OTk3L2xpbmtlZERhdGFiYXNlcz9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bd113b19-5c26-4b91-84f8-c80a7fc3b9af" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:40 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "287e29ab-5735-4a86-9a67-aa4c791181b5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14942" + ], + "x-ms-correlation-request-id": [ + "2c0b8b8b-b672-4a58-94e9-50ad75a61736" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084240Z:2c0b8b8b-b672-4a58-94e9-50ad75a61736" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY1NTcvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NDEzL3N5bmNBZ2VudHMvc3luY2FnZW50Y3J1ZHRlc3Q1OTk3P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2fd3ade6-e31c-471f-882b-f6269c5b38fb" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"DropSyncAgent\",\r\n \"startTime\": \"2017-08-14T08:42:41.597Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "68" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:42:41 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncAgentOperationResults/203c711c-e313-4c83-9bd6-55cb0ffe035f?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "203c711c-e313-4c83-9bd6-55cb0ffe035f" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-correlation-request-id": [ + "fa66ce23-12cb-48ec-8e00-7efe6d372a15" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084241Z:fa66ce23-12cb-48ec-8e00-7efe6d372a15" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncAgentOperationResults/203c711c-e313-4c83-9bd6-55cb0ffe035f?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0FnZW50T3BlcmF0aW9uUmVzdWx0cy8yMDNjNzExYy1lMzEzLTRjODMtOWJkNi01NWNiMGZmZTAzNWY/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-6557/providers/Microsoft.Sql/servers/sqlcrudtest-4413/syncAgents/syncagentcrudtest5997\",\r\n \"name\": \"syncagentcrudtest5997\",\r\n \"type\": \"Microsoft.Sql/servers/syncAgents\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:43:11 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "35234674-be52-4628-8b84-c483b4a3be9f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14941" + ], + "x-ms-correlation-request-id": [ + "4fdc35a1-6c4c-41a7-ab5b-a0fad4c72eb1" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084311Z:4fdc35a1-6c4c-41a7-ab5b-a0fad4c72eb1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourcegroups/sqlcrudtest-6557?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTY1NTc/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2b95b9d7-e39b-4ab5-b3d2-9bfe729f05db" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:43:13 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDY1NTctSkFQQU5FQVNUIiwiam9iTG9jYXRpb24iOiJqYXBhbmVhc3QifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "edf97665-6d85-4225-a01d-40a7e211f64f" + ], + "x-ms-correlation-request-id": [ + "edf97665-6d85-4225-a01d-40a7e211f64f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T084314Z:edf97665-6d85-4225-a01d-40a7e211f64f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-6557" + ], + "CreateServer": [ + "sqlcrudtest-4413" + ], + "SyncAgentCRUDTest": [ + "syncagentcrudtest-1335", + "syncagentcrudtest5997" + ] + }, + "Variables": { + "DefaultLocation": "Japan East", + "SubscriptionId": "d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncGroupScenarioTests/SyncGroupCRUDTest.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncGroupScenarioTests/SyncGroupCRUDTest.json new file mode 100644 index 000000000000..1e5c9655def8 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncGroupScenarioTests/SyncGroupCRUDTest.json @@ -0,0 +1,1778 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourcegroups/sqlcrudtest-7205?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTcyMDU/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"Japan East\",\r\n \"tags\": {\r\n \"sqlcrudtest-7205\": \"2017-08-14 08:26:54Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "580097af-8aea-42b1-91e7-563d520de0f4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205\",\r\n \"name\": \"sqlcrudtest-7205\",\r\n \"location\": \"japaneast\",\r\n \"tags\": {\r\n \"sqlcrudtest-7205\": \"2017-08-14 08:26:54Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "239" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:26:56 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "85bb2bba-11ed-4c86-a28f-22072e8c05c5" + ], + "x-ms-correlation-request-id": [ + "85bb2bba-11ed-4c86-a28f-22072e8c05c5" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082657Z:85bb2bba-11ed-4c86-a28f-22072e8c05c5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"Japan East\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "934bdcae-47f6-4720-9660-b49f3ee083e7" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2017-08-14T08:27:00.543Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:27:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverOperationResults/f2a97021-77be-4608-b7f5-ccaee75ab8af?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/f2a97021-77be-4608-b7f5-ccaee75ab8af?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "f2a97021-77be-4608-b7f5-ccaee75ab8af" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "19355eb1-926d-43f2-b0e2-60387280946f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082701Z:19355eb1-926d-43f2-b0e2-60387280946f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/f2a97021-77be-4608-b7f5-ccaee75ab8af?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9qYXBhbmVhc3Qvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9mMmE5NzAyMS03N2JlLTQ2MDgtYjdmNS1jY2FlZTc1YWI4YWY/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"f2a97021-77be-4608-b7f5-ccaee75ab8af\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2017-08-14T08:27:00.543Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:27:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "a439f95b-cbbf-4f74-814b-f3d0f2af689b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "66d12728-0425-4357-8ba2-e1a0085ebe9a" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082732Z:66d12728-0425-4357-8ba2-e1a0085ebe9a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/f2a97021-77be-4608-b7f5-ccaee75ab8af?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9qYXBhbmVhc3Qvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9mMmE5NzAyMS03N2JlLTQ2MDgtYjdmNS1jY2FlZTc1YWI4YWY/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"f2a97021-77be-4608-b7f5-ccaee75ab8af\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2017-08-14T08:27:00.543Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:28:01 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4bec62ce-b419-4e1a-afd8-17f20afa991d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-correlation-request-id": [ + "10c7000d-20b5-445f-b607-44e6baed0438" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082802Z:10c7000d-20b5-445f-b607-44e6baed0438" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-9860.database.windows.net\"\r\n },\r\n \"location\": \"japaneast\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860\",\r\n \"name\": \"sqlcrudtest-9860\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:28:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "6c4eb0e8-d8bc-463e-a8d7-89306769b66d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "0c026886-80c0-4e2d-8d93-25d07df8ab25" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082803Z:0c026886-80c0-4e2d-8d93-25d07df8ab25" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC1zeW5jOTk3Mj9hcGktdmVyc2lvbj0yMDE0LTA0LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "e3be74da-eb53-449f-a652-dd8f0989202b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2017-08-14T18:28:05.572+10:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:28:05 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972/operationResults/14ce94d4-e9ed-44b2-9596-bc4e1eb15b63?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "14ce94d4-e9ed-44b2-9596-bc4e1eb15b63" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972/azureAsyncOperation/14ce94d4-e9ed-44b2-9596-bc4e1eb15b63?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "7e38a331-8293-4b05-bce5-69d528892b91" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082805Z:7e38a331-8293-4b05-bce5-69d528892b91" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972/azureAsyncOperation/14ce94d4-e9ed-44b2-9596-bc4e1eb15b63?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC1zeW5jOTk3Mi9henVyZUFzeW5jT3BlcmF0aW9uLzE0Y2U5NGQ0LWU5ZWQtNDRiMi05NTk2LWJjNGUxZWIxNWI2Mz9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLVByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"14ce94d4-e9ed-44b2-9596-bc4e1eb15b63\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:28:35 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "19a2d3aa-d5c8-4fbb-b7ac-ee3e586f2003" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972/azureAsyncOperation/14ce94d4-e9ed-44b2-9596-bc4e1eb15b63?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "e5ea6945-4920-495b-98f7-ea98e2eea03a" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082836Z:e5ea6945-4920-495b-98f7-ea98e2eea03a" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972/azureAsyncOperation/14ce94d4-e9ed-44b2-9596-bc4e1eb15b63?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC1zeW5jOTk3Mi9henVyZUFzeW5jT3BlcmF0aW9uLzE0Y2U5NGQ0LWU5ZWQtNDRiMi05NTk2LWJjNGUxZWIxNWI2Mz9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLVByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"14ce94d4-e9ed-44b2-9596-bc4e1eb15b63\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:29:06 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "f1cf4e4b-c66a-432d-b80f-0c23890e84db" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972/azureAsyncOperation/14ce94d4-e9ed-44b2-9596-bc4e1eb15b63?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "3446cf29-5c08-465b-a1d8-377474efc1d5" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082906Z:3446cf29-5c08-465b-a1d8-377474efc1d5" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC1zeW5jOTk3Mj9hcGktdmVyc2lvbj0yMDE0LTA0LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972\",\r\n \"name\": \"syncgroupcrudtest-sync9972\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"ddeabf99-2044-46db-85ee-7df5a72cbb66\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2017-08-14T08:28:05.993Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2017-08-14T08:38:39.26Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:29:07 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e75a04aa-cba2-4289-bba3-63d6ff82d96b" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "24e94513-607d-4f67-ac54-07982c23e354" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082907Z:24e94513-607d-4f67-ac54-07982c23e354" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NT9hcGktdmVyc2lvbj0yMDE0LTA0LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "7f891d6f-47b3-44b1-857f-e3deb9c7b224" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2017-08-14T18:29:08.989+10:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:29:09 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/operationResults/b0ca297f-75f8-4069-9810-42dcb2b3a4cf?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "b0ca297f-75f8-4069-9810-42dcb2b3a4cf" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/azureAsyncOperation/b0ca297f-75f8-4069-9810-42dcb2b3a4cf?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "466d26be-a23d-4b7e-9c1e-f40f221f4a96" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082909Z:466d26be-a23d-4b7e-9c1e-f40f221f4a96" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/azureAsyncOperation/b0ca297f-75f8-4069-9810-42dcb2b3a4cf?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9henVyZUFzeW5jT3BlcmF0aW9uL2IwY2EyOTdmLTc1ZjgtNDA2OS05ODEwLTQyZGNiMmIzYTRjZj9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLVByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"b0ca297f-75f8-4069-9810-42dcb2b3a4cf\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:29:39 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "438206b9-b907-4d87-9b8a-01f1df833cd4" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/azureAsyncOperation/b0ca297f-75f8-4069-9810-42dcb2b3a4cf?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14957" + ], + "x-ms-correlation-request-id": [ + "97860371-cff4-4051-8030-540e3c0c3903" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T082939Z:97860371-cff4-4051-8030-540e3c0c3903" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/azureAsyncOperation/b0ca297f-75f8-4069-9810-42dcb2b3a4cf?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9henVyZUFzeW5jT3BlcmF0aW9uL2IwY2EyOTdmLTc1ZjgtNDA2OS05ODEwLTQyZGNiMmIzYTRjZj9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLVByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"b0ca297f-75f8-4069-9810-42dcb2b3a4cf\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:30:09 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "cc68f5ce-7d5c-499a-99c0-b933ea35208c" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/azureAsyncOperation/b0ca297f-75f8-4069-9810-42dcb2b3a4cf?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14960" + ], + "x-ms-correlation-request-id": [ + "f773a791-8e5c-46e5-9e4b-152a5df1f413" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083010Z:f773a791-8e5c-46e5-9e4b-152a5df1f413" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NT9hcGktdmVyc2lvbj0yMDE0LTA0LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845\",\r\n \"name\": \"syncgroupcrudtest-test6845\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"d0a81b72-a755-4eec-8f19-7563c8473cfb\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2017-08-14T08:29:09.223Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2017-08-14T08:39:42.493Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:30:09 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "272877e4-ed4d-401a-9c1b-1f9ffb84a4b6" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "8728ede7-a235-45fa-a949-6b60b19614dd" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083010Z:8728ede7-a235-45fa-a949-6b60b19614dd" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"interval\": -1,\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972\",\r\n \"hubDatabaseUserName\": \"dummylogin\",\r\n \"hubDatabasePassword\": \"Un53cuRE!\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "373" + ], + "x-ms-client-request-id": [ + "0467980d-8191-48c2-87ee-387fea418cfa" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertSyncGroup\",\r\n \"startTime\": \"2017-08-14T08:30:12.083Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:30:11 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/3a567185-46cf-4d26-b83d-7f40e4332dff?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "3a567185-46cf-4d26-b83d-7f40e4332dff" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "e784491a-cbdd-4373-b3cc-9b060eeecdf0" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083011Z:e784491a-cbdd-4373-b3cc-9b060eeecdf0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/3a567185-46cf-4d26-b83d-7f40e4332dff?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0dyb3VwT3BlcmF0aW9uUmVzdWx0cy8zYTU2NzE4NS00NmNmLTRkMjYtYjgzZC03ZjQwZTQzMzJkZmY/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertSyncGroup\",\r\n \"startTime\": \"2017-08-14T08:30:12.083Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:30:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/3a567185-46cf-4d26-b83d-7f40e4332dff?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "0411b41d-0530-4f93-8e7d-e8746fe20fde" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14957" + ], + "x-ms-correlation-request-id": [ + "bdc2f798-acfa-46dd-8a7b-468b2f38cae2" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083042Z:bdc2f798-acfa-46dd-8a7b-468b2f38cae2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/3a567185-46cf-4d26-b83d-7f40e4332dff?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0dyb3VwT3BlcmF0aW9uUmVzdWx0cy8zYTU2NzE4NS00NmNmLTRkMjYtYjgzZC03ZjQwZTQzMzJkZmY/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"interval\": -1,\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972\",\r\n \"syncState\": \"Good\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113\",\r\n \"name\": \"syncgroupcrudtest-syncgroup8113\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "638" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "5d71f9af-a2d1-4c4d-a407-9abc7038436b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14956" + ], + "x-ms-correlation-request-id": [ + "5e1cbc6e-d85e-4621-ac88-e1a484ceb416" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083112Z:5e1cbc6e-d85e-4621-ac88-e1a484ceb416" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0c47b9b4-6bf4-40db-824e-c5b799487594" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"interval\": -1,\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972\",\r\n \"hubDatabaseUserName\": \"dummylogin\",\r\n \"syncState\": \"NotReady\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113\",\r\n \"name\": \"syncgroupcrudtest-syncgroup8113\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:13 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c513b6ab-9add-4edb-a5ff-d343feaac47e" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14955" + ], + "x-ms-correlation-request-id": [ + "a21e64d6-590e-4db5-a9dd-a1f6112d3565" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083114Z:a21e64d6-590e-4db5-a9dd-a1f6112d3565" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "296d2a8b-20a6-46f3-811c-90c836919d3b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"interval\": 600,\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972\",\r\n \"hubDatabaseUserName\": \"dummylogin\",\r\n \"syncState\": \"NotReady\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113\",\r\n \"name\": \"syncgroupcrudtest-syncgroup8113\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "078f9c63-d5d1-4e30-856c-028dd81ae49c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14952" + ], + "x-ms-correlation-request-id": [ + "49929f15-b2cb-4366-a17f-3df5a219a576" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083145Z:49929f15-b2cb-4366-a17f-3df5a219a576" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7d921dae-8cbd-4ecd-95f9-ee955e9d3f8f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"interval\": -1,\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-sync9972\",\r\n \"hubDatabaseUserName\": \"dummylogin\",\r\n \"syncState\": \"NotReady\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113\",\r\n \"name\": \"syncgroupcrudtest-syncgroup8113\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e37ee785-98f5-48a4-bd48-ee8dd3bae694" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14954" + ], + "x-ms-correlation-request-id": [ + "1a31bd9f-340e-4cab-adab-831a638240e6" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083114Z:1a31bd9f-340e-4cab-adab-831a638240e6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"interval\": 600\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "49" + ], + "x-ms-client-request-id": [ + "54d65b2d-3ee3-4fda-b6ce-9907231b334a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertSyncGroup\",\r\n \"startTime\": \"2017-08-14T08:31:15.023Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/569ccc78-6c90-4278-81a8-42b30745afde?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "569ccc78-6c90-4278-81a8-42b30745afde" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "0f866155-4413-4f15-ab8a-74f3f9a985fb" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083114Z:0f866155-4413-4f15-ab8a-74f3f9a985fb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PATCH", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "77466082-9bcb-4eb2-8674-6bdc64de0bb0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidSyncGroupCreateOrUpdateRequest\",\r\n \"message\": \"The create or update sync group request body is empty.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "125" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "f20c46fc-4c0f-40d6-97f4-88054599480c" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-correlation-request-id": [ + "c8a79f61-e40a-44fd-aa07-e1b25857205c" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083145Z:c8a79f61-e40a-44fd-aa07-e1b25857205c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 400 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/569ccc78-6c90-4278-81a8-42b30745afde?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0dyb3VwT3BlcmF0aW9uUmVzdWx0cy81NjljY2M3OC02YzkwLTQyNzgtODFhOC00MmIzMDc0NWFmZGU/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"interval\": 600,\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"syncDatabaseId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Sql/servers//databases/\",\r\n \"syncState\": \"Good\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113\",\r\n \"name\": \"syncgroupcrudtest-syncgroup8113\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "664d6743-95c7-4d19-833c-ac5de1a8aca5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "2275228c-2987-46ff-a1f7-4c8eb3c9fec5" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083145Z:2275228c-2987-46ff-a1f7-4c8eb3c9fec5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113/refreshHubSchema?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTMvcmVmcmVzaEh1YlNjaGVtYT9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9425731e-ee34-4821-af6f-e16600c7f6e1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"RefrehSyncHubFullSchema\",\r\n \"startTime\": \"2017-08-14T08:31:45.86Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "77" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:31:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113/refreshHubSchemaOperationResults/d1ed7cb4-177a-4ba9-84fa-2203b586ede5?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "d1ed7cb4-177a-4ba9-84fa-2203b586ede5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1188" + ], + "x-ms-correlation-request-id": [ + "50cbb7ed-062c-46b3-80c9-1adb5a95e831" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083146Z:50cbb7ed-062c-46b3-80c9-1adb5a95e831" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113/refreshHubSchemaOperationResults/d1ed7cb4-177a-4ba9-84fa-2203b586ede5?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTMvcmVmcmVzaEh1YlNjaGVtYU9wZXJhdGlvblJlc3VsdHMvZDFlZDdjYjQtMTc3YS00YmE5LTg0ZmEtMjIwM2I1ODZlZGU1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "b20597ef-33ca-4e56-abe1-be2971c74681" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "171def20-796a-40de-ad25-6ea1537309e7" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083216Z:171def20-796a-40de-ad25-6ea1537309e7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113/hubSchemas?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTMvaHViU2NoZW1hcz9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f17794ea-5bcd-495e-9331-10b799c9d3a1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5d0666e3-38e7-4674-a4f6-40ccb7023a8a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "49ec8695-79c3-4e15-bd86-26c866bf4d32" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083216Z:49ec8695-79c3-4e15-bd86-26c866bf4d32" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113/logs?startTime=2017-01-01T00:00:00&endTime=2099-12-31T00:00:00&type=All&api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTMvbG9ncz9zdGFydFRpbWU9MjAxNy0wMS0wMVQwMCUzQTAwJTNBMDAmZW5kVGltZT0yMDk5LTEyLTMxVDAwJTNBMDAlM0EwMCZ0eXBlPUFsbCZhcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "818bf8eb-65fe-417e-baa7-6100a6c66071" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"timestamp\": \"2017-08-14T08:31:55.9333333Z\",\r\n \"type\": \"Error\",\r\n \"source\": \"sqlcrudtest-9860.database.windows.net/syncgroupcrudtest-test6845\",\r\n \"details\": \"Getting schema information for the database failed with the exception \\\"Failed to connect to server .\\nInner exception: SqlException Error Code: -2146232060 - SqlError Number:40615, Message: Cannot open server requested by the login. Client is not allowed to access the server. To enable access, use the SQL Azure Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. \\n For more information, provide tracing ID ‘96e15763-0e1a-4915-8815-e4410bc48fbc’ to customer support.\\\"\",\r\n \"tracingId\": \"96e15763-0e1a-4915-8815-e4410bc48fbc\",\r\n \"operationStatus\": \"SchemaRefreshFailure\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8bc63d2d-06a4-4d2e-8b91-570b95557a2c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14949" + ], + "x-ms-correlation-request-id": [ + "b9857db4-c2d8-47b4-8b9f-75164a24ca0e" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083216Z:b9857db4-c2d8-47b4-8b9f-75164a24ca0e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyMDUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC05ODYwL2RhdGFiYXNlcy9zeW5jZ3JvdXBjcnVkdGVzdC10ZXN0Njg0NS9zeW5jR3JvdXBzL3N5bmNncm91cGNydWR0ZXN0LXN5bmNncm91cDgxMTM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d05c028d-c43e-4c85-8dbd-84b1de284540" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"DropSyncGroup\",\r\n \"startTime\": \"2017-08-14T08:32:17.293Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "68" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/3ff36aee-c041-4222-94e2-281be97bc76b?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "3ff36aee-c041-4222-94e2-281be97bc76b" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1187" + ], + "x-ms-correlation-request-id": [ + "ca0c1611-9de8-4df6-bacb-4cc8e4b86a43" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083217Z:ca0c1611-9de8-4df6-bacb-4cc8e4b86a43" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/3ff36aee-c041-4222-94e2-281be97bc76b?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0dyb3VwT3BlcmF0aW9uUmVzdWx0cy8zZmYzNmFlZS1jMDQxLTQyMjItOTRlMi0yODFiZTk3YmM3NmI/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"syncState\": \"NotReady\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-7205/providers/Microsoft.Sql/servers/sqlcrudtest-9860/databases/syncgroupcrudtest-test6845/syncGroups/syncgroupcrudtest-syncgroup8113\",\r\n \"name\": \"syncgroupcrudtest-syncgroup8113\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:47 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "ed5fdce5-8fb2-4a16-9ab9-482c9c3446ef" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "ff965db5-ff7a-4e7e-8753-3dcc440cb47c" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083247Z:ff965db5-ff7a-4e7e-8753-3dcc440cb47c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourcegroups/sqlcrudtest-7205?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTcyMDU/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6ba6b1c5-414d-42f0-8985-af807187ab78" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDcyMDUtSkFQQU5FQVNUIiwiam9iTG9jYXRpb24iOiJqYXBhbmVhc3QifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-request-id": [ + "2a8093e4-5272-4ee5-acb4-ee68650cf73f" + ], + "x-ms-correlation-request-id": [ + "2a8093e4-5272-4ee5-acb4-ee68650cf73f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083250Z:2a8093e4-5272-4ee5-acb4-ee68650cf73f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-7205" + ], + "CreateServer": [ + "sqlcrudtest-9860" + ], + "SyncGroupCRUDTest": [ + "syncgroupcrudtest-sync9972", + "syncgroupcrudtest-test6845", + "syncgroupcrudtest-syncgroup8113" + ] + }, + "Variables": { + "SubscriptionId": "d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea", + "DefaultLocation": "Japan East" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncMemberScenarioTests/SyncMemberCRUDTest.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncMemberScenarioTests/SyncMemberCRUDTest.json new file mode 100644 index 000000000000..106e8df1f79f --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.SyncMemberScenarioTests/SyncMemberCRUDTest.json @@ -0,0 +1,1969 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourcegroups/sqlcrudtest-1555?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTE1NTU/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"Japan East\",\r\n \"tags\": {\r\n \"sqlcrudtest-1555\": \"2017-08-14 08:32:53Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "c48e6e12-f9fc-4c3f-9de6-bc43b9419b2c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555\",\r\n \"name\": \"sqlcrudtest-1555\",\r\n \"location\": \"japaneast\",\r\n \"tags\": {\r\n \"sqlcrudtest-1555\": \"2017-08-14 08:32:53Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "239" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:56 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-request-id": [ + "81e1d41c-6fd6-423e-8faa-be171cd6045d" + ], + "x-ms-correlation-request-id": [ + "81e1d41c-6fd6-423e-8faa-be171cd6045d" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083256Z:81e1d41c-6fd6-423e-8faa-be171cd6045d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"Japan East\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "9e04d68c-e2c5-42b9-8793-b86129fc078c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2017-08-14T08:33:00.533Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:32:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverOperationResults/697178b7-ecda-44d2-bef3-39b33c7c3f3f?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/697178b7-ecda-44d2-bef3-39b33c7c3f3f?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "697178b7-ecda-44d2-bef3-39b33c7c3f3f" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "9ee7e11b-42e0-4950-b826-5ffa822e4631" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083300Z:9ee7e11b-42e0-4950-b826-5ffa822e4631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/697178b7-ecda-44d2-bef3-39b33c7c3f3f?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9qYXBhbmVhc3Qvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi82OTcxNzhiNy1lY2RhLTQ0ZDItYmVmMy0zOWIzM2M3YzNmM2Y/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"697178b7-ecda-44d2-bef3-39b33c7c3f3f\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2017-08-14T08:33:00.533Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:33:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2e492c32-5c63-4d2b-b308-a3d0a67a6d6b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "b05213f8-2a23-4782-9a9f-5386634a6b06" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083331Z:b05213f8-2a23-4782-9a9f-5386634a6b06" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/japaneast/serverAzureAsyncOperation/697178b7-ecda-44d2-bef3-39b33c7c3f3f?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9qYXBhbmVhc3Qvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi82OTcxNzhiNy1lY2RhLTQ0ZDItYmVmMy0zOWIzM2M3YzNmM2Y/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"697178b7-ecda-44d2-bef3-39b33c7c3f3f\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2017-08-14T08:33:00.533Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:34:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e02e2678-17be-4c33-a6a3-5b05b4f74f4e" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14960" + ], + "x-ms-correlation-request-id": [ + "781cc429-4e7d-45d7-b880-3871cc3dd207" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083401Z:781cc429-4e7d-45d7-b880-3871cc3dd207" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-4615.database.windows.net\"\r\n },\r\n \"location\": \"japaneast\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615\",\r\n \"name\": \"sqlcrudtest-4615\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:34:01 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "23de953f-0548-43c4-a564-bc93cf5c8cee" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "5979f912-b71f-4834-b32b-49877f2268c6" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083402Z:5979f912-b71f-4834-b32b-49877f2268c6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luYzk4Mjk/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "33927596-225f-49fc-a557-0cb9cbc2ca49" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2017-08-14T18:34:04.913+10:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:34:04 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829/operationResults/ebded068-be5b-4b72-92bc-f4b583cd538b?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "ebded068-be5b-4b72-92bc-f4b583cd538b" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829/azureAsyncOperation/ebded068-be5b-4b72-92bc-f4b583cd538b?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "accf8a0a-274b-4750-aaa0-ecb43deb011c" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083404Z:accf8a0a-274b-4750-aaa0-ecb43deb011c" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829/azureAsyncOperation/ebded068-be5b-4b72-92bc-f4b583cd538b?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luYzk4MjkvYXp1cmVBc3luY09wZXJhdGlvbi9lYmRlZDA2OC1iZTViLTRiNzItOTJiYy1mNGI1ODNjZDUzOGI/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1QcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"ebded068-be5b-4b72-92bc-f4b583cd538b\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:34:35 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1dddbdee-bf0e-4a2d-8f68-650b42111e15" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829/azureAsyncOperation/ebded068-be5b-4b72-92bc-f4b583cd538b?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14957" + ], + "x-ms-correlation-request-id": [ + "85b1cb8b-88f9-4719-a9e4-f682c5f10b12" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083435Z:85b1cb8b-88f9-4719-a9e4-f682c5f10b12" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829/azureAsyncOperation/ebded068-be5b-4b72-92bc-f4b583cd538b?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luYzk4MjkvYXp1cmVBc3luY09wZXJhdGlvbi9lYmRlZDA2OC1iZTViLTRiNzItOTJiYy1mNGI1ODNjZDUzOGI/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1QcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"ebded068-be5b-4b72-92bc-f4b583cd538b\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:35:05 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5bf4174d-8a2b-45e4-9da0-598ef14ba4be" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829/azureAsyncOperation/ebded068-be5b-4b72-92bc-f4b583cd538b?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "758c186d-dae4-4005-8bb1-e0fc344364fa" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083505Z:758c186d-dae4-4005-8bb1-e0fc344364fa" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luYzk4Mjk/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829\",\r\n \"name\": \"syncmembercrudtest-sync9829\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"752a0599-2991-4b99-a51c-1b47ad574797\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2017-08-14T08:34:05.15Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2017-08-14T08:44:36.533Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:35:05 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "02193167-7e73-4643-85f4-e37749cafbec" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "b6e42a01-6904-4119-bf0b-3e11896638b3" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083506Z:b6e42a01-6904-4119-bf0b-3e11896638b3" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzU/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "0ff5bd1b-28f4-4b32-8f84-043e425b3e74" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2017-08-14T18:35:08.675+10:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:35:07 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/operationResults/ffe34aa1-35dc-4bea-a5c9-931015adf0ba?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "ffe34aa1-35dc-4bea-a5c9-931015adf0ba" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/azureAsyncOperation/ffe34aa1-35dc-4bea-a5c9-931015adf0ba?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "b341b2a5-aebf-423a-baa4-b0bccb99127f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083508Z:b341b2a5-aebf-423a-baa4-b0bccb99127f" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/azureAsyncOperation/ffe34aa1-35dc-4bea-a5c9-931015adf0ba?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvYXp1cmVBc3luY09wZXJhdGlvbi9mZmUzNGFhMS0zNWRjLTRiZWEtYTVjOS05MzEwMTVhZGYwYmE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1QcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"ffe34aa1-35dc-4bea-a5c9-931015adf0ba\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:35:38 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "6444b6f1-b1fd-4c13-8155-3e00eec33226" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/azureAsyncOperation/ffe34aa1-35dc-4bea-a5c9-931015adf0ba?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14956" + ], + "x-ms-correlation-request-id": [ + "c17804c2-a891-49d5-bf72-34e067b4ed7a" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083538Z:c17804c2-a891-49d5-bf72-34e067b4ed7a" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/azureAsyncOperation/ffe34aa1-35dc-4bea-a5c9-931015adf0ba?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvYXp1cmVBc3luY09wZXJhdGlvbi9mZmUzNGFhMS0zNWRjLTRiZWEtYTVjOS05MzEwMTVhZGYwYmE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1QcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"ffe34aa1-35dc-4bea-a5c9-931015adf0ba\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:36:08 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c34d780d-aa29-4bd9-b9b4-972b2f7e985b" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/azureAsyncOperation/ffe34aa1-35dc-4bea-a5c9-931015adf0ba?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14955" + ], + "x-ms-correlation-request-id": [ + "2447c81c-78c3-4250-80aa-c9f54bf8133f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083609Z:2447c81c-78c3-4250-80aa-c9f54bf8133f" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzU/YXBpLXZlcnNpb249MjAxNC0wNC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935\",\r\n \"name\": \"syncmembercrudtest-test8935\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"bffa376e-a17e-4ef5-8333-91122f987687\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2017-08-14T08:35:09.02Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2017-08-14T08:45:44.123Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:36:09 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "3439e6f7-561c-4281-bd8a-8bc29b91a7f2" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14954" + ], + "x-ms-correlation-request-id": [ + "1962836a-dd40-4ed5-b71e-45c69bdad585" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083609Z:1962836a-dd40-4ed5-b71e-45c69bdad585" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtbWVtYmVyNjQxMT9hcGktdmVyc2lvbj0yMDE0LTA0LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"japaneast\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "31" + ], + "x-ms-client-request-id": [ + "6b2f625e-20e9-4b40-ba62-4e90b59f4793" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"CreateLogicalDatabase\",\r\n \"startTime\": \"2017-08-14T18:36:12.044+10:00\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "80" + ], + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:36:11 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411/operationResults/3d139af2-1fbb-4066-a593-b4dc2e960bd4?api-version=2014-04-01-Preview" + ], + "Retry-After": [ + "30" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "3d139af2-1fbb-4066-a593-b4dc2e960bd4" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Preference-Applied": [ + "return-content" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411/azureAsyncOperation/3d139af2-1fbb-4066-a593-b4dc2e960bd4?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "93e40c5e-28f3-4562-85f8-671c679e948d" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083611Z:93e40c5e-28f3-4562-85f8-671c679e948d" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411/azureAsyncOperation/3d139af2-1fbb-4066-a593-b4dc2e960bd4?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtbWVtYmVyNjQxMS9henVyZUFzeW5jT3BlcmF0aW9uLzNkMTM5YWYyLTFmYmItNDA2Ni1hNTkzLWI0ZGMyZTk2MGJkND9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLVByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"3d139af2-1fbb-4066-a593-b4dc2e960bd4\",\r\n \"status\": \"InProgress\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:36:41 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c54d78c6-5fed-41d6-959e-b84503c89f21" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411/azureAsyncOperation/3d139af2-1fbb-4066-a593-b4dc2e960bd4?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "00f4e87e-7635-42c9-9bd7-0584c9a7abbc" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083641Z:00f4e87e-7635-42c9-9bd7-0584c9a7abbc" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411/azureAsyncOperation/3d139af2-1fbb-4066-a593-b4dc2e960bd4?api-version=2014-04-01-Preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtbWVtYmVyNjQxMS9henVyZUFzeW5jT3BlcmF0aW9uLzNkMTM5YWYyLTFmYmItNDA2Ni1hNTkzLWI0ZGMyZTk2MGJkND9hcGktdmVyc2lvbj0yMDE0LTA0LTAxLVByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operationId\": \"3d139af2-1fbb-4066-a593-b4dc2e960bd4\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:37:11 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5c077707-adbf-4259-b4c5-581674a160a0" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411/azureAsyncOperation/3d139af2-1fbb-4066-a593-b4dc2e960bd4?api-version=2014-04-01-Preview" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-correlation-request-id": [ + "c4ff9b17-8f08-47c6-bb75-34fce3f843e6" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083711Z:c4ff9b17-8f08-47c6-bb75-34fce3f843e6" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411?api-version=2014-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtbWVtYmVyNjQxMT9hcGktdmVyc2lvbj0yMDE0LTA0LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-member6411\",\r\n \"name\": \"syncmembercrudtest-member6411\",\r\n \"type\": \"Microsoft.Sql/servers/databases\",\r\n \"location\": \"Japan East\",\r\n \"kind\": \"v12.0,user\",\r\n \"properties\": {\r\n \"databaseId\": \"ca9cc172-e363-44db-98a3-427a402f1f7c\",\r\n \"edition\": \"Standard\",\r\n \"status\": \"Online\",\r\n \"serviceLevelObjective\": \"S0\",\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"maxSizeBytes\": \"268435456000\",\r\n \"creationDate\": \"2017-08-14T08:36:12.327Z\",\r\n \"currentServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveId\": \"f1173c43-91bd-4aaa-973c-54e79e15235b\",\r\n \"requestedServiceObjectiveName\": \"S0\",\r\n \"sampleName\": null,\r\n \"defaultSecondaryLocation\": \"Japan West\",\r\n \"earliestRestoreDate\": \"2017-08-14T08:46:43.627Z\",\r\n \"elasticPoolName\": null,\r\n \"containmentState\": 2,\r\n \"readScale\": \"Disabled\",\r\n \"failoverGroupId\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; odata=minimalmetadata; streaming=true; charset=utf-8" + ], + "Cache-Control": [ + "no-store, no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:37:12 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "f4087143-2696-4822-9623-315a751497da" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "DataServiceVersion": [ + "3.0;" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14949" + ], + "x-ms-correlation-request-id": [ + "9337be56-225e-4507-b9f1-5a153bec1d79" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083712Z:9337be56-225e-4507-b9f1-5a153bec1d79" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"interval\": -1,\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829\",\r\n \"hubDatabaseUserName\": \"dummylogin\",\r\n \"hubDatabasePassword\": \"Un53cuRE!\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "374" + ], + "x-ms-client-request-id": [ + "06500599-0c37-48ab-b4fe-935ed7821cb0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertSyncGroup\",\r\n \"startTime\": \"2017-08-14T08:37:14.047Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:37:13 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/c49a9067-e801-4a88-aab8-4a158c9f5d59?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "c49a9067-e801-4a88-aab8-4a158c9f5d59" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "7c57af2f-404d-401f-9553-0fa8b7734324" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083714Z:7c57af2f-404d-401f-9553-0fa8b7734324" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncGroupOperationResults/c49a9067-e801-4a88-aab8-4a158c9f5d59?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY0dyb3VwT3BlcmF0aW9uUmVzdWx0cy9jNDlhOTA2Ny1lODAxLTRhODgtYWFiOC00YTE1OGM5ZjVkNTk/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"interval\": -1,\r\n \"lastSyncTime\": \"0001-01-01T00:00:00Z\",\r\n \"conflictResolutionPolicy\": \"MemberWin\",\r\n \"syncDatabaseId\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-sync9829\",\r\n \"syncState\": \"Good\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330\",\r\n \"name\": \"syncmembercrudtest-syncgroup5330\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "642" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:37:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "30984a99-ab43-42fa-a3ca-50c943e48634" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14948" + ], + "x-ms-correlation-request-id": [ + "791965f0-b5a2-4c90-983d-8fa1b42cc753" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083744Z:791965f0-b5a2-4c90-983d-8fa1b42cc753" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MT9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"databaseType\": \"AzureSqlDatabase\",\r\n \"serverName\": \"sqlcrudtest-4615\",\r\n \"databaseName\": \"syncmembercrudtest-member6411\",\r\n \"userName\": \"dummylogin\",\r\n \"password\": \"Un53cuRE!\",\r\n \"syncDirection\": \"OneWayMemberToHub\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "265" + ], + "x-ms-client-request-id": [ + "d406b4a8-9320-4598-b86b-6c4ad81db06e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertSyncMember\",\r\n \"startTime\": \"2017-08-14T08:37:46.253Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "71" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:37:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncMemberOperationResults/c293ec06-076d-4a8c-8abe-66af795c9a69?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "c293ec06-076d-4a8c-8abe-66af795c9a69" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "7618c5d1-c26f-45d2-84d3-4b08046a7bbc" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083745Z:7618c5d1-c26f-45d2-84d3-4b08046a7bbc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncMemberOperationResults/c293ec06-076d-4a8c-8abe-66af795c9a69?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY01lbWJlck9wZXJhdGlvblJlc3VsdHMvYzI5M2VjMDYtMDc2ZC00YThjLThhYmUtNjZhZjc5NWM5YTY5P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"databaseType\": \"AzureSqlDatabase\",\r\n \"serverName\": \"sqlcrudtest-4615\",\r\n \"databaseName\": \"syncmembercrudtest-member6411\",\r\n \"syncDirection\": \"OneWayMemberToHub\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971\",\r\n \"name\": \"syncmembercrudtest-azsyncmember2971\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups/syncMembers\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "554" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "d993d4cc-f6a8-4958-aace-77c35f6864ae" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "10f9fd60-7a64-4eb7-b316-cd54e6720202" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083816Z:10f9fd60-7a64-4eb7-b316-cd54e6720202" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MT9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "63566521-b780-4c5c-b8fc-8b03be1f339e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"databaseType\": \"AzureSqlDatabase\",\r\n \"serverName\": \"sqlcrudtest-4615\",\r\n \"databaseName\": \"syncmembercrudtest-member6411\",\r\n \"userName\": \"dummylogin\",\r\n \"syncDirection\": \"OneWayMemberToHub\",\r\n \"syncState\": \"UnProvisioned\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971\",\r\n \"name\": \"syncmembercrudtest-azsyncmember2971\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups/syncMembers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1733fbdd-4b65-4af6-b19e-3725551ea546" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14946" + ], + "x-ms-correlation-request-id": [ + "f8b49669-4058-4887-aee9-1c4ca32a1a9c" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083817Z:f8b49669-4058-4887-aee9-1c4ca32a1a9c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycz9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b82e02d3-9b9c-42ad-98b9-ff9fb37a5b3e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"databaseType\": \"AzureSqlDatabase\",\r\n \"serverName\": \"sqlcrudtest-4615\",\r\n \"databaseName\": \"syncmembercrudtest-member6411\",\r\n \"userName\": \"dummylogin\",\r\n \"syncDirection\": \"OneWayMemberToHub\",\r\n \"syncState\": \"UnProvisioned\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971\",\r\n \"name\": \"syncmembercrudtest-azsyncmember2971\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups/syncMembers\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e0264b7b-5678-4735-a6ef-5b3b093d1789" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14945" + ], + "x-ms-correlation-request-id": [ + "fe4d6d47-ca12-4b78-98a3-3a759599db04" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083817Z:fe4d6d47-ca12-4b78-98a3-3a759599db04" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MT9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"databaseType\": \"AzureSqlDatabase\",\r\n \"userName\": \"dummylogin\",\r\n \"password\": \"Un53cuRE!\",\r\n \"syncDirection\": \"Bidirectional\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "168" + ], + "x-ms-client-request-id": [ + "28347f90-26aa-4371-ae0f-f00ec0ebd956" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertSyncMember\",\r\n \"startTime\": \"2017-08-14T08:38:17.91Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "70" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncMemberOperationResults/5f430b99-29a3-4bbe-9a7c-30464d102da3?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "5f430b99-29a3-4bbe-9a7c-30464d102da3" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "1fbe325a-7245-4f4b-b6ee-4847bc51b15f" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083817Z:1fbe325a-7245-4f4b-b6ee-4847bc51b15f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MT9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "9589f292-2a84-4d9b-8fcb-5b889f50d8be" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidSyncMemberCreateOrUpdateRequest\",\r\n \"message\": \"The create or update sync member request body is empty.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "127" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:47 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "bdad2d34-d412-4a5a-9e9f-03f019855cee" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-correlation-request-id": [ + "bbd8cb14-ed63-4485-b476-1ccb61d8b8cc" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083847Z:bbd8cb14-ed63-4485-b476-1ccb61d8b8cc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 400 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncMemberOperationResults/5f430b99-29a3-4bbe-9a7c-30464d102da3?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY01lbWJlck9wZXJhdGlvblJlc3VsdHMvNWY0MzBiOTktMjlhMy00YmJlLTlhN2MtMzA0NjRkMTAyZGEzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {\r\n \"databaseType\": \"AzureSqlDatabase\",\r\n \"syncDirection\": \"Bidirectional\"\r\n },\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971\",\r\n \"name\": \"syncmembercrudtest-azsyncmember2971\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups/syncMembers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:47 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "aa01ded3-43a4-4834-88c4-b13a7a958d5b" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14944" + ], + "x-ms-correlation-request-id": [ + "03e85b44-85f7-40fc-8aef-4ee9c6cc250d" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083847Z:03e85b44-85f7-40fc-8aef-4ee9c6cc250d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971/refreshSchema?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MS9yZWZyZXNoU2NoZW1hP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "12f5b9a5-ba2a-41b1-8f85-8b1c5ccb8382" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"RefrehSyncMemberSchema\",\r\n \"startTime\": \"2017-08-14T08:38:48.493Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "77" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:38:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971/refreshSchemaOperationResults/bd4f01cd-0417-40b9-84d4-df241d8cd6a8?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "bd4f01cd-0417-40b9-84d4-df241d8cd6a8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-correlation-request-id": [ + "765758ab-1cfc-4205-abab-f1e8f6409932" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083848Z:765758ab-1cfc-4205-abab-f1e8f6409932" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971/refreshSchemaOperationResults/bd4f01cd-0417-40b9-84d4-df241d8cd6a8?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MS9yZWZyZXNoU2NoZW1hT3BlcmF0aW9uUmVzdWx0cy9iZDRmMDFjZC0wNDE3LTQwYjktODRkNC1kZjI0MWQ4Y2Q2YTg/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "7f66c147-b08b-494a-bf79-eec167c1a5eb" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14943" + ], + "x-ms-correlation-request-id": [ + "ed0aab2c-dae7-46a0-b52e-f888786c79f8" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083918Z:ed0aab2c-dae7-46a0-b52e-f888786c79f8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971/schemas?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MS9zY2hlbWFzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6e9443cc-97a0-43b5-95eb-fd1930f70779" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "6abc3518-ace8-47d6-93bc-04ea68245d1a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14942" + ], + "x-ms-correlation-request-id": [ + "a2b1796a-973f-43f4-ae32-6876f957336a" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083918Z:a2b1796a-973f-43f4-ae32-6876f957336a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTE1NTUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC00NjE1L2RhdGFiYXNlcy9zeW5jbWVtYmVyY3J1ZHRlc3QtdGVzdDg5MzUvc3luY0dyb3Vwcy9zeW5jbWVtYmVyY3J1ZHRlc3Qtc3luY2dyb3VwNTMzMC9zeW5jTWVtYmVycy9zeW5jbWVtYmVyY3J1ZHRlc3QtYXpzeW5jbWVtYmVyMjk3MT9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8d24bcc5-4f76-456d-a446-a27adbfc0c3b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"DropSyncMember\",\r\n \"startTime\": \"2017-08-14T08:39:19.263Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "69" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncMemberOperationResults/2043d37a-c1f4-42c4-b3fe-0e1ca3c3bc89?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "2043d37a-c1f4-42c4-b3fe-0e1ca3c3bc89" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1188" + ], + "x-ms-correlation-request-id": [ + "516af4da-7252-42d7-a150-aa4db19f174e" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083919Z:516af4da-7252-42d7-a150-aa4db19f174e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/providers/Microsoft.Sql/locations/Japan%20East/syncMemberOperationResults/2043d37a-c1f4-42c4-b3fe-0e1ca3c3bc89?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy9KYXBhbiUyMEVhc3Qvc3luY01lbWJlck9wZXJhdGlvblJlc3VsdHMvMjA0M2QzN2EtYzFmNC00MmM0LWIzZmUtMGUxY2EzYzNiYzg5P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.7.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"\",\r\n \"properties\": {},\r\n \"id\": \"/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourceGroups/sqlcrudtest-1555/providers/Microsoft.Sql/servers/sqlcrudtest-4615/databases/syncmembercrudtest-test8935/syncGroups/syncmembercrudtest-syncgroup5330/syncMembers/syncmembercrudtest-azsyncmember2971\",\r\n \"name\": \"syncmembercrudtest-azsyncmember2971\",\r\n \"type\": \"Microsoft.Sql/servers/databases/syncGroups/syncMembers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c6516385-d78c-4c5a-97fd-9b28268aab3f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14940" + ], + "x-ms-correlation-request-id": [ + "4d0cf030-569d-49de-8c9e-22e27df77a4c" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083949Z:4d0cf030-569d-49de-8c9e-22e27df77a4c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/resourcegroups/sqlcrudtest-1555?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZDhkY2Q1OGItZTIyZC00M2U3LWE5N2YtMTVmYTI5ZDhjOGVhL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTE1NTU/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1ba8940c-07e3-45d6-a1bf-b475e1eade9d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 14 Aug 2017 08:39:51 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDE1NTUtSkFQQU5FQVNUIiwiam9iTG9jYXRpb24iOiJqYXBhbmVhc3QifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-request-id": [ + "6b84c351-a9a7-4582-949e-3b95d2e268dc" + ], + "x-ms-correlation-request-id": [ + "6b84c351-a9a7-4582-949e-3b95d2e268dc" + ], + "x-ms-routing-request-id": [ + "AUSTRALIASOUTHEAST:20170814T083952Z:6b84c351-a9a7-4582-949e-3b95d2e268dc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-1555" + ], + "CreateServer": [ + "sqlcrudtest-4615" + ], + "SyncMemberCRUDTest": [ + "syncmembercrudtest-sync9829", + "syncmembercrudtest-test8935", + "syncmembercrudtest-member6411", + "syncmembercrudtest-syncgroup5330", + "syncmembercrudtest-azsyncmember2971" + ] + }, + "Variables": { + "DefaultLocation": "Japan East", + "SubscriptionId": "d8dcd58b-e22d-43e7-a97f-15fa29d8c8ea" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SyncAgentScenarioTests.cs b/src/SDKs/SqlManagement/Sql.Tests/SyncAgentScenarioTests.cs new file mode 100644 index 000000000000..28a17e8bfaa3 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SyncAgentScenarioTests.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Azure.Management.Sql.Models; +using Microsoft.Azure.Management.ResourceManager; +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Azure.Management.Sql; +using Microsoft.Rest.Azure; +using Xunit; + +namespace Sql.Tests +{ + public class SyncAgentScenarioTests + { + [Fact] + public void SyncAgentCRUDTest() + { + string testPrefix = "syncagentcrudtest-"; + + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + SqlManagementClient sqlClient = context.GetClient(); + Server server = context.CreateServer(resourceGroup); + + // Create database + string dbName = SqlManagementTestUtilities.GenerateName(testPrefix); + Database db = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, dbName, new Database() + { + Location = server.Location, + }); + Assert.NotNull(db); + Assert.NotNull(db.Id); + + // Create sync agent + string agentName = SqlManagementTestUtilities.GenerateName("syncagentcrudtest"); + SyncAgent createAgent = sqlClient.SyncAgents.CreateOrUpdate(resourceGroup.Name, server.Name, agentName, new SyncAgent + { + SyncDatabaseId = db.Id + }); + Assert.NotNull(createAgent); + + // Get sync agent + SyncAgent getAgent = sqlClient.SyncAgents.Get(resourceGroup.Name, server.Name, agentName); + Assert.NotNull(getAgent); + + // List sync agent + IPage listAgents = sqlClient.SyncAgents.ListByServer(resourceGroup.Name, server.Name); + Assert.Equal(1, listAgents.Count()); + Assert.Equal(agentName, listAgents.Single().Name); + + // Generate key + SyncAgentKeyProperties agentKey = sqlClient.SyncAgents.GenerateKey(resourceGroup.Name, server.Name, agentName); + Assert.NotNull(agentKey); + Assert.NotNull(agentKey.SyncAgentKey); + + // Regenerate key + SyncAgentKeyProperties agentKey2 = sqlClient.SyncAgents.GenerateKey(resourceGroup.Name, server.Name, agentName); + Assert.NotNull(agentKey2); + Assert.NotNull(agentKey2.SyncAgentKey); + + // Get linked databases + IPage linkedDatabases = sqlClient.SyncAgents.ListLinkedDatabases(resourceGroup.Name, server.Name, agentName); + Assert.NotNull(linkedDatabases); + Assert.Equal(0, linkedDatabases.Count()); + + // Delete the sync agent + sqlClient.SyncAgents.Delete(resourceGroup.Name, server.Name, agentName); + } + } + } +} diff --git a/src/SDKs/SqlManagement/Sql.Tests/SyncGroupScenarioTests.cs b/src/SDKs/SqlManagement/Sql.Tests/SyncGroupScenarioTests.cs new file mode 100644 index 000000000000..529e1cb201cf --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SyncGroupScenarioTests.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Linq; +using Microsoft.Azure.Management.Sql.Models; +using Microsoft.Azure.Management.ResourceManager; +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Azure.Management.Sql; +using Xunit; +using Microsoft.Rest.Azure; + +namespace Sql.Tests +{ + public class SyncGroupScenarioTests + { + [Fact] + public void SyncGroupCRUDTest() + { + string testPrefix = "syncgroupcrudtest-"; + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + SqlManagementClient sqlClient = context.GetClient(); + Server server = context.CreateServer(resourceGroup); + + // Create sync database + string syncDatabaseName = SqlManagementTestUtilities.GenerateName(testPrefix + "sync"); + Database syncDatabase = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, syncDatabaseName, new Database() + { + Location = server.Location, + }); + Assert.NotNull(syncDatabase); + Assert.NotNull(syncDatabase.Id); + + // Create database + string testDatabaseName = SqlManagementTestUtilities.GenerateName(testPrefix + "test"); + Database testDatabase = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, testDatabaseName, new Database() + { + Location = server.Location, + }); + Assert.NotNull(testDatabase); + + // Create sync group + string syncGroupName = SqlManagementTestUtilities.GenerateName(testPrefix + "syncgroup"); + int interval1 = -1; // Manual + string conflictPolicy = SyncConflictResolutionPolicy.MemberWin; + SyncGroup createSyncGroup = sqlClient.SyncGroups.CreateOrUpdate(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, new SyncGroup + { + Interval = interval1, + ConflictResolutionPolicy = conflictPolicy, + SyncDatabaseId = syncDatabase.Id, + HubDatabaseUserName = SqlManagementTestUtilities.DefaultLogin, + HubDatabasePassword = SqlManagementTestUtilities.DefaultPassword + }); + Assert.NotNull(createSyncGroup); + Assert.Equal(interval1, createSyncGroup.Interval); + Assert.Equal(conflictPolicy, createSyncGroup.ConflictResolutionPolicy); + Assert.Equal(syncDatabase.Id, createSyncGroup.SyncDatabaseId); + + // Get sync group + SyncGroup getSyncGroup = sqlClient.SyncGroups.Get(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName); + Assert.NotNull(getSyncGroup); + Assert.Equal(interval1, getSyncGroup.Interval); + Assert.Equal(conflictPolicy, getSyncGroup.ConflictResolutionPolicy); + Assert.Equal(syncDatabase.Id, getSyncGroup.SyncDatabaseId); + + // List sync group + IPage listSyncGroups = sqlClient.SyncGroups.ListByDatabase(resourceGroup.Name, server.Name, testDatabaseName); + Assert.NotNull(listSyncGroups); + Assert.Equal(1, listSyncGroups.Count()); + Assert.Equal(syncGroupName, listSyncGroups.Single().Name); + + // Update sync group + int interval2 = 600; + SyncGroup updateSyncGroup = sqlClient.SyncGroups.Update(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, new SyncGroup + { + Interval = interval2 + }); + Assert.NotNull(updateSyncGroup); + Assert.Equal(interval2, updateSyncGroup.Interval); + + // Get updated sync group + SyncGroup getUpdatedSyncGroup = sqlClient.SyncGroups.Get(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName); + Assert.NotNull(getUpdatedSyncGroup); + Assert.Equal(interval2, getUpdatedSyncGroup.Interval); + Assert.Equal(conflictPolicy, getUpdatedSyncGroup.ConflictResolutionPolicy); + Assert.Equal(syncDatabase.Id, getUpdatedSyncGroup.SyncDatabaseId); + + // Update sync group with an empty model + Assert.Throws(() => + { + sqlClient.SyncGroups.Update(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, new SyncGroup()); + }); + + // Refresh hub schema + sqlClient.SyncGroups.RefreshHubSchema(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName); + + // List hub schemas + IPage listHubSchemas = sqlClient.SyncGroups.ListHubSchemas(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName); + Assert.NotNull(listHubSchemas); + + // List logs + string startTime = "2017-01-01T00:00:00"; + string endTime = "2099-12-31T00:00:00"; + + string logType = SyncGroupLogType.All; + IPage listLogs = sqlClient.SyncGroups.ListLogs(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, startTime, endTime, logType); + Assert.NotNull(listLogs); + foreach(SyncGroupLogProperties log in listLogs) + { + Assert.NotNull(log); + Assert.NotNull(log.Timestamp); + Assert.NotNull(log.Type); + Assert.NotNull(log.Details); + Assert.NotNull(log.Source); + } + + // Delete sync group + sqlClient.SyncGroups.Delete(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName); + } + } + } +} diff --git a/src/SDKs/SqlManagement/Sql.Tests/SyncMemberScenarioTests.cs b/src/SDKs/SqlManagement/Sql.Tests/SyncMemberScenarioTests.cs new file mode 100644 index 000000000000..5ee8ddcfed88 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SyncMemberScenarioTests.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Linq; +using Microsoft.Azure.Management.Sql.Models; +using Microsoft.Azure.Management.ResourceManager; +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Azure.Management.Sql; +using Xunit; +using Microsoft.Rest.Azure; + +namespace Sql.Tests +{ + public class SyncMemberScenarioTests + { + [Fact] + public void SyncMemberCRUDTest() + { + string testPrefix = "syncmembercrudtest-"; + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + SqlManagementClient sqlClient = context.GetClient(); + Server server = context.CreateServer(resourceGroup); + + // Create sync database + string syncDatabaseName = SqlManagementTestUtilities.GenerateName(testPrefix + "sync"); + Database syncDatabase = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, syncDatabaseName, new Database() + { + Location = server.Location, + }); + Assert.NotNull(syncDatabase); + Assert.NotNull(syncDatabase.Id); + + // Create database + string testDatabaseName = SqlManagementTestUtilities.GenerateName(testPrefix + "test"); + Database testDatabase = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, testDatabaseName, new Database() + { + Location = server.Location, + }); + Assert.NotNull(testDatabase); + + // Create member database + string memberDatabaseName = SqlManagementTestUtilities.GenerateName(testPrefix + "member"); + Database memberDatabase = sqlClient.Databases.CreateOrUpdate(resourceGroup.Name, server.Name, memberDatabaseName, new Database() + { + Location = server.Location, + }); + Assert.NotNull(memberDatabase); + + // Create sync group + string syncGroupName = SqlManagementTestUtilities.GenerateName(testPrefix + "syncgroup"); + SyncGroup createSyncGroup = sqlClient.SyncGroups.CreateOrUpdate(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, new SyncGroup + { + Interval = -1, // Manual + ConflictResolutionPolicy = SyncConflictResolutionPolicy.MemberWin, + SyncDatabaseId = syncDatabase.Id, + HubDatabaseUserName = SqlManagementTestUtilities.DefaultLogin, + HubDatabasePassword = SqlManagementTestUtilities.DefaultPassword + }); + Assert.NotNull(createSyncGroup); + + #region Azure SQL database member + + // Create an Azure SQL database member + string syncMemberName = SqlManagementTestUtilities.GenerateName(testPrefix + "azsyncmember"); + string syncMemberDirection = SyncDirection.OneWayMemberToHub; + string syncMemberDatabaseType = SyncMemberDbType.AzureSqlDatabase; + SyncMember createSyncMember = sqlClient.SyncMembers.CreateOrUpdate(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName, new SyncMember + { + SyncDirection = syncMemberDirection, + DatabaseType = syncMemberDatabaseType, + DatabaseName = memberDatabaseName, + ServerName = server.Name, + UserName = SqlManagementTestUtilities.DefaultLogin, + Password = SqlManagementTestUtilities.DefaultPassword, + }); + Assert.NotNull(createSyncMember); + Assert.Equal(syncMemberDirection, createSyncMember.SyncDirection); + Assert.Equal(syncMemberDatabaseType, createSyncMember.DatabaseType); + Assert.Equal(memberDatabaseName, createSyncMember.DatabaseName); + Assert.Equal(server.Name, createSyncMember.ServerName); + + // Get Azure SQL database member + SyncMember getSyncMember = sqlClient.SyncMembers.Get(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName); + Assert.NotNull(getSyncMember); + Assert.Equal(syncMemberDirection, getSyncMember.SyncDirection); + Assert.Equal(syncMemberDatabaseType, getSyncMember.DatabaseType); + Assert.Equal(memberDatabaseName, getSyncMember.DatabaseName); + Assert.Equal(server.Name, getSyncMember.ServerName); + + // List sync members + IPage listSyncMembers = sqlClient.SyncMembers.ListBySyncGroup(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName); + Assert.NotNull(listSyncMembers); + Assert.Equal(1, listSyncMembers.Count()); + Assert.Equal(syncMemberName, listSyncMembers.Single().Name); + + // Update sync member + string updateSyncMemberDirection = SyncDirection.Bidirectional; + SyncMember updateSyncMember = sqlClient.SyncMembers.Update(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName, new SyncMember + { + SyncDirection = updateSyncMemberDirection, + DatabaseType = syncMemberDatabaseType, + UserName = SqlManagementTestUtilities.DefaultLogin, + Password = SqlManagementTestUtilities.DefaultPassword, + }); + Assert.NotNull(updateSyncMember); + Assert.Equal(updateSyncMemberDirection, updateSyncMember.SyncDirection); + Assert.NotEqual(syncMemberDirection, updateSyncMemberDirection); + + // Update sync member with an empty model + Assert.Throws(() => + { + sqlClient.SyncMembers.Update(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName, new SyncMember()); + }); + + // Refresh member schemas + sqlClient.SyncMembers.RefreshMemberSchema(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName); + + // List member schemas + IPage memberSchemas = sqlClient.SyncMembers.ListMemberSchemas(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName); + Assert.NotNull(memberSchemas); + + // Delete Azure SQL database member + sqlClient.SyncMembers.Delete(resourceGroup.Name, server.Name, testDatabaseName, syncGroupName, syncMemberName); + + #endregion + } + } + } +} diff --git a/src/SDKs/_metadata/sql_resource-manager.txt b/src/SDKs/_metadata/sql_resource-manager.txt index 1ad965c45108..fea5e5db2f24 100644 --- a/src/SDKs/_metadata/sql_resource-manager.txt +++ b/src/SDKs/_metadata/sql_resource-manager.txt @@ -1,12 +1,9 @@ - -Type dsc to start/install the DS Consolidated Console - -2017-07-29 00:52:10 UTC +2017-08-14 00:24:09 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: current -Commit: 6bf28d24c6a153a071eac4e3ee8d4e49ae3b048b +Commit: e5ad3c65d448dd92b0f1637cdd994b581cc6bab7 2) AutoRest information Requested version: latest