/// <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> /// Begins creating a new Azure SQL Database Elastic Pool or updating /// an existing Azure SQL Database Elastic Pool. To determine the /// status of the operation call GetElasticPoolOperationStatus. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Database Server belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Database Server on which the /// database is hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Database Elastic Pool to be /// operated on (Updated or created). /// </param> /// <param name='parameters'> /// Required. The required parameters for createing or updating an /// Elastic Pool. /// </param> /// <returns> /// Response for long running Azure Sql Database Elastic Pool operation. /// </returns> public static ElasticPoolCreateOrUpdateResponse BeginCreateOrUpdate(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolCreateOrUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IElasticPoolOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, serverName, elasticPoolName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Returns information about Azure SQL Database Elastic Pools. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Database Serve belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Server in which Azure SQL /// Database Elastic Pools are hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Elastic Pool for which to get /// the metrics. /// </param> /// <param name='nameFilter'> /// Required. The filter to apply on the name of the metrics. /// </param> /// <param name='timeGrain'> /// Required. The time granularity of the metric to retrieve. /// </param> /// <param name='startTime'> /// Required. The start time for the interval. /// </param> /// <param name='endTime'> /// Required. The end time for the interval. /// </param> /// <returns> /// Represents Azure SQL Database Elastic Pool metrics. /// </returns> public static ElasticPoolMetrics ListMetrics(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string nameFilter, string timeGrain, string startTime, string endTime) { return(Task.Factory.StartNew((object s) => { return ((IElasticPoolOperations)s).ListMetricsAsync(resourceGroupName, serverName, elasticPoolName, nameFilter, timeGrain, startTime, endTime); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Returns information about an Azure SQL Database inside of an Azure /// Sql Database Elastic Pool. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </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 Database Server on which the /// database is hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Database Elastic Pool to be /// retrieved. /// </param> /// <returns> /// Represents the response to a List Azure Sql Database request. /// </returns> public static DatabaseListResponse ListDatabases(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName) { return(Task.Factory.StartNew((object s) => { return ((IElasticPoolOperations)s).ListDatabasesAsync(resourceGroupName, serverName, elasticPoolName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <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._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._secureConnection = new SecureConnectionPolicyOperations(this); this._servers = new ServerOperations(this); this._serviceObjectives = new ServiceObjectiveOperations(this); this._apiVersion = "2014-04-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the SqlManagementClient class. /// </summary> public SqlManagementClient() : base() { this._auditingPolicy = new AuditingPolicyOperations(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._secureConnection = new SecureConnectionPolicyOperations(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> /// Returns information about an Azure SQL Database Elastic Pool. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Database Server belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Database Server on which the /// Azure SQL Database Elastic Pool is hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Database Elastic Pool to be /// retrieved. /// </param> /// <returns> /// Represents the response to a Get Azure Sql Elastic Pool request. /// </returns> public static Task <ElasticPoolGetResponse> GetAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName) { return(operations.GetAsync(resourceGroupName, serverName, elasticPoolName, CancellationToken.None)); }
/// <summary> /// Gets a list of operations performed on the elastic pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <ElasticPoolOperation> ListByElasticPoolNext(this IElasticPoolOperations operations, string nextPageLink) { return(operations.ListByElasticPoolNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Returns information about Azure SQL Database Elastic Pools. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Database Serve belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Server in which Azure SQL /// Database Elastic Pools are hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Elastic Pool for which to get /// the metrics. /// </param> /// <param name='nameFilter'> /// Required. The filter to apply on the name of the metrics. /// </param> /// <param name='timeGrain'> /// Required. The time granularity of the metric to retrieve. /// </param> /// <param name='startTime'> /// Required. The start time for the interval. /// </param> /// <param name='endTime'> /// Required. The end time for the interval. /// </param> /// <returns> /// Represents Azure SQL Database Elastic Pool metrics. /// </returns> public static Task <ElasticPoolMetrics> ListMetricsAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, string nameFilter, string timeGrain, string startTime, string endTime) { return(operations.ListMetricsAsync(resourceGroupName, serverName, elasticPoolName, nameFilter, timeGrain, startTime, endTime, CancellationToken.None)); }
/// <summary> /// Cancels the asynchronous operation on the elastic pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='elasticPoolName'> /// </param> /// <param name='operationId'> /// The operation identifier. /// </param> public static void Cancel(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, System.Guid operationId) { operations.CancelAsync(resourceGroupName, serverName, elasticPoolName, operationId).GetAwaiter().GetResult(); }
/// <summary> /// Returns information about metrics defined on a Azure SQL Database /// Elastic Pool. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Database Serve belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Server in which Azure SQL /// Database Elastic Pools are hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Elastic Pool for which to get /// the metrics. /// </param> /// <returns> /// Represents Azure SQL Database Elastic Pool metric definitions. /// </returns> public static Task <ElasticPoolMetricDefinitions> ListMetricDefinitionsAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName) { return(operations.ListMetricDefinitionsAsync(resourceGroupName, serverName, elasticPoolName, CancellationToken.None)); }
/// <summary> /// Gets a list of operations performed on the elastic pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='elasticPoolName'> /// </param> public static IPage <ElasticPoolOperation> ListByElasticPool(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName) { return(operations.ListByElasticPoolAsync(resourceGroupName, serverName, elasticPoolName).GetAwaiter().GetResult()); }
/// <summary> /// Returns information about an Azure SQL Database inside of an Azure /// Sql Database Elastic Pool. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </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 Database Server on which the /// database is hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Database Elastic Pool to be /// retrieved. /// </param> /// <returns> /// Represents the response to a List Azure Sql Database request. /// </returns> public static Task <DatabaseListResponse> ListDatabasesAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName) { return(operations.ListDatabasesAsync(resourceGroupName, serverName, elasticPoolName, CancellationToken.None)); }
/// <summary> /// Gets the status of an Azure Sql Database Elastic Pool create or /// update operation. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='operationStatusLink'> /// Required. Location value returned by the Begin operation /// </param> /// <returns> /// Response for long running Azure Sql Database Elastic Pool operation. /// </returns> public static ElasticPoolCreateOrUpdateResponse GetElasticPoolOperationStatus(this IElasticPoolOperations operations, string operationStatusLink) { return(Task.Factory.StartNew((object s) => { return ((IElasticPoolOperations)s).GetElasticPoolOperationStatusAsync(operationStatusLink); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the status of an Azure Sql Database Elastic Pool create or /// update operation. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='operationStatusLink'> /// Required. Location value returned by the Begin operation /// </param> /// <returns> /// Response for long running Azure Sql Database Elastic Pool operation. /// </returns> public static Task <ElasticPoolCreateOrUpdateResponse> GetElasticPoolOperationStatusAsync(this IElasticPoolOperations operations, string operationStatusLink) { return(operations.GetElasticPoolOperationStatusAsync(operationStatusLink, CancellationToken.None)); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { BackupLongTermRetentionPolicies = new BackupLongTermRetentionPoliciesOperations(this); BackupLongTermRetentionVaults = new BackupLongTermRetentionVaultsOperations(this); RecoverableDatabases = new RecoverableDatabasesOperations(this); RestorableDroppedDatabases = new RestorableDroppedDatabasesOperations(this); Capabilities = new CapabilitiesOperations(this); Servers = new ServersOperations(this); ServerConnectionPolicies = new ServerConnectionPoliciesOperations(this); Databases = new DatabasesOperations(this); DatabaseThreatDetectionPolicies = new DatabaseThreatDetectionPoliciesOperations(this); DataMaskingPolicies = new DataMaskingPoliciesOperations(this); DataMaskingRules = new DataMaskingRulesOperations(this); ElasticPools = new ElasticPoolsOperations(this); FirewallRules = new FirewallRulesOperations(this); GeoBackupPolicies = new GeoBackupPoliciesOperations(this); ReplicationLinks = new ReplicationLinksOperations(this); ServerAzureADAdministrators = new ServerAzureADAdministratorsOperations(this); ServerCommunicationLinks = new ServerCommunicationLinksOperations(this); ServiceObjectives = new ServiceObjectivesOperations(this); ElasticPoolActivities = new ElasticPoolActivitiesOperations(this); ElasticPoolDatabaseActivities = new ElasticPoolDatabaseActivitiesOperations(this); RecommendedElasticPools = new RecommendedElasticPoolsOperations(this); ServiceTierAdvisors = new ServiceTierAdvisorsOperations(this); TransparentDataEncryptions = new TransparentDataEncryptionsOperations(this); TransparentDataEncryptionActivities = new TransparentDataEncryptionActivitiesOperations(this); ServerUsages = new ServerUsagesOperations(this); DatabaseUsages = new DatabaseUsagesOperations(this); DatabaseBlobAuditingPolicies = new DatabaseBlobAuditingPoliciesOperations(this); DatabaseAutomaticTuning = new DatabaseAutomaticTuningOperations(this); EncryptionProtectors = new EncryptionProtectorsOperations(this); FailoverGroups = new FailoverGroupsOperations(this); Operations = new Operations(this); ServerKeys = new ServerKeysOperations(this); SyncAgents = new SyncAgentsOperations(this); SyncGroups = new SyncGroupsOperations(this); SyncMembers = new SyncMembersOperations(this); SubscriptionUsages = new SubscriptionUsagesOperations(this); VirtualNetworkRules = new VirtualNetworkRulesOperations(this); ServerAutomaticTuning = new ServerAutomaticTuningOperations(this); ServerDnsAliases = new ServerDnsAliasesOperations(this); RestorePoints = new RestorePointsOperations(this); DatabaseOperations = new DatabaseOperations(this); ElasticPoolOperations = new ElasticPoolOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Creates a new Azure SQL Database Elastic Pool or updates an /// existing Azure SQL Database Elastic Pool. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IElasticPoolOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Database Server belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Database Server on which the /// Azure SQL Database Elastic Pool is hosted. /// </param> /// <param name='elasticPoolName'> /// Required. The name of the Azure SQL Database Elastic Pool to be /// operated on (updated or created). /// </param> /// <param name='parameters'> /// Required. The required parameters for createing or updating an /// Azure Sql Databaser Elastic Pool. /// </param> /// <returns> /// Response for long running Azure Sql Database Elastic Pool operation. /// </returns> public static Task <ElasticPoolCreateOrUpdateResponse> CreateOrUpdateAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, ElasticPoolCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, serverName, elasticPoolName, parameters, CancellationToken.None)); }
/// <summary> /// Gets a list of operations performed on the elastic pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <ElasticPoolOperation> > ListByElasticPoolNextAsync(this IElasticPoolOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByElasticPoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a list of operations performed on the elastic pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='elasticPoolName'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <ElasticPoolOperation> > ListByElasticPoolAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByElasticPoolWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Cancels the asynchronous operation on the elastic pool. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource. You can obtain /// this value from the Azure Resource Manager API or the portal. /// </param> /// <param name='serverName'> /// The name of the server. /// </param> /// <param name='elasticPoolName'> /// </param> /// <param name='operationId'> /// The operation identifier. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task CancelAsync(this IElasticPoolOperations operations, string resourceGroupName, string serverName, string elasticPoolName, System.Guid operationId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.CancelWithHttpMessagesAsync(resourceGroupName, serverName, elasticPoolName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }