/// <summary>
 /// Initializes a new instance of the SqlManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public SqlManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._auditingPolicy                       = new AuditingPolicyOperations(this);
     this._capabilities                         = new CapabilitiesOperations(this);
     this._databaseActivation                   = new DatabaseActivationOperations(this);
     this._databaseBackup                       = new DatabaseBackupOperations(this);
     this._databases                            = new DatabaseOperations(this);
     this._dataMasking                          = new DataMaskingOperations(this);
     this._elasticPools                         = new ElasticPoolOperations(this);
     this._firewallRules                        = new FirewallRuleOperations(this);
     this._recommendedElasticPools              = new RecommendedElasticPoolOperations(this);
     this._recommendedIndexes                   = new RecommendedIndexOperations(this);
     this._databaseReplicationLinks             = new ReplicationLinkOperations(this);
     this._secureConnection                     = new SecureConnectionPolicyOperations(this);
     this._securityAlertPolicy                  = new SecurityAlertPolicyOperations(this);
     this._serverAdministrators                 = new ServerAdministratorOperations(this);
     this._communicationLinks                   = new ServerCommunicationLinkOperations(this);
     this._serverDisasterRecoveryConfigurations = new ServerDisasterRecoveryConfigurationOperations(this);
     this._servers                            = new ServerOperations(this);
     this._serverUpgrades                     = new ServerUpgradeOperations(this);
     this._serviceObjectives                  = new ServiceObjectiveOperations(this);
     this._serviceTierAdvisors                = new ServiceTierAdvisorOperations(this);
     this._transparentDataEncryption          = new TransparentDataEncryptionOperations(this);
     this._apiVersion                         = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Deletes the Azure SQL Database Replication Link with the given id.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IReplicationLinkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the Azure SQL
 /// Server belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Server on which the Azure SQL
 /// Database is hosted.
 /// </param>
 /// <param name='databaseName'>
 /// Required. The name of the Azure SQL Database that has the
 /// replication link to be dropped.
 /// </param>
 /// <param name='linkId'>
 /// Required. The id of the replication link to be deleted.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this IReplicationLinkOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IReplicationLinkOperations)s).DeleteAsync(resourceGroupName, serverName, databaseName, linkId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns information about Azure SQL Database Replication Links.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IReplicationLinkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Server in which the Azure SQL
 /// Database is hosted.
 /// </param>
 /// <param name='databaseName'>
 /// Required. The name of the Azure SQL Database to retrieve links for.
 /// </param>
 /// <returns>
 /// Represents the response to a List Azure Sql Database Replication
 /// Link request.
 /// </returns>
 public static Task <ReplicationLinkListResponse> ListAsync(this IReplicationLinkOperations operations, string resourceGroupName, string serverName, string databaseName)
 {
     return(operations.ListAsync(resourceGroupName, serverName, databaseName, CancellationToken.None));
 }
 /// <summary>
 /// Deletes the Azure SQL Database Replication Link with the given id.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IReplicationLinkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the Azure SQL
 /// Server belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Server on which the Azure SQL
 /// Database is hosted.
 /// </param>
 /// <param name='databaseName'>
 /// Required. The name of the Azure SQL Database that has the
 /// replication link to be dropped.
 /// </param>
 /// <param name='linkId'>
 /// Required. The id of the replication link to be deleted.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IReplicationLinkOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId)
 {
     return(operations.DeleteAsync(resourceGroupName, serverName, databaseName, linkId, CancellationToken.None));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the status of an Azure SQL Database replication link failover
 /// operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IReplicationLinkOperations.
 /// </param>
 /// <param name='operationStatusLink'>
 /// Required. Location value returned by the Begin operation
 /// </param>
 /// <returns>
 /// Response for long running Azure Sql Database replication failover
 /// operations.
 /// </returns>
 public static Task <ReplicationLinkFailoverResponse> GetReplicationLinkOperationStatusAsync(this IReplicationLinkOperations operations, string operationStatusLink)
 {
     return(operations.GetReplicationLinkOperationStatusAsync(operationStatusLink, CancellationToken.None));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the status of an Azure SQL Database replication link failover
 /// operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IReplicationLinkOperations.
 /// </param>
 /// <param name='operationStatusLink'>
 /// Required. Location value returned by the Begin operation
 /// </param>
 /// <returns>
 /// Response for long running Azure Sql Database replication failover
 /// operations.
 /// </returns>
 public static ReplicationLinkFailoverResponse GetReplicationLinkOperationStatus(this IReplicationLinkOperations operations, string operationStatusLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IReplicationLinkOperations)s).GetReplicationLinkOperationStatusAsync(operationStatusLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Forces failover of the Azure SQL Database Replication Link with the
 /// given id which may result in data loss.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IReplicationLinkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the Azure SQL
 /// Server belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Server on which the Azure SQL
 /// Database is hosted.
 /// </param>
 /// <param name='databaseName'>
 /// Required. The name of the Azure SQL Database that has the
 /// replication link to be failed over.
 /// </param>
 /// <param name='linkId'>
 /// Required. The id of the replication link to be failed over.
 /// </param>
 /// <returns>
 /// Response for long running Azure Sql Database replication failover
 /// operations.
 /// </returns>
 public static Task <ReplicationLinkFailoverResponse> FailoverAllowDataLossAsync(this IReplicationLinkOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId)
 {
     return(operations.FailoverAllowDataLossAsync(resourceGroupName, serverName, databaseName, linkId, CancellationToken.None));
 }