diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql.rb index 7a09753490..40b6ad68a6 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql.rb @@ -21,60 +21,58 @@ module Azure::ARM::SQL autoload :Capabilities, 'generated/azure_mgmt_sql/capabilities.rb' - autoload :Servers, 'generated/azure_mgmt_sql/servers.rb' + autoload :FirewallRules, 'generated/azure_mgmt_sql/firewall_rules.rb' autoload :Databases, 'generated/azure_mgmt_sql/databases.rb' - autoload :ImportExportOperations, 'generated/azure_mgmt_sql/import_export_operations.rb' + autoload :Servers, 'generated/azure_mgmt_sql/servers.rb' autoload :ElasticPools, 'generated/azure_mgmt_sql/elastic_pools.rb' autoload :RecommendedElasticPools, 'generated/azure_mgmt_sql/recommended_elastic_pools.rb' - autoload :DatabaseThreatDetectionPolicies, 'generated/azure_mgmt_sql/database_threat_detection_policies.rb' - autoload :DatabaseBlobAuditingPolicies, 'generated/azure_mgmt_sql/database_blob_auditing_policies.rb' + autoload :FailoverGroups, 'generated/azure_mgmt_sql/failover_groups.rb' autoload :SqlManagementClient, 'generated/azure_mgmt_sql/sql_management_client.rb' module Models - autoload :OperationImpact, 'generated/azure_mgmt_sql/models/operation_impact.rb' - autoload :DatabaseMetricListResult, 'generated/azure_mgmt_sql/models/database_metric_list_result.rb' + autoload :ElasticPoolListResult, 'generated/azure_mgmt_sql/models/elastic_pool_list_result.rb' + autoload :ServiceObjectiveListResult, 'generated/azure_mgmt_sql/models/service_objective_list_result.rb' autoload :ServiceObjectiveCapability, 'generated/azure_mgmt_sql/models/service_objective_capability.rb' - autoload :TransparentDataEncryptionActivityListResult, 'generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb' + autoload :Operation, 'generated/azure_mgmt_sql/models/operation.rb' autoload :ServerVersionCapability, 'generated/azure_mgmt_sql/models/server_version_capability.rb' - autoload :ServiceObjectiveListResult, 'generated/azure_mgmt_sql/models/service_objective_list_result.rb' - autoload :EditionCapability, 'generated/azure_mgmt_sql/models/edition_capability.rb' - autoload :ServerFirewallRuleListResult, 'generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb' + autoload :OperationDisplay, 'generated/azure_mgmt_sql/models/operation_display.rb' + autoload :SubResource, 'generated/azure_mgmt_sql/models/sub_resource.rb' + autoload :RecommendedElasticPoolListResult, 'generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb' + autoload :FirewallRuleListResult, 'generated/azure_mgmt_sql/models/firewall_rule_list_result.rb' + autoload :RecommendedElasticPoolListMetricsResult, 'generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb' autoload :LocationCapabilities, 'generated/azure_mgmt_sql/models/location_capabilities.rb' - autoload :ImportExtensionRequestParameters, 'generated/azure_mgmt_sql/models/import_extension_request_parameters.rb' - autoload :UpgradeRecommendedElasticPoolProperties, 'generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb' - autoload :ImportExportOperationListResponse, 'generated/azure_mgmt_sql/models/import_export_operation_list_response.rb' - autoload :ServiceTierAdvisorListResult, 'generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb' - autoload :RestorePointListResult, 'generated/azure_mgmt_sql/models/restore_point_list_result.rb' + autoload :OperationListResult, 'generated/azure_mgmt_sql/models/operation_list_result.rb' + autoload :ImportExtensionRequest, 'generated/azure_mgmt_sql/models/import_extension_request.rb' + autoload :FailoverGroupReadOnlyEndpoint, 'generated/azure_mgmt_sql/models/failover_group_read_only_endpoint.rb' autoload :ServerMetricListResult, 'generated/azure_mgmt_sql/models/server_metric_list_result.rb' autoload :ServerMetric, 'generated/azure_mgmt_sql/models/server_metric.rb' + autoload :RestorePointListResult, 'generated/azure_mgmt_sql/models/restore_point_list_result.rb' autoload :RecommendedElasticPoolMetric, 'generated/azure_mgmt_sql/models/recommended_elastic_pool_metric.rb' - autoload :RecommendedElasticPoolListResult, 'generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb' - autoload :UpgradeHint, 'generated/azure_mgmt_sql/models/upgrade_hint.rb' - autoload :RecommendedElasticPoolListMetricsResult, 'generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb' + autoload :TransparentDataEncryptionActivityListResult, 'generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb' + autoload :DatabaseMetricListResult, 'generated/azure_mgmt_sql/models/database_metric_list_result.rb' autoload :MaxSizeCapability, 'generated/azure_mgmt_sql/models/max_size_capability.rb' - autoload :ImportExportOperationResponse, 'generated/azure_mgmt_sql/models/import_export_operation_response.rb' - autoload :ElasticPoolListResult, 'generated/azure_mgmt_sql/models/elastic_pool_list_result.rb' - autoload :ExportRequestParameters, 'generated/azure_mgmt_sql/models/export_request_parameters.rb' - autoload :OperationListResult, 'generated/azure_mgmt_sql/models/operation_list_result.rb' - autoload :SloUsageMetric, 'generated/azure_mgmt_sql/models/slo_usage_metric.rb' + autoload :OperationImpact, 'generated/azure_mgmt_sql/models/operation_impact.rb' + autoload :ServiceTierAdvisorListResult, 'generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb' autoload :ElasticPoolActivityListResult, 'generated/azure_mgmt_sql/models/elastic_pool_activity_list_result.rb' - autoload :SqlSubResource, 'generated/azure_mgmt_sql/models/sql_sub_resource.rb' - autoload :Operation, 'generated/azure_mgmt_sql/models/operation.rb' autoload :ReplicationLinkListResult, 'generated/azure_mgmt_sql/models/replication_link_list_result.rb' + autoload :FailoverGroupResourceList, 'generated/azure_mgmt_sql/models/failover_group_resource_list.rb' + autoload :FailoverGroupReadWriteEndpoint, 'generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb' autoload :ElasticPoolDatabaseActivityListResult, 'generated/azure_mgmt_sql/models/elastic_pool_database_activity_list_result.rb' - autoload :ImportExportOperationResponsePropertiesModel, 'generated/azure_mgmt_sql/models/import_export_operation_response_properties_model.rb' - autoload :OperationDisplay, 'generated/azure_mgmt_sql/models/operation_display.rb' - autoload :DatabaseListResult, 'generated/azure_mgmt_sql/models/database_list_result.rb' + autoload :ExportRequest, 'generated/azure_mgmt_sql/models/export_request.rb' + autoload :PartnerInfo, 'generated/azure_mgmt_sql/models/partner_info.rb' + autoload :EditionCapability, 'generated/azure_mgmt_sql/models/edition_capability.rb' autoload :ServerListResult, 'generated/azure_mgmt_sql/models/server_list_result.rb' - autoload :ServerFirewallRule, 'generated/azure_mgmt_sql/models/server_firewall_rule.rb' - autoload :ImportRequestParameters, 'generated/azure_mgmt_sql/models/import_request_parameters.rb' + autoload :SloUsageMetric, 'generated/azure_mgmt_sql/models/slo_usage_metric.rb' + autoload :DatabaseListResult, 'generated/azure_mgmt_sql/models/database_list_result.rb' + autoload :FirewallRule, 'generated/azure_mgmt_sql/models/firewall_rule.rb' + autoload :TrackedResource, 'generated/azure_mgmt_sql/models/tracked_resource.rb' + autoload :ProxyResource, 'generated/azure_mgmt_sql/models/proxy_resource.rb' + autoload :ImportExportResponse, 'generated/azure_mgmt_sql/models/import_export_response.rb' + autoload :ImportRequest, 'generated/azure_mgmt_sql/models/import_request.rb' autoload :ReplicationLink, 'generated/azure_mgmt_sql/models/replication_link.rb' autoload :ServiceTierAdvisor, 'generated/azure_mgmt_sql/models/service_tier_advisor.rb' - autoload :Column, 'generated/azure_mgmt_sql/models/column.rb' - autoload :RecommendedIndex, 'generated/azure_mgmt_sql/models/recommended_index.rb' - autoload :Table, 'generated/azure_mgmt_sql/models/table.rb' - autoload :Schema, 'generated/azure_mgmt_sql/models/schema.rb' autoload :TransparentDataEncryption, 'generated/azure_mgmt_sql/models/transparent_data_encryption.rb' + autoload :RecommendedIndex, 'generated/azure_mgmt_sql/models/recommended_index.rb' autoload :Database, 'generated/azure_mgmt_sql/models/database.rb' autoload :RecommendedElasticPool, 'generated/azure_mgmt_sql/models/recommended_elastic_pool.rb' autoload :ElasticPool, 'generated/azure_mgmt_sql/models/elastic_pool.rb' @@ -85,37 +83,37 @@ module Models autoload :DatabaseMetric, 'generated/azure_mgmt_sql/models/database_metric.rb' autoload :ServiceObjective, 'generated/azure_mgmt_sql/models/service_objective.rb' autoload :TransparentDataEncryptionActivity, 'generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb' - autoload :SqlTypedSubResource, 'generated/azure_mgmt_sql/models/sql_typed_sub_resource.rb' autoload :DatabaseSecurityAlertPolicy, 'generated/azure_mgmt_sql/models/database_security_alert_policy.rb' autoload :DatabaseBlobAuditingPolicy, 'generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb' + autoload :FailoverGroupResource, 'generated/azure_mgmt_sql/models/failover_group_resource.rb' autoload :CapabilityStatus, 'generated/azure_mgmt_sql/models/capability_status.rb' autoload :MaxSizeUnits, 'generated/azure_mgmt_sql/models/max_size_units.rb' autoload :PerformanceLevelUnit, 'generated/azure_mgmt_sql/models/performance_level_unit.rb' + autoload :DatabaseEdition, 'generated/azure_mgmt_sql/models/database_edition.rb' + autoload :ServiceObjectiveName, 'generated/azure_mgmt_sql/models/service_objective_name.rb' autoload :StorageKeyType, 'generated/azure_mgmt_sql/models/storage_key_type.rb' autoload :AuthenticationType, 'generated/azure_mgmt_sql/models/authentication_type.rb' autoload :ReplicationRole, 'generated/azure_mgmt_sql/models/replication_role.rb' autoload :ReplicationState, 'generated/azure_mgmt_sql/models/replication_state.rb' - autoload :ElasticPoolEditions, 'generated/azure_mgmt_sql/models/elastic_pool_editions.rb' + autoload :ElasticPoolEdition, 'generated/azure_mgmt_sql/models/elastic_pool_edition.rb' autoload :CreateMode, 'generated/azure_mgmt_sql/models/create_mode.rb' - autoload :DatabaseEditions, 'generated/azure_mgmt_sql/models/database_editions.rb' - autoload :ServiceObjectiveName, 'generated/azure_mgmt_sql/models/service_objective_name.rb' - autoload :TableType, 'generated/azure_mgmt_sql/models/table_type.rb' - autoload :RecommendedIndexActions, 'generated/azure_mgmt_sql/models/recommended_index_actions.rb' - autoload :RecommendedIndexStates, 'generated/azure_mgmt_sql/models/recommended_index_states.rb' - autoload :RecommendedIndexTypes, 'generated/azure_mgmt_sql/models/recommended_index_types.rb' - autoload :TransparentDataEncryptionStates, 'generated/azure_mgmt_sql/models/transparent_data_encryption_states.rb' + autoload :TransparentDataEncryptionStatus, 'generated/azure_mgmt_sql/models/transparent_data_encryption_status.rb' + autoload :RecommendedIndexAction, 'generated/azure_mgmt_sql/models/recommended_index_action.rb' + autoload :RecommendedIndexState, 'generated/azure_mgmt_sql/models/recommended_index_state.rb' + autoload :RecommendedIndexType, 'generated/azure_mgmt_sql/models/recommended_index_type.rb' autoload :ReadScale, 'generated/azure_mgmt_sql/models/read_scale.rb' autoload :SampleName, 'generated/azure_mgmt_sql/models/sample_name.rb' autoload :ElasticPoolState, 'generated/azure_mgmt_sql/models/elastic_pool_state.rb' autoload :ServerVersion, 'generated/azure_mgmt_sql/models/server_version.rb' autoload :ServerState, 'generated/azure_mgmt_sql/models/server_state.rb' - autoload :TargetElasticPoolEditions, 'generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb' autoload :RestorePointTypes, 'generated/azure_mgmt_sql/models/restore_point_types.rb' - autoload :TransparentDataEncryptionActivityStates, 'generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb' + autoload :TransparentDataEncryptionActivityStatus, 'generated/azure_mgmt_sql/models/transparent_data_encryption_activity_status.rb' autoload :SecurityAlertPolicyState, 'generated/azure_mgmt_sql/models/security_alert_policy_state.rb' - autoload :SecurityAlert, 'generated/azure_mgmt_sql/models/security_alert.rb' autoload :SecurityAlertPolicyEmailAccountAdmins, 'generated/azure_mgmt_sql/models/security_alert_policy_email_account_admins.rb' autoload :SecurityAlertPolicyUseServerDefault, 'generated/azure_mgmt_sql/models/security_alert_policy_use_server_default.rb' autoload :BlobAuditingPolicyState, 'generated/azure_mgmt_sql/models/blob_auditing_policy_state.rb' + autoload :ReadWriteEndpointFailoverPolicy, 'generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb' + autoload :ReadOnlyEndpointFailoverPolicy, 'generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb' + autoload :FailoverGroupReplicationRole, 'generated/azure_mgmt_sql/models/failover_group_replication_role.rb' end end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/capabilities.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/capabilities.rb index 35f4aa127d..45f561a9a8 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/capabilities.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/capabilities.rb @@ -11,7 +11,6 @@ module Azure::ARM::SQL # databases. # class Capabilities - include Azure::ARM::SQL::Models include MsRestAzure # @@ -72,7 +71,7 @@ def list_by_location_async(location_id, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities' + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities' request_url = @base_url || @client.base_url @@ -99,7 +98,7 @@ def list_by_location_async(location_id, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = LocationCapabilities.mapper() + result_mapper = Azure::ARM::SQL::Models::LocationCapabilities.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/database_blob_auditing_policies.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/database_blob_auditing_policies.rb deleted file mode 100755 index f979d00540..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +++ /dev/null @@ -1,263 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - # - # The Azure SQL Database management API provides a RESTful set of web - # services that interact with Azure SQL Database services to manage your - # databases. The API enables you to create, retrieve, update, and delete - # databases. - # - class DatabaseBlobAuditingPolicies - include Azure::ARM::SQL::Models - include MsRestAzure - - # - # Creates and initializes a new instance of the DatabaseBlobAuditingPolicies class. - # @param client service class for accessing basic functionality. - # - def initialize(client) - @client = client - end - - # @return [SqlManagementClient] reference to the SqlManagementClient - attr_reader :client - - # - # Gets a blob auditing policy associated with a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # blob audit policy is defined. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [DatabaseBlobAuditingPolicy] operation results. - # - def get(resource_group_name, server_name, database_name, custom_headers = nil) - response = get_async(resource_group_name, server_name, database_name, custom_headers).value! - response.body unless response.nil? - end - - # - # Gets a blob auditing policy associated with a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # blob audit policy is defined. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def get_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) - get_async(resource_group_name, server_name, database_name, custom_headers).value! - end - - # - # Gets a blob auditing policy associated with a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # blob audit policy is defined. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def get_async(resource_group_name, server_name, database_name, custom_headers = nil) - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'database_name is nil' if database_name.nil? - api_version = '2015-05-01-preview' - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, - query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseBlobAuditingPolicy.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Creates or updates a blob auditing policy for a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # blob audit policy will be defined. - # @param database_blob_auditing_policy [DatabaseBlobAuditingPolicy] The name of - # the database blob auditing policy. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [DatabaseBlobAuditingPolicy] operation results. - # - def create_or_update(resource_group_name, server_name, database_name, database_blob_auditing_policy, custom_headers = nil) - response = create_or_update_async(resource_group_name, server_name, database_name, database_blob_auditing_policy, custom_headers).value! - response.body unless response.nil? - end - - # - # Creates or updates a blob auditing policy for a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # blob audit policy will be defined. - # @param database_blob_auditing_policy [DatabaseBlobAuditingPolicy] The name of - # the database blob auditing policy. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def create_or_update_with_http_info(resource_group_name, server_name, database_name, database_blob_auditing_policy, custom_headers = nil) - create_or_update_async(resource_group_name, server_name, database_name, database_blob_auditing_policy, custom_headers).value! - end - - # - # Creates or updates a blob auditing policy for a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # blob audit policy will be defined. - # @param database_blob_auditing_policy [DatabaseBlobAuditingPolicy] The name of - # the database blob auditing policy. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def create_or_update_async(resource_group_name, server_name, database_name, database_blob_auditing_policy, custom_headers = nil) - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'database_name is nil' if database_name.nil? - fail ArgumentError, 'database_blob_auditing_policy is nil' if database_blob_auditing_policy.nil? - api_version = '2015-05-01-preview' - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - - request_headers['Content-Type'] = 'application/json; charset=utf-8' - - # Serialize Request - request_mapper = DatabaseBlobAuditingPolicy.mapper() - request_content = @client.serialize(request_mapper, database_blob_auditing_policy, 'database_blob_auditing_policy') - request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, - query_params: {'api-version' => api_version}, - body: request_content, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:put, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 || status_code == 201 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseBlobAuditingPolicy.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - # Deserialize Response - if status_code == 201 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseBlobAuditingPolicy.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/database_threat_detection_policies.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/database_threat_detection_policies.rb deleted file mode 100755 index 1bb495d4b8..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/database_threat_detection_policies.rb +++ /dev/null @@ -1,263 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - # - # The Azure SQL Database management API provides a RESTful set of web - # services that interact with Azure SQL Database services to manage your - # databases. The API enables you to create, retrieve, update, and delete - # databases. - # - class DatabaseThreatDetectionPolicies - include Azure::ARM::SQL::Models - include MsRestAzure - - # - # Creates and initializes a new instance of the DatabaseThreatDetectionPolicies class. - # @param client service class for accessing basic functionality. - # - def initialize(client) - @client = client - end - - # @return [SqlManagementClient] reference to the SqlManagementClient - attr_reader :client - - # - # Gets a Threat Detection policy associated with a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # Threat Detection policy is defined. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [DatabaseSecurityAlertPolicy] operation results. - # - def get(resource_group_name, server_name, database_name, custom_headers = nil) - response = get_async(resource_group_name, server_name, database_name, custom_headers).value! - response.body unless response.nil? - end - - # - # Gets a Threat Detection policy associated with a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # Threat Detection policy is defined. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def get_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) - get_async(resource_group_name, server_name, database_name, custom_headers).value! - end - - # - # Gets a Threat Detection policy associated with a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # Threat Detection policy is defined. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def get_async(resource_group_name, server_name, database_name, custom_headers = nil) - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'database_name is nil' if database_name.nil? - api_version = '2014-04-01' - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, - query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseSecurityAlertPolicy.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Creates or updates a Threat Detection policy for a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # Threat Detection policy is defined. - # @param database_security_alert_policy [DatabaseSecurityAlertPolicy] The - # database Threat Detection policy. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [DatabaseSecurityAlertPolicy] operation results. - # - def create_or_update(resource_group_name, server_name, database_name, database_security_alert_policy, custom_headers = nil) - response = create_or_update_async(resource_group_name, server_name, database_name, database_security_alert_policy, custom_headers).value! - response.body unless response.nil? - end - - # - # Creates or updates a Threat Detection policy for a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # Threat Detection policy is defined. - # @param database_security_alert_policy [DatabaseSecurityAlertPolicy] The - # database Threat Detection policy. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def create_or_update_with_http_info(resource_group_name, server_name, database_name, database_security_alert_policy, custom_headers = nil) - create_or_update_async(resource_group_name, server_name, database_name, database_security_alert_policy, custom_headers).value! - end - - # - # Creates or updates a Threat Detection policy for a database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database for which database - # Threat Detection policy is defined. - # @param database_security_alert_policy [DatabaseSecurityAlertPolicy] The - # database Threat Detection policy. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def create_or_update_async(resource_group_name, server_name, database_name, database_security_alert_policy, custom_headers = nil) - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'database_name is nil' if database_name.nil? - fail ArgumentError, 'database_security_alert_policy is nil' if database_security_alert_policy.nil? - api_version = '2014-04-01' - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - - request_headers['Content-Type'] = 'application/json; charset=utf-8' - - # Serialize Request - request_mapper = DatabaseSecurityAlertPolicy.mapper() - request_content = @client.serialize(request_mapper, database_security_alert_policy, 'database_security_alert_policy') - request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, - query_params: {'api-version' => api_version}, - body: request_content, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:put, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 || status_code == 201 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseSecurityAlertPolicy.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - # Deserialize Response - if status_code == 201 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseSecurityAlertPolicy.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/databases.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/databases.rb index c0a7430c53..31ca7e3940 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/databases.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/databases.rb @@ -11,7 +11,6 @@ module Azure::ARM::SQL # databases. # class Databases - include Azure::ARM::SQL::Models include MsRestAzure # @@ -26,23 +25,73 @@ def initialize(client) attr_reader :client # - # Imports a bacpac into an existing database. The existing database must be - # empty. + # Imports a bacpac into a new database. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param parameters [ImportRequest] The required parameters for importing a + # Bacpac into a database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ImportExportResponse] operation results. + # + def import(resource_group_name, server_name, parameters, custom_headers = nil) + response = import_async(resource_group_name, server_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param parameters [ImportRequest] The required parameters for importing a + # Bacpac into a database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def import_async(resource_group_name, server_name, parameters, custom_headers = nil) + # Send request + promise = begin_import_async(resource_group_name, server_name, parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates an import operation that imports a bacpac into an existing database. + # The existing database must be empty. # # @param resource_group_name [String] 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 server_name [String] The name of the server. # @param database_name [String] The name of the database to import into - # @param parameters [ImportExtensionRequestParameters] The required parameters - # for importing a Bacpac into a database. + # @param parameters [ImportExtensionRequest] The required parameters for + # importing a Bacpac into a database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationResponse] operation results. + # @return [ImportExportResponse] operation results. # - def import(resource_group_name, server_name, database_name, parameters, custom_headers = nil) - response = import_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + def create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + response = create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! response.body unless response.nil? end @@ -52,22 +101,22 @@ def import(resource_group_name, server_name, database_name, parameters, custom_h # Manager API or the portal. # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to import into - # @param parameters [ImportExtensionRequestParameters] The required parameters - # for importing a Bacpac into a database. + # @param parameters [ImportExtensionRequest] The required parameters for + # importing a Bacpac into a database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [Concurrent::Promise] promise which provides async access to http # response. # - def import_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + def create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil) # Send request - promise = begin_import_async(resource_group_name, server_name, database_name, parameters, custom_headers) + promise = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') end @@ -86,12 +135,12 @@ def import_async(resource_group_name, server_name, database_name, parameters, cu # Manager API or the portal. # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be exported. - # @param parameters [ExportRequestParameters] The required parameters for - # exporting a database. + # @param parameters [ExportRequest] The required parameters for exporting a + # database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationResponse] operation results. + # @return [ImportExportResponse] operation results. # def export(resource_group_name, server_name, database_name, parameters, custom_headers = nil) response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! @@ -104,8 +153,8 @@ def export(resource_group_name, server_name, database_name, parameters, custom_h # Manager API or the portal. # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be exported. - # @param parameters [ExportRequestParameters] The required parameters for - # exporting a database. + # @param parameters [ExportRequest] The required parameters for exporting a + # database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -119,7 +168,7 @@ def export_async(resource_group_name, server_name, database_name, parameters, cu promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') end @@ -197,7 +246,7 @@ def delete_replication_link_async(resource_group_name, server_name, database_nam # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}' request_url = @base_url || @client.base_url @@ -292,7 +341,7 @@ def get_replication_link_async(resource_group_name, server_name, database_name, # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}' request_url = @base_url || @client.base_url @@ -319,7 +368,7 @@ def get_replication_link_async(resource_group_name, server_name, database_name, if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ReplicationLink.mapper() + result_mapper = Azure::ARM::SQL::Models::ReplicationLink.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -333,7 +382,8 @@ def get_replication_link_async(resource_group_name, server_name, database_name, end # - # Failover the database replication link. + # Sets which replica database is primary by failing over from the current + # primary replica database. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -381,7 +431,8 @@ def failover_replication_link_async(resource_group_name, server_name, database_n end # - # Force failover the database replication link, which may result in data loss. + # Sets which replica database is primary by failing over from the current + # primary replica database. This operation might result in data loss. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -489,7 +540,7 @@ def list_replication_links_async(resource_group_name, server_name, database_name # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks' request_url = @base_url || @client.base_url @@ -516,7 +567,7 @@ def list_replication_links_async(resource_group_name, server_name, database_name if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ReplicationLinkListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ReplicationLinkListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -540,8 +591,8 @@ def list_replication_links_async(resource_group_name, server_name, database_name # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - def pause_data_warehouse(resource_group_name, server_name, database_name, custom_headers = nil) - response = pause_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers).value! + def pause(resource_group_name, server_name, database_name, custom_headers = nil) + response = pause_async(resource_group_name, server_name, database_name, custom_headers).value! nil end @@ -557,9 +608,9 @@ def pause_data_warehouse(resource_group_name, server_name, database_name, custom # @return [Concurrent::Promise] promise which provides async access to http # response. # - def pause_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers = nil) + def pause_async(resource_group_name, server_name, database_name, custom_headers = nil) # Send request - promise = begin_pause_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers) + promise = begin_pause_async(resource_group_name, server_name, database_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -584,8 +635,8 @@ def pause_data_warehouse_async(resource_group_name, server_name, database_name, # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - def resume_data_warehouse(resource_group_name, server_name, database_name, custom_headers = nil) - response = resume_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers).value! + def resume(resource_group_name, server_name, database_name, custom_headers = nil) + response = resume_async(resource_group_name, server_name, database_name, custom_headers).value! nil end @@ -601,9 +652,9 @@ def resume_data_warehouse(resource_group_name, server_name, database_name, custo # @return [Concurrent::Promise] promise which provides async access to http # response. # - def resume_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers = nil) + def resume_async(resource_group_name, server_name, database_name, custom_headers = nil) # Send request - promise = begin_resume_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers) + promise = begin_resume_async(resource_group_name, server_name, database_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. @@ -681,7 +732,7 @@ def list_restore_points_async(resource_group_name, server_name, database_name, c # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints' request_url = @base_url || @client.base_url @@ -708,7 +759,7 @@ def list_restore_points_async(resource_group_name, server_name, database_name, c if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = RestorePointListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::RestorePointListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -766,7 +817,7 @@ def create_or_update_async(resource_group_name, server_name, database_name, para promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| - result_mapper = Database.mapper() + result_mapper = Azure::ARM::SQL::Models::Database.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') end @@ -837,7 +888,7 @@ def delete_async(resource_group_name, server_name, database_name, custom_headers # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' request_url = @base_url || @client.base_url @@ -876,7 +927,7 @@ def delete_async(resource_group_name, server_name, database_name, custom_headers # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be retrieved. # @param expand [String] A comma separated list of child objects to expand in - # the response. Possible properties: serviceTierAdvisors, upgradeHint, + # the response. Possible properties: serviceTierAdvisors, # transparentDataEncryption. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. @@ -897,7 +948,7 @@ def get(resource_group_name, server_name, database_name, expand = nil, custom_he # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be retrieved. # @param expand [String] A comma separated list of child objects to expand in - # the response. Possible properties: serviceTierAdvisors, upgradeHint, + # the response. Possible properties: serviceTierAdvisors, # transparentDataEncryption. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. @@ -917,7 +968,7 @@ def get_with_http_info(resource_group_name, server_name, database_name, expand = # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be retrieved. # @param expand [String] A comma separated list of child objects to expand in - # the response. Possible properties: serviceTierAdvisors, upgradeHint, + # the response. Possible properties: serviceTierAdvisors, # transparentDataEncryption. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. @@ -937,7 +988,7 @@ def get_async(resource_group_name, server_name, database_name, expand = nil, cus # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' request_url = @base_url || @client.base_url @@ -964,7 +1015,7 @@ def get_async(resource_group_name, server_name, database_name, expand = nil, cus if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Database.mapper() + result_mapper = Azure::ARM::SQL::Models::Database.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -984,6 +1035,9 @@ def get_async(resource_group_name, server_name, database_name, expand = nil, cus # contains the resource. You can obtain this value from the Azure Resource # Manager API or the portal. # @param server_name [String] The name of the server. + # @param expand [String] A comma separated list of child objects to expand in + # the response. Possible properties: serviceTierAdvisors, + # transparentDataEncryption. # @param filter [String] An OData filter expression that describes a subset of # databases to return. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -991,8 +1045,8 @@ def get_async(resource_group_name, server_name, database_name, expand = nil, cus # # @return [DatabaseListResult] operation results. # - def list_by_server(resource_group_name, server_name, filter = nil, custom_headers = nil) - response = list_by_server_async(resource_group_name, server_name, filter, custom_headers).value! + def list_by_server(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil) + response = list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value! response.body unless response.nil? end @@ -1003,6 +1057,9 @@ def list_by_server(resource_group_name, server_name, filter = nil, custom_header # contains the resource. You can obtain this value from the Azure Resource # Manager API or the portal. # @param server_name [String] The name of the server. + # @param expand [String] A comma separated list of child objects to expand in + # the response. Possible properties: serviceTierAdvisors, + # transparentDataEncryption. # @param filter [String] An OData filter expression that describes a subset of # databases to return. # @param custom_headers [Hash{String => String}] A hash of custom headers that @@ -1010,8 +1067,8 @@ def list_by_server(resource_group_name, server_name, filter = nil, custom_header # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_server_with_http_info(resource_group_name, server_name, filter = nil, custom_headers = nil) - list_by_server_async(resource_group_name, server_name, filter, custom_headers).value! + def list_by_server_with_http_info(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil) + list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value! end # @@ -1021,6 +1078,9 @@ def list_by_server_with_http_info(resource_group_name, server_name, filter = nil # contains the resource. You can obtain this value from the Azure Resource # Manager API or the portal. # @param server_name [String] The name of the server. + # @param expand [String] A comma separated list of child objects to expand in + # the response. Possible properties: serviceTierAdvisors, + # transparentDataEncryption. # @param filter [String] An OData filter expression that describes a subset of # databases to return. # @param [Hash{String => String}] A hash of custom headers that will be added @@ -1028,7 +1088,7 @@ def list_by_server_with_http_info(resource_group_name, server_name, filter = nil # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_server_async(resource_group_name, server_name, filter = nil, custom_headers = nil) + def list_by_server_async(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @@ -1040,14 +1100,14 @@ def list_by_server_async(resource_group_name, server_name, filter = nil, custom_ # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, - query_params: {'api-version' => api_version,'$filter' => filter}, + query_params: {'api-version' => api_version,'$expand' => expand,'$filter' => filter}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } @@ -1067,7 +1127,7 @@ def list_by_server_async(resource_group_name, server_name, filter = nil, custom_ if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1141,7 +1201,7 @@ def list_usages_async(resource_group_name, server_name, database_name, custom_he # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages' request_url = @base_url || @client.base_url @@ -1168,7 +1228,7 @@ def list_usages_async(resource_group_name, server_name, database_name, custom_he if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseMetricListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::DatabaseMetricListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1246,7 +1306,7 @@ def get_service_tier_advisor_async(resource_group_name, server_name, database_na # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}' request_url = @base_url || @client.base_url @@ -1273,7 +1333,7 @@ def get_service_tier_advisor_async(resource_group_name, server_name, database_na if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServiceTierAdvisor.mapper() + result_mapper = Azure::ARM::SQL::Models::ServiceTierAdvisor.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1347,7 +1407,7 @@ def list_service_tier_advisors_async(resource_group_name, server_name, database_ # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors' request_url = @base_url || @client.base_url @@ -1374,7 +1434,7 @@ def list_service_tier_advisors_async(resource_group_name, server_name, database_ if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServiceTierAdvisorListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ServiceTierAdvisorListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1462,11 +1522,11 @@ def create_or_update_transparent_data_encryption_configuration_async(resource_gr request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request - request_mapper = TransparentDataEncryption.mapper() + request_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current' request_url = @base_url || @client.base_url @@ -1494,7 +1554,7 @@ def create_or_update_transparent_data_encryption_configuration_async(resource_gr if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = TransparentDataEncryption.mapper() + result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1504,7 +1564,7 @@ def create_or_update_transparent_data_encryption_configuration_async(resource_gr if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = TransparentDataEncryption.mapper() + result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1581,7 +1641,7 @@ def get_transparent_data_encryption_configuration_async(resource_group_name, ser # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current' request_url = @base_url || @client.base_url @@ -1608,7 +1668,7 @@ def get_transparent_data_encryption_configuration_async(resource_group_name, ser if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = TransparentDataEncryption.mapper() + result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1685,7 +1745,111 @@ def list_transparent_data_encryption_activity_async(resource_group_name, server_ # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current/operationResults' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current/operationResults' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryptionActivityListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a database's threat detection policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # Threat Detection policy is defined. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseSecurityAlertPolicy] operation results. + # + def get_threat_detection_policy(resource_group_name, server_name, database_name, custom_headers = nil) + response = get_threat_detection_policy_async(resource_group_name, server_name, database_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a database's threat detection policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # Threat Detection policy is defined. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_threat_detection_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) + get_threat_detection_policy_async(resource_group_name, server_name, database_name, custom_headers).value! + end + + # + # Gets a database's threat detection policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # Threat Detection policy is defined. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_threat_detection_policy_async(resource_group_name, server_name, database_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + api_version = '2014-04-01' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' request_url = @base_url || @client.base_url @@ -1712,7 +1876,484 @@ def list_transparent_data_encryption_activity_async(resource_group_name, server_ if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = TransparentDataEncryptionActivityListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates or updates a database's threat detection policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # Threat Detection policy is defined. + # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection + # policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseSecurityAlertPolicy] operation results. + # + def create_or_update_threat_detection_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + response = create_or_update_threat_detection_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates a database's threat detection policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # Threat Detection policy is defined. + # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection + # policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_or_update_threat_detection_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + create_or_update_threat_detection_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + end + + # + # Creates or updates a database's threat detection policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # Threat Detection policy is defined. + # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection + # policy. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_or_update_threat_detection_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + api_version = '2014-04-01' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, + query_params: {'api-version' => api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets a database's blob auditing policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # blob audit policy is defined. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseBlobAuditingPolicy] operation results. + # + def get_blob_auditing_policy(resource_group_name, server_name, database_name, custom_headers = nil) + response = get_blob_auditing_policy_async(resource_group_name, server_name, database_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a database's blob auditing policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # blob audit policy is defined. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_blob_auditing_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) + get_blob_auditing_policy_async(resource_group_name, server_name, database_name, custom_headers).value! + end + + # + # Gets a database's blob auditing policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # blob audit policy is defined. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_blob_auditing_policy_async(resource_group_name, server_name, database_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + api_version = '2015-05-01-preview' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates or updates a database's blob auditing policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # blob audit policy will be defined. + # @param parameters [DatabaseBlobAuditingPolicy] The database blob auditing + # policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DatabaseBlobAuditingPolicy] operation results. + # + def create_or_update_blob_auditing_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + response = create_or_update_blob_auditing_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates a database's blob auditing policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # blob audit policy will be defined. + # @param parameters [DatabaseBlobAuditingPolicy] The database blob auditing + # policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def create_or_update_blob_auditing_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + create_or_update_blob_auditing_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + end + + # + # Creates or updates a database's blob auditing policy. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param database_name [String] The name of the database for which database + # blob audit policy will be defined. + # @param parameters [DatabaseBlobAuditingPolicy] The database blob auditing + # policy. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def create_or_update_blob_auditing_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'database_name is nil' if database_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + api_version = '2015-05-01-preview' + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name}, + query_params: {'api-version' => api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Imports a bacpac into a new database. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param parameters [ImportRequest] The required parameters for importing a + # Bacpac into a database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ImportExportResponse] operation results. + # + def begin_import(resource_group_name, server_name, parameters, custom_headers = nil) + response = begin_import_async(resource_group_name, server_name, parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Imports a bacpac into a new database. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param parameters [ImportRequest] The required parameters for importing a + # Bacpac into a database. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_import_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil) + begin_import_async(resource_group_name, server_name, parameters, custom_headers).value! + end + + # + # Imports a bacpac into a new database. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param parameters [ImportRequest] The required parameters for importing a + # Bacpac into a database. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_import_async(resource_group_name, server_name, parameters, custom_headers = nil) + api_version = '2014-04-01' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::SQL::Models::ImportRequest.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, + query_params: {'api-version' => api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 201 || status_code == 202 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1726,63 +2367,63 @@ def list_transparent_data_encryption_activity_async(resource_group_name, server_ end # - # Imports a bacpac into an existing database. The existing database must be - # empty. + # Creates an import operation that imports a bacpac into an existing database. + # The existing database must be empty. # # @param resource_group_name [String] 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 server_name [String] The name of the server. # @param database_name [String] The name of the database to import into - # @param parameters [ImportExtensionRequestParameters] The required parameters - # for importing a Bacpac into a database. + # @param parameters [ImportExtensionRequest] The required parameters for + # importing a Bacpac into a database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationResponse] operation results. + # @return [ImportExportResponse] operation results. # - def begin_import(resource_group_name, server_name, database_name, parameters, custom_headers = nil) - response = begin_import_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + def begin_create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + response = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! response.body unless response.nil? end # - # Imports a bacpac into an existing database. The existing database must be - # empty. + # Creates an import operation that imports a bacpac into an existing database. + # The existing database must be empty. # # @param resource_group_name [String] 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 server_name [String] The name of the server. # @param database_name [String] The name of the database to import into - # @param parameters [ImportExtensionRequestParameters] The required parameters - # for importing a Bacpac into a database. + # @param parameters [ImportExtensionRequest] The required parameters for + # importing a Bacpac into a database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_import_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil) - begin_import_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! + def begin_create_import_operation_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! end # - # Imports a bacpac into an existing database. The existing database must be - # empty. + # Creates an import operation that imports a bacpac into an existing database. + # The existing database must be empty. # # @param resource_group_name [String] 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 server_name [String] The name of the server. # @param database_name [String] The name of the database to import into - # @param parameters [ImportExtensionRequestParameters] The required parameters - # for importing a Bacpac into a database. + # @param parameters [ImportExtensionRequest] The required parameters for + # importing a Bacpac into a database. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_import_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil) + def begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @@ -1800,11 +2441,11 @@ def begin_import_async(resource_group_name, server_name, database_name, paramete request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request - request_mapper = ImportExtensionRequestParameters.mapper() + request_mapper = Azure::ARM::SQL::Models::ImportExtensionRequest.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/import' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/import' request_url = @base_url || @client.base_url @@ -1832,7 +2473,7 @@ def begin_import_async(resource_group_name, server_name, database_name, paramete if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1853,12 +2494,12 @@ def begin_import_async(resource_group_name, server_name, database_name, paramete # Manager API or the portal. # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be exported. - # @param parameters [ExportRequestParameters] The required parameters for - # exporting a database. + # @param parameters [ExportRequest] The required parameters for exporting a + # database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationResponse] operation results. + # @return [ImportExportResponse] operation results. # def begin_export(resource_group_name, server_name, database_name, parameters, custom_headers = nil) response = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value! @@ -1873,8 +2514,8 @@ def begin_export(resource_group_name, server_name, database_name, parameters, cu # Manager API or the portal. # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be exported. - # @param parameters [ExportRequestParameters] The required parameters for - # exporting a database. + # @param parameters [ExportRequest] The required parameters for exporting a + # database. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -1892,8 +2533,8 @@ def begin_export_with_http_info(resource_group_name, server_name, database_name, # Manager API or the portal. # @param server_name [String] The name of the server. # @param database_name [String] The name of the database to be exported. - # @param parameters [ExportRequestParameters] The required parameters for - # exporting a database. + # @param parameters [ExportRequest] The required parameters for exporting a + # database. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # @@ -1917,11 +2558,11 @@ def begin_export_async(resource_group_name, server_name, database_name, paramete request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request - request_mapper = ExportRequestParameters.mapper() + request_mapper = Azure::ARM::SQL::Models::ExportRequest.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export' request_url = @base_url || @client.base_url @@ -1949,7 +2590,7 @@ def begin_export_async(resource_group_name, server_name, database_name, paramete if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1963,7 +2604,8 @@ def begin_export_async(resource_group_name, server_name, database_name, paramete end # - # Failover the database replication link. + # Sets which replica database is primary by failing over from the current + # primary replica database. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -1982,7 +2624,8 @@ def begin_failover_replication_link(resource_group_name, server_name, database_n end # - # Failover the database replication link. + # Sets which replica database is primary by failing over from the current + # primary replica database. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -2001,7 +2644,8 @@ def begin_failover_replication_link_with_http_info(resource_group_name, server_n end # - # Failover the database replication link. + # Sets which replica database is primary by failing over from the current + # primary replica database. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -2029,7 +2673,7 @@ def begin_failover_replication_link_async(resource_group_name, server_name, data # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover' request_url = @base_url || @client.base_url @@ -2060,7 +2704,8 @@ def begin_failover_replication_link_async(resource_group_name, server_name, data end # - # Force failover the database replication link, which may result in data loss. + # Sets which replica database is primary by failing over from the current + # primary replica database. This operation might result in data loss. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -2079,7 +2724,8 @@ def begin_failover_replication_link_allow_data_loss(resource_group_name, server_ end # - # Force failover the database replication link, which may result in data loss. + # Sets which replica database is primary by failing over from the current + # primary replica database. This operation might result in data loss. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -2098,7 +2744,8 @@ def begin_failover_replication_link_allow_data_loss_with_http_info(resource_grou end # - # Force failover the database replication link, which may result in data loss. + # Sets which replica database is primary by failing over from the current + # primary replica database. This operation might result in data loss. # # @param resource_group_name [String] The name of the resource group that # contains the resource. You can obtain this value from the Azure Resource @@ -2126,7 +2773,7 @@ def begin_failover_replication_link_allow_data_loss_async(resource_group_name, s # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss' request_url = @base_url || @client.base_url @@ -2168,8 +2815,8 @@ def begin_failover_replication_link_allow_data_loss_async(resource_group_name, s # will be added to the HTTP request. # # - def begin_pause_data_warehouse(resource_group_name, server_name, database_name, custom_headers = nil) - response = begin_pause_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers).value! + def begin_pause(resource_group_name, server_name, database_name, custom_headers = nil) + response = begin_pause_async(resource_group_name, server_name, database_name, custom_headers).value! nil end @@ -2186,8 +2833,8 @@ def begin_pause_data_warehouse(resource_group_name, server_name, database_name, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_pause_data_warehouse_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) - begin_pause_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers).value! + def begin_pause_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) + begin_pause_async(resource_group_name, server_name, database_name, custom_headers).value! end # @@ -2203,7 +2850,7 @@ def begin_pause_data_warehouse_with_http_info(resource_group_name, server_name, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_pause_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers = nil) + def begin_pause_async(resource_group_name, server_name, database_name, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @@ -2216,7 +2863,7 @@ def begin_pause_data_warehouse_async(resource_group_name, server_name, database_ # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause' request_url = @base_url || @client.base_url @@ -2258,8 +2905,8 @@ def begin_pause_data_warehouse_async(resource_group_name, server_name, database_ # will be added to the HTTP request. # # - def begin_resume_data_warehouse(resource_group_name, server_name, database_name, custom_headers = nil) - response = begin_resume_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers).value! + def begin_resume(resource_group_name, server_name, database_name, custom_headers = nil) + response = begin_resume_async(resource_group_name, server_name, database_name, custom_headers).value! nil end @@ -2276,8 +2923,8 @@ def begin_resume_data_warehouse(resource_group_name, server_name, database_name, # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def begin_resume_data_warehouse_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) - begin_resume_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers).value! + def begin_resume_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) + begin_resume_async(resource_group_name, server_name, database_name, custom_headers).value! end # @@ -2293,7 +2940,7 @@ def begin_resume_data_warehouse_with_http_info(resource_group_name, server_name, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def begin_resume_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers = nil) + def begin_resume_async(resource_group_name, server_name, database_name, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @@ -2306,7 +2953,7 @@ def begin_resume_data_warehouse_async(resource_group_name, server_name, database # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume' request_url = @base_url || @client.base_url @@ -2417,11 +3064,11 @@ def begin_create_or_update_async(resource_group_name, server_name, database_name request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request - request_mapper = Database.mapper() + request_mapper = Azure::ARM::SQL::Models::Database.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' request_url = @base_url || @client.base_url @@ -2449,7 +3096,7 @@ def begin_create_or_update_async(resource_group_name, server_name, database_name if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Database.mapper() + result_mapper = Azure::ARM::SQL::Models::Database.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -2459,7 +3106,7 @@ def begin_create_or_update_async(resource_group_name, server_name, database_name if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Database.mapper() + result_mapper = Azure::ARM::SQL::Models::Database.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/elastic_pools.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/elastic_pools.rb index 122ec7fdc0..72e543826e 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/elastic_pools.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/elastic_pools.rb @@ -11,7 +11,6 @@ module Azure::ARM::SQL # databases. # class ElasticPools - include Azure::ARM::SQL::Models include MsRestAzure # @@ -68,7 +67,7 @@ def create_or_update_async(resource_group_name, server_name, elastic_pool_name, promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| - result_mapper = ElasticPool.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') end @@ -139,7 +138,7 @@ def delete_async(resource_group_name, server_name, elastic_pool_name, custom_hea # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}' request_url = @base_url || @client.base_url @@ -233,7 +232,7 @@ def get_async(resource_group_name, server_name, elastic_pool_name, custom_header # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}' request_url = @base_url || @client.base_url @@ -260,7 +259,7 @@ def get_async(resource_group_name, server_name, elastic_pool_name, custom_header if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ElasticPool.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -330,7 +329,7 @@ def list_by_server_async(resource_group_name, server_name, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools' request_url = @base_url || @client.base_url @@ -357,7 +356,7 @@ def list_by_server_async(resource_group_name, server_name, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ElasticPoolListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPoolListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -434,7 +433,7 @@ def list_activity_async(resource_group_name, server_name, elastic_pool_name, cus # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity' request_url = @base_url || @client.base_url @@ -461,7 +460,7 @@ def list_activity_async(resource_group_name, server_name, elastic_pool_name, cus if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ElasticPoolActivityListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPoolActivityListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -535,7 +534,7 @@ def list_database_activity_async(resource_group_name, server_name, elastic_pool_ # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity' request_url = @base_url || @client.base_url @@ -562,7 +561,7 @@ def list_database_activity_async(resource_group_name, server_name, elastic_pool_ if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ElasticPoolDatabaseActivityListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPoolDatabaseActivityListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -643,7 +642,7 @@ def get_database_async(resource_group_name, server_name, elastic_pool_name, data # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}' request_url = @base_url || @client.base_url @@ -670,7 +669,7 @@ def get_database_async(resource_group_name, server_name, elastic_pool_name, data if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Database.mapper() + result_mapper = Azure::ARM::SQL::Models::Database.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -747,7 +746,7 @@ def list_databases_async(resource_group_name, server_name, elastic_pool_name, cu # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases' request_url = @base_url || @client.base_url @@ -774,7 +773,7 @@ def list_databases_async(resource_group_name, server_name, elastic_pool_name, cu if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -862,11 +861,11 @@ def begin_create_or_update_async(resource_group_name, server_name, elastic_pool_ request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request - request_mapper = ElasticPool.mapper() + request_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}' request_url = @base_url || @client.base_url @@ -894,7 +893,7 @@ def begin_create_or_update_async(resource_group_name, server_name, elastic_pool_ if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ElasticPool.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -904,7 +903,7 @@ def begin_create_or_update_async(resource_group_name, server_name, elastic_pool_ if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ElasticPool.mapper() + result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/failover_groups.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/failover_groups.rb new file mode 100755 index 0000000000..61f1280771 --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/failover_groups.rb @@ -0,0 +1,990 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + # + # The Azure SQL Database management API provides a RESTful set of web + # services that interact with Azure SQL Database services to manage your + # databases. The API enables you to create, retrieve, update, and delete + # databases. + # + class FailoverGroups + include MsRestAzure + + # + # Creates and initializes a new instance of the FailoverGroups class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [SqlManagementClient] reference to the SqlManagementClient + attr_reader :client + + # + # Gets a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def get(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = get_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, server_name, failover_group_name, custom_headers = nil) + get_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + end + + # + # Gets a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'failover_group_name is nil' if failover_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'failoverGroupName' => failover_group_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates or updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def create_or_update(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = create_or_update_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, server_name, failover_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = delete_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, server_name, failover_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def update(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = update_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, server_name, failover_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists the failover groups in a server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResourceList] operation results. + # + def list_by_server(resource_group_name, server_name, custom_headers = nil) + response = list_by_server_async(resource_group_name, server_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the failover groups in a server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil) + list_by_server_async(resource_group_name, server_name, custom_headers).value! + end + + # + # Lists the failover groups in a server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_server_async(resource_group_name, server_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResourceList.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Sets which server is primary by failing over from the current primary server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def failover(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = failover_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def failover_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + # Send request + promise = begin_failover_async(resource_group_name, server_name, failover_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Sets which server is primary by failing over from the current primary server. + # This operation might result in data loss. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def force_failover_allow_data_loss(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = force_failover_allow_data_loss_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def force_failover_allow_data_loss_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + # Send request + promise = begin_force_failover_allow_data_loss_async(resource_group_name, server_name, failover_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Creates or updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def begin_create_or_update(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates or updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, server_name, failover_group_name, custom_headers = nil) + begin_create_or_update_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + end + + # + # Creates or updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'failover_group_name is nil' if failover_group_name.nil? + fail ArgumentError, '@client.failover_group is nil' if @client.failover_group.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + request_content = @client.serialize(request_mapper, @client.failover_group, '@client.failover_group') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'failoverGroupName' => failover_group_name}, + query_params: {'api-version' => api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + nil + end + + # + # Deletes a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, server_name, failover_group_name, custom_headers = nil) + begin_delete_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + end + + # + # Deletes a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'failover_group_name is nil' if failover_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'failoverGroupName' => failover_group_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def begin_update(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = begin_update_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, server_name, failover_group_name, custom_headers = nil) + begin_update_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + end + + # + # Updates a failover group. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'failover_group_name is nil' if failover_group_name.nil? + fail ArgumentError, '@client.failover_group is nil' if @client.failover_group.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + request_content = @client.serialize(request_mapper, @client.failover_group, '@client.failover_group') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'failoverGroupName' => failover_group_name}, + query_params: {'api-version' => api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Sets which server is primary by failing over from the current primary server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def begin_failover(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = begin_failover_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Sets which server is primary by failing over from the current primary server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_failover_with_http_info(resource_group_name, server_name, failover_group_name, custom_headers = nil) + begin_failover_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + end + + # + # Sets which server is primary by failing over from the current primary server. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_failover_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'failover_group_name is nil' if failover_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'failoverGroupName' => failover_group_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Sets which server is primary by failing over from the current primary server. + # This operation might result in data loss. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FailoverGroupResource] operation results. + # + def begin_force_failover_allow_data_loss(resource_group_name, server_name, failover_group_name, custom_headers = nil) + response = begin_force_failover_allow_data_loss_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Sets which server is primary by failing over from the current primary server. + # This operation might result in data loss. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_force_failover_allow_data_loss_with_http_info(resource_group_name, server_name, failover_group_name, custom_headers = nil) + begin_force_failover_allow_data_loss_async(resource_group_name, server_name, failover_group_name, custom_headers).value! + end + + # + # Sets which server is primary by failing over from the current primary server. + # This operation might result in data loss. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param failover_group_name [String] The name of the failover group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_force_failover_allow_data_loss_async(resource_group_name, server_name, failover_group_name, custom_headers = nil) + api_version = '2015-05-01-preview' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'failover_group_name is nil' if failover_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'failoverGroupName' => failover_group_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FailoverGroupResource.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/import_export_operations.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/firewall_rules.rb similarity index 56% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/import_export_operations.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/firewall_rules.rb index 797e7fec53..46d5de4699 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/import_export_operations.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/firewall_rules.rb @@ -10,12 +10,11 @@ module Azure::ARM::SQL # databases. The API enables you to create, retrieve, update, and delete # databases. # - class ImportExportOperations - include Azure::ARM::SQL::Models + class FirewallRules include MsRestAzure # - # Creates and initializes a new instance of the ImportExportOperations class. + # Creates and initializes a new instance of the FirewallRules class. # @param client service class for accessing basic functionality. # def initialize(client) @@ -26,55 +25,66 @@ def initialize(client) attr_reader :client # - # The status of an import operation given the operation ID. + # Creates or updates a firewall rule. # # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param firewall_rule_name [String] The name of the firewall rule. + # @param parameters [FirewallRule] The required parameters for creating or + # updating a firewall rule. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationListResponse] operation results. + # @return [FirewallRule] operation results. # - def list_by_server(resource_group_name, server_name, custom_headers = nil) - response = list_by_server_async(resource_group_name, server_name, custom_headers).value! + def create_or_update(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers = nil) + response = create_or_update_async(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers).value! response.body unless response.nil? end # - # The status of an import operation given the operation ID. + # Creates or updates a firewall rule. # # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param firewall_rule_name [String] The name of the firewall rule. + # @param parameters [FirewallRule] The required parameters for creating or + # updating a firewall rule. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil) - list_by_server_async(resource_group_name, server_name, custom_headers).value! + def create_or_update_with_http_info(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers = nil) + create_or_update_async(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers).value! end # - # The status of an import operation given the operation ID. + # Creates or updates a firewall rule. # # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param firewall_rule_name [String] The name of the firewall rule. + # @param parameters [FirewallRule] The required parameters for creating or + # updating a firewall rule. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_by_server_async(resource_group_name, server_name, custom_headers = nil) + def create_or_update_async(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? request_headers = {} @@ -82,24 +92,33 @@ def list_by_server_async(resource_group_name, server_name, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/importExportOperationResults' + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::SQL::Models::FirewallRule.mapper() + request_content = @client.serialize(request_mapper, parameters, 'parameters') + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'firewallRuleName' => firewall_rule_name}, query_params: {'api-version' => api_version}, + body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } - promise = @client.make_request_async(:get, path_template, options) + promise = @client.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body - unless status_code == 200 + unless status_code == 200 || status_code == 201 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end @@ -109,12 +128,112 @@ def list_by_server_async(resource_group_name, server_name, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ImportExportOperationListResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::FirewallRule.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::SQL::Models::FirewallRule.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes a firewall rule. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param firewall_rule_name [String] The name of the firewall rule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) + response = delete_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! + nil + end + + # + # Deletes a firewall rule. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param firewall_rule_name [String] The name of the firewall rule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) + delete_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! + end + + # + # Deletes a firewall rule. + # + # @param resource_group_name [String] 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 server_name [String] The name of the server. + # @param firewall_rule_name [String] The name of the firewall rule. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) + api_version = '2014-04-01' + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'server_name is nil' if server_name.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'firewallRuleName' => firewall_rule_name}, + query_params: {'api-version' => api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result end @@ -123,59 +242,59 @@ def list_by_server_async(resource_group_name, server_name, custom_headers = nil) end # - # The of an import operation given the operation ID. + # Gets a firewall rule. # # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param operation_id The operation ID associated with the operation. + # @param firewall_rule_name [String] The name of the firewall rule. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationResponse] operation results. + # @return [FirewallRule] operation results. # - def get_by_server(resource_group_name, server_name, operation_id, custom_headers = nil) - response = get_by_server_async(resource_group_name, server_name, operation_id, custom_headers).value! + def get(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) + response = get_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! response.body unless response.nil? end # - # The of an import operation given the operation ID. + # Gets a firewall rule. # # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param operation_id The operation ID associated with the operation. + # @param firewall_rule_name [String] The name of the firewall rule. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_by_server_with_http_info(resource_group_name, server_name, operation_id, custom_headers = nil) - get_by_server_async(resource_group_name, server_name, operation_id, custom_headers).value! + def get_with_http_info(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) + get_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! end # - # The of an import operation given the operation ID. + # Gets a firewall rule. # # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param operation_id The operation ID associated with the operation. + # @param firewall_rule_name [String] The name of the firewall rule. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_by_server_async(resource_group_name, server_name, operation_id, custom_headers = nil) + def get_async(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'operation_id is nil' if operation_id.nil? + fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? request_headers = {} @@ -183,13 +302,13 @@ def get_by_server_async(resource_group_name, server_name, operation_id, custom_h # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/importExportOperationResults/{operationId}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'operationId' => operation_id}, + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'firewallRuleName' => firewall_rule_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -210,7 +329,7 @@ def get_by_server_async(resource_group_name, server_name, operation_id, custom_h if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::FirewallRule.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -224,66 +343,55 @@ def get_by_server_async(resource_group_name, server_name, operation_id, custom_h end # - # The status of an import or export operation on a database given the operation - # ID. + # Returns a list of firewall rules. # # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database - # @param operation_id The operation ID associated with the operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImportExportOperationResponse] operation results. + # @return [FirewallRuleListResult] operation results. # - def get_by_database(resource_group_name, server_name, database_name, operation_id, custom_headers = nil) - response = get_by_database_async(resource_group_name, server_name, database_name, operation_id, custom_headers).value! + def list_by_server(resource_group_name, server_name, custom_headers = nil) + response = list_by_server_async(resource_group_name, server_name, custom_headers).value! response.body unless response.nil? end # - # The status of an import or export operation on a database given the operation - # ID. + # Returns a list of firewall rules. # # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database - # @param operation_id The operation ID associated with the operation. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_by_database_with_http_info(resource_group_name, server_name, database_name, operation_id, custom_headers = nil) - get_by_database_async(resource_group_name, server_name, database_name, operation_id, custom_headers).value! + def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil) + list_by_server_async(resource_group_name, server_name, custom_headers).value! end # - # The status of an import or export operation on a database given the operation - # ID. + # Returns a list of firewall rules. # # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param database_name [String] The name of the database - # @param operation_id The operation ID associated with the operation. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_by_database_async(resource_group_name, server_name, database_name, operation_id, custom_headers = nil) + def list_by_server_async(resource_group_name, server_name, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'database_name is nil' if database_name.nil? - fail ArgumentError, 'operation_id is nil' if operation_id.nil? request_headers = {} @@ -291,13 +399,13 @@ def get_by_database_async(resource_group_name, server_name, database_name, opera # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/importExportOperationResults/{operationId}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'operationId' => operation_id}, + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -318,7 +426,7 @@ def get_by_database_async(resource_group_name, server_name, database_name, opera if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::FirewallRuleListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database.rb index 513c111bc7..941af0f69a 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database.rb @@ -8,7 +8,7 @@ module Models # # Represents a database. # - class Database < MsRestAzure::Resource + class Database < TrackedResource include MsRestAzure @@ -106,21 +106,21 @@ class Database < MsRestAzure::Resource # the resource ID of the recovery point to restore from. attr_accessor :recovery_services_recovery_point_resource_id - # @return [DatabaseEditions] The edition of the database. The + # @return [DatabaseEdition] The edition of the database. The # DatabaseEditions enumeration contains all the valid editions. If # createMode is NonReadableSecondary or OnlineSecondary, this value is # ignored. To see possible values, query the capabilities API # (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - # referred to by operationId: "Capabilities_List.". Possible values - # include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - # 'Stretch', 'DataWarehouse', 'System' + # referred to by operationId: "Capabilities_ListByLocation.". Possible + # values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + # 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' attr_accessor :edition # @return [String] The max size of the database expressed in bytes. If # createMode is not Default, this value is ignored. To see possible # values, query the capabilities API # (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - # referred to by operationId: "Capabilities_List." + # referred to by operationId: "Capabilities_ListByLocation." attr_accessor :max_size_bytes # @return The configured service level objective ID of the database. This @@ -132,7 +132,7 @@ class Database < MsRestAzure::Resource # requestedServiceObjectiveName. To see possible values, query the # capabilities API # (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - # referred to by operationId: "Capabilities_List." + # referred to by operationId: "Capabilities_ListByLocation." attr_accessor :requested_service_objective_id # @return [ServiceObjectiveName] The name of the configured service level @@ -141,14 +141,15 @@ class Database < MsRestAzure::Resource # updated, it will match the value of serviceLevelObjective property. To # see possible values, query the capabilities API # (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - # referred to by operationId: "Capabilities_List.". Possible values - # include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - # 'P11', 'P15', 'System', 'ElasticPool' + # referred to by operationId: "Capabilities_ListByLocation.". Possible + # values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', + # 'P4', 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' attr_accessor :requested_service_objective_name # @return [ServiceObjectiveName] The current service level objective of # the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - # 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'ElasticPool' + # 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', + # 'ElasticPool' attr_accessor :service_level_objective # @return [String] The status of the database. @@ -167,9 +168,6 @@ class Database < MsRestAzure::Resource # for this database. Expanded property attr_accessor :service_tier_advisors - # @return [Array] The schemas from this database. - attr_accessor :schemas - # @return [Array] The transparent data # encryption info for this database. attr_accessor :transparent_data_encryption @@ -206,18 +204,18 @@ def self.mapper() name: 'Composite', class_name: 'Database', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -230,13 +228,6 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, tags: { required: false, serialized_name: 'tags', @@ -251,6 +242,13 @@ def self.mapper() } } }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, kind: { required: false, read_only: true, @@ -416,22 +414,6 @@ def self.mapper() } } }, - schemas: { - required: false, - read_only: true, - serialized_name: 'properties.schemas', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'SchemaElementType', - type: { - name: 'Composite', - class_name: 'Schema' - } - } - } - }, transparent_data_encryption: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb index 00d325c5e8..080b09294e 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb @@ -8,10 +8,16 @@ module Models # # Contains information about a database Blob Auditing policy. # - class DatabaseBlobAuditingPolicy < SqlTypedSubResource + class DatabaseBlobAuditingPolicy < ProxyResource include MsRestAzure + # @return [String] The geo-location where the resource lives + attr_accessor :location + + # @return [String] Resource kind. + attr_accessor :kind + # @return [BlobAuditingPolicyState] Specifies the state of the policy. If # state is Enabled, storageEndpoint and storageAccountAccessKey are # required. Possible values include: 'Enabled', 'Disabled' @@ -54,18 +60,18 @@ def self.mapper() name: 'Composite', class_name: 'DatabaseBlobAuditingPolicy', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -78,6 +84,21 @@ def self.mapper() name: 'String' } }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + required: false, + read_only: true, + serialized_name: 'kind', + type: { + name: 'String' + } + }, state: { required: true, serialized_name: 'properties.state', diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_editions.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_edition.rb similarity index 83% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_editions.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_edition.rb index fd33d447a6..884f30450d 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_editions.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_edition.rb @@ -6,9 +6,9 @@ module Azure::ARM::SQL module Models # - # Defines values for DatabaseEditions + # Defines values for DatabaseEdition # - module DatabaseEditions + module DatabaseEdition Web = "Web" Business = "Business" Basic = "Basic" @@ -18,6 +18,7 @@ module DatabaseEditions Stretch = "Stretch" DataWarehouse = "DataWarehouse" System = "System" + System2 = "System2" end end end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_metric.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_metric.rb index b68e838d93..06f536b4e9 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_metric.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_metric.rb @@ -8,7 +8,7 @@ module Models # # Represents database metrics. # - class DatabaseMetric < SqlSubResource + class DatabaseMetric < SubResource include MsRestAzure diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_security_alert_policy.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_security_alert_policy.rb index 35acfc76cf..03c937d00c 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_security_alert_policy.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/database_security_alert_policy.rb @@ -8,19 +8,25 @@ module Models # # Contains information about a database Threat Detection policy. # - class DatabaseSecurityAlertPolicy < SqlTypedSubResource + class DatabaseSecurityAlertPolicy < ProxyResource include MsRestAzure + # @return [String] The geo-location where the resource lives + attr_accessor :location + + # @return [String] Resource kind. + attr_accessor :kind + # @return [SecurityAlertPolicyState] Specifies the state of the policy. # If state is Enabled, storageEndpoint and storageAccountAccessKey are # required. Possible values include: 'New', 'Enabled', 'Disabled' attr_accessor :state - # @return [SecurityAlert] Specifies the comma-separated list of alerts - # that are disabled, or empty string to disable no alerts. Possible - # values include: 'Sql_Injection', 'Sql_Injection_Vulnerability', - # 'Access_Anomaly', 'Usage_Anomaly', 'Preview' + # @return [String] Specifies the semicolon-separated list of alerts that + # are disabled, or empty string to disable no alerts. Possible values: + # Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; + # Usage_Anomaly. attr_accessor :disabled_alerts # @return [String] Specifies the semicolon-separated list of e-mail @@ -65,18 +71,18 @@ def self.mapper() name: 'Composite', class_name: 'DatabaseSecurityAlertPolicy', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -89,6 +95,21 @@ def self.mapper() name: 'String' } }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + kind: { + required: false, + read_only: true, + serialized_name: 'kind', + type: { + name: 'String' + } + }, state: { required: true, serialized_name: 'properties.state', diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool.rb index c7977b8628..5158392422 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool.rb @@ -8,7 +8,7 @@ module Models # # Represents a database elastic pool. # - class ElasticPool < MsRestAzure::Resource + class ElasticPool < TrackedResource include MsRestAzure @@ -20,7 +20,7 @@ class ElasticPool < MsRestAzure::Resource # values include: 'Creating', 'Ready', 'Disabled' attr_accessor :state - # @return [ElasticPoolEditions] The edition of the elastic pool. Possible + # @return [ElasticPoolEdition] The edition of the elastic pool. Possible # values include: 'Basic', 'Standard', 'Premium' attr_accessor :edition @@ -54,18 +54,18 @@ def self.mapper() name: 'Composite', class_name: 'ElasticPool', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -78,13 +78,6 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, tags: { required: false, serialized_name: 'tags', @@ -99,6 +92,13 @@ def self.mapper() } } }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, creation_date: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb index 5731443095..491da66241 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb @@ -8,10 +8,13 @@ module Models # # Represents the activity on an elastic pool. # - class ElasticPoolActivity < MsRestAzure::Resource + class ElasticPoolActivity < ProxyResource include MsRestAzure + # @return [String] The geo-location where the resource lives + attr_accessor :location + # @return [DateTime] The time the operation finished (ISO8601 format). attr_accessor :end_time @@ -86,18 +89,18 @@ def self.mapper() name: 'Composite', class_name: 'ElasticPoolActivity', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -111,26 +114,12 @@ def self.mapper() } }, location: { - required: true, + required: false, serialized_name: 'location', type: { name: 'String' } }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, end_time: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb index e7967b1fbc..fd83a3733a 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb @@ -8,10 +8,13 @@ module Models # # Represents the activity on an elastic pool. # - class ElasticPoolDatabaseActivity < MsRestAzure::Resource + class ElasticPoolDatabaseActivity < ProxyResource include MsRestAzure + # @return [String] The geo-location where the resource lives + attr_accessor :location + # @return [String] The database name. attr_accessor :database_name @@ -30,7 +33,7 @@ class ElasticPoolDatabaseActivity < MsRestAzure::Resource # @return [String] The operation name. attr_accessor :operation - # @return [String] The unique operation ID. + # @return The unique operation ID. attr_accessor :operation_id # @return [Integer] The percentage complete if available. @@ -74,18 +77,18 @@ def self.mapper() name: 'Composite', class_name: 'ElasticPoolDatabaseActivity', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -99,26 +102,12 @@ def self.mapper() } }, location: { - required: true, + required: false, serialized_name: 'location', type: { name: 'String' } }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, database_name: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_editions.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_edition.rb similarity index 80% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_editions.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_edition.rb index 3ebc4d39fa..e399b40950 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_editions.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/elastic_pool_edition.rb @@ -6,9 +6,9 @@ module Azure::ARM::SQL module Models # - # Defines values for ElasticPoolEditions + # Defines values for ElasticPoolEdition # - module ElasticPoolEditions + module ElasticPoolEdition Basic = "Basic" Standard = "Standard" Premium = "Premium" diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/export_request_parameters.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/export_request.rb similarity index 81% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/export_request_parameters.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/export_request.rb index 5779d37c4a..d83c68c934 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/export_request_parameters.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/export_request.rb @@ -8,16 +8,16 @@ module Models # # Export database parameters. # - class ExportRequestParameters + class ExportRequest include MsRestAzure - # @return [StorageKeyType] The type of the storage key to use. Valid - # values are StorageAccessKey and SharedAccessKey. Possible values - # include: 'StorageAccessKey', 'SharedAccessKey' + # @return [StorageKeyType] The type of the storage key to use. Possible + # values include: 'StorageAccessKey', 'SharedAccessKey' attr_accessor :storage_key_type - # @return [String] The storage key to use. + # @return [String] The storage key to use. If storage key type is + # SharedAccessKey, it must be preceded with a "?." attr_accessor :storage_key # @return [String] The storage uri to use. @@ -29,23 +29,22 @@ class ExportRequestParameters # @return [String] The password of the SQL administrator. attr_accessor :administrator_login_password - # @return [AuthenticationType] The authentication type - if not - # specified, will default to SQL. Possible values include: 'SQL', - # 'ADPassword' + # @return [AuthenticationType] The authentication type. Possible values + # include: 'SQL', 'ADPassword'. Default value: 'SQL' . attr_accessor :authentication_type # - # Mapper for ExportRequestParameters class as Ruby Hash. + # Mapper for ExportRequest class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ExportRequestParameters', + serialized_name: 'ExportRequest', type: { name: 'Composite', - class_name: 'ExportRequestParameters', + class_name: 'ExportRequest', model_properties: { storage_key_type: { required: true, @@ -86,6 +85,7 @@ def self.mapper() authentication_type: { required: false, serialized_name: 'authenticationType', + default_value: 'SQL', type: { name: 'Enum', module: 'AuthenticationType' diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_read_only_endpoint.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_read_only_endpoint.rb new file mode 100755 index 0000000000..b82ba16225 --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_read_only_endpoint.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + module Models + # + # Model object. + # + # + class FailoverGroupReadOnlyEndpoint + + include MsRestAzure + + # @return [ReadOnlyEndpointFailoverPolicy] Failover policy of the + # read-only endpoint for the failover group. Possible values include: + # 'Disabled', 'Enabled' + attr_accessor :failover_policy + + + # + # Mapper for FailoverGroupReadOnlyEndpoint class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'FailoverGroupReadOnlyEndpoint', + type: { + name: 'Composite', + class_name: 'FailoverGroupReadOnlyEndpoint', + model_properties: { + failover_policy: { + required: false, + serialized_name: 'failoverPolicy', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb new file mode 100755 index 0000000000..860cebfbda --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + module Models + # + # Model object. + # + # + class FailoverGroupReadWriteEndpoint + + include MsRestAzure + + # @return [ReadWriteEndpointFailoverPolicy] Failover policy of the + # read-write endpoint for the failover group. Possible values include: + # 'Manual', 'Automatic' + attr_accessor :failover_policy + + # @return [Integer] Grace period before failover with data loss is + # attempted for the read-write endpoint. + attr_accessor :failover_with_data_loss_grace_period_minutes + + + # + # Mapper for FailoverGroupReadWriteEndpoint class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'FailoverGroupReadWriteEndpoint', + type: { + name: 'Composite', + class_name: 'FailoverGroupReadWriteEndpoint', + model_properties: { + failover_policy: { + required: false, + serialized_name: 'failoverPolicy', + type: { + name: 'String' + } + }, + failover_with_data_loss_grace_period_minutes: { + required: false, + serialized_name: 'failoverWithDataLossGracePeriodMinutes', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/table_type.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_replication_role.rb similarity index 61% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/table_type.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_replication_role.rb index 743ac02330..d38e529a81 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/table_type.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_replication_role.rb @@ -6,11 +6,11 @@ module Azure::ARM::SQL module Models # - # Defines values for TableType + # Defines values for FailoverGroupReplicationRole # - module TableType - BaseTable = "BaseTable" - View = "View" + module FailoverGroupReplicationRole + Primary = "Primary" + Secondary = "Secondary" end end end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_resource.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_resource.rb new file mode 100755 index 0000000000..0b05a626ce --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_resource.rb @@ -0,0 +1,169 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + module Models + # + # Contains information about failover group. + # + class FailoverGroupResource < ProxyResource + + include MsRestAzure + + # @return [String] The geo-location where the resource lives. + attr_accessor :location + + # @return [Hash{String => String}] Resource tags. + attr_accessor :tags + + # @return [FailoverGroupReadWriteEndpoint] Read-write endpoint of the + # failover group instance. + attr_accessor :read_write_endpoint + + # @return [FailoverGroupReadOnlyEndpoint] Read-only endpoint of the + # failover group instance. + attr_accessor :read_only_endpoint + + # @return [FailoverGroupReplicationRole] Local replication role of the + # failover group instance. Possible values include: 'Primary', + # 'Secondary' + attr_accessor :replication_role + + # @return [String] Replication state of the failover group instance. + attr_accessor :replication_state + + # @return [Array] List of partner server information for the + # failover group. + attr_accessor :partner_servers + + # @return [Array] List of databases in the failover group. + attr_accessor :databases + + + # + # Mapper for FailoverGroupResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'FailoverGroupResource', + type: { + name: 'Composite', + class_name: 'FailoverGroupResource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + read_write_endpoint: { + required: false, + serialized_name: 'properties.readWriteEndpoint', + type: { + name: 'Composite', + class_name: 'FailoverGroupReadWriteEndpoint' + } + }, + read_only_endpoint: { + required: false, + serialized_name: 'properties.readOnlyEndpoint', + type: { + name: 'Composite', + class_name: 'FailoverGroupReadOnlyEndpoint' + } + }, + replication_role: { + required: false, + read_only: true, + serialized_name: 'properties.replicationRole', + type: { + name: 'String' + } + }, + replication_state: { + required: false, + read_only: true, + serialized_name: 'properties.replicationState', + type: { + name: 'String' + } + }, + partner_servers: { + required: false, + serialized_name: 'properties.partnerServers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PartnerInfoElementType', + type: { + name: 'Composite', + class_name: 'PartnerInfo' + } + } + } + }, + databases: { + required: false, + serialized_name: 'properties.databases', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_list_response.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_resource_list.rb similarity index 55% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_list_response.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_resource_list.rb index db465d67d4..3895caf144 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_list_response.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/failover_group_resource_list.rb @@ -6,42 +6,52 @@ module Azure::ARM::SQL module Models # - # Response for Import/Export List operation. + # A list of failover groups. # - class ImportExportOperationListResponse + class FailoverGroupResourceList include MsRestAzure - # @return [Array] + # @return [Array] attr_accessor :value + # @return [String] + attr_accessor :next_link + # - # Mapper for ImportExportOperationListResponse class as Ruby Hash. + # Mapper for FailoverGroupResourceList class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ImportExportOperationListResponse', + serialized_name: 'FailoverGroupResourceList', type: { name: 'Composite', - class_name: 'ImportExportOperationListResponse', + class_name: 'FailoverGroupResourceList', model_properties: { value: { - required: true, + required: false, serialized_name: 'value', type: { name: 'Sequence', element: { required: false, - serialized_name: 'ImportExportOperationResponseElementType', + serialized_name: 'FailoverGroupResourceElementType', type: { name: 'Composite', - class_name: 'ImportExportOperationResponse' + class_name: 'FailoverGroupResource' } } } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } } } } diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server_firewall_rule.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/firewall_rule.rb similarity index 93% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server_firewall_rule.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/firewall_rule.rb index 5caf175eb0..6b7d3421eb 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server_firewall_rule.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/firewall_rule.rb @@ -8,7 +8,7 @@ module Models # # Represents a server firewall rule. # - class ServerFirewallRule < SqlSubResource + class FirewallRule < SubResource include MsRestAzure @@ -34,16 +34,16 @@ class ServerFirewallRule < SqlSubResource # - # Mapper for ServerFirewallRule class as Ruby Hash. + # Mapper for FirewallRule class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ServerFirewallRule', + serialized_name: 'FirewallRule', type: { name: 'Composite', - class_name: 'ServerFirewallRule', + class_name: 'FirewallRule', model_properties: { name: { required: false, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/firewall_rule_list_result.rb similarity index 69% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/firewall_rule_list_result.rb index 2bb5600f72..456da77d61 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/firewall_rule_list_result.rb @@ -8,25 +8,25 @@ module Models # # Represents the response to a List Firewall Rules request. # - class ServerFirewallRuleListResult + class FirewallRuleListResult include MsRestAzure - # @return [Array] The list of server firewall rules. + # @return [Array] The list of server firewall rules. attr_accessor :value # - # Mapper for ServerFirewallRuleListResult class as Ruby Hash. + # Mapper for FirewallRuleListResult class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ServerFirewallRuleListResult', + serialized_name: 'FirewallRuleListResult', type: { name: 'Composite', - class_name: 'ServerFirewallRuleListResult', + class_name: 'FirewallRuleListResult', model_properties: { value: { required: false, @@ -35,10 +35,10 @@ def self.mapper() name: 'Sequence', element: { required: false, - serialized_name: 'ServerFirewallRuleElementType', + serialized_name: 'FirewallRuleElementType', type: { name: 'Composite', - class_name: 'ServerFirewallRule' + class_name: 'FirewallRule' } } } diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_response_properties_model.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_response_properties_model.rb deleted file mode 100755 index c46dc66a21..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_response_properties_model.rb +++ /dev/null @@ -1,134 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Response for Import/Export Status operation. - # - class ImportExportOperationResponsePropertiesModel - - include MsRestAzure - - # @return [String] The request type of the operation. - attr_accessor :request_type - - # @return The request type of the operation. - attr_accessor :request_id - - # @return [String] The name of the server. - attr_accessor :server_name - - # @return [String] The name of the database. - attr_accessor :database_name - - # @return [String] The status message returned from the server. - attr_accessor :status - - # @return [String] The operation status last modified time. - attr_accessor :last_modified_time - - # @return [String] The operation queued time. - attr_accessor :queued_time - - # @return [String] The blob uri. - attr_accessor :blob_uri - - # @return [String] The error message returned from the server. - attr_accessor :error_message - - - # - # Mapper for ImportExportOperationResponsePropertiesModel class as Ruby - # Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'ImportExportOperationResponseProperties', - type: { - name: 'Composite', - class_name: 'ImportExportOperationResponsePropertiesModel', - model_properties: { - request_type: { - required: false, - read_only: true, - serialized_name: 'requestType', - type: { - name: 'String' - } - }, - request_id: { - required: false, - read_only: true, - serialized_name: 'requestId', - type: { - name: 'String' - } - }, - server_name: { - required: false, - read_only: true, - serialized_name: 'serverName', - type: { - name: 'String' - } - }, - database_name: { - required: false, - read_only: true, - serialized_name: 'databaseName', - type: { - name: 'String' - } - }, - status: { - required: false, - read_only: true, - serialized_name: 'status', - type: { - name: 'String' - } - }, - last_modified_time: { - required: false, - read_only: true, - serialized_name: 'lastModifiedTime', - type: { - name: 'String' - } - }, - queued_time: { - required: false, - read_only: true, - serialized_name: 'queuedTime', - type: { - name: 'String' - } - }, - blob_uri: { - required: false, - read_only: true, - serialized_name: 'blobUri', - type: { - name: 'String' - } - }, - error_message: { - required: false, - read_only: true, - serialized_name: 'errorMessage', - type: { - name: 'String' - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_response.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_response.rb similarity index 89% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_response.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_response.rb index 76d12bd3d0..6e66f31acd 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_operation_response.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_export_response.rb @@ -8,19 +8,10 @@ module Models # # Response for Import/Export Get operation. # - class ImportExportOperationResponse + class ImportExportResponse < ProxyResource include MsRestAzure - # @return [String] The id returned from the server. - attr_accessor :id - - # @return [String] The name returned from the server. - attr_accessor :name - - # @return [String] The type returned from the server. - attr_accessor :type - # @return [String] The request type of the operation. attr_accessor :request_type @@ -50,16 +41,16 @@ class ImportExportOperationResponse # - # Mapper for ImportExportOperationResponse class as Ruby Hash. + # Mapper for ImportExportResponse class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ImportExportOperationResponse', + serialized_name: 'ImportExportResponse', type: { name: 'Composite', - class_name: 'ImportExportOperationResponse', + class_name: 'ImportExportResponse', model_properties: { id: { required: false, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_extension_request_parameters.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_extension_request.rb similarity index 82% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_extension_request_parameters.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_extension_request.rb index 212b020a4b..d2c998984f 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_extension_request_parameters.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_extension_request.rb @@ -8,7 +8,7 @@ module Models # # Import database parameters. # - class ImportExtensionRequestParameters + class ImportExtensionRequest include MsRestAzure @@ -18,12 +18,12 @@ class ImportExtensionRequestParameters # @return [String] The type of the extension. attr_accessor :type - # @return [StorageKeyType] The type of the storage key to use. Valid - # values are StorageAccessKey and SharedAccessKey. Possible values - # include: 'StorageAccessKey', 'SharedAccessKey' + # @return [StorageKeyType] The type of the storage key to use. Possible + # values include: 'StorageAccessKey', 'SharedAccessKey' attr_accessor :storage_key_type - # @return [String] The storage key to use. + # @return [String] The storage key to use. If storage key type is + # SharedAccessKey, it must be preceded with a "?." attr_accessor :storage_key # @return [String] The storage uri to use. @@ -35,27 +35,26 @@ class ImportExtensionRequestParameters # @return [String] The password of the SQL administrator. attr_accessor :administrator_login_password - # @return [AuthenticationType] The authentication type - if not - # specified, will default to SQL. Possible values include: 'SQL', - # 'ADPassword' + # @return [AuthenticationType] The authentication type. Possible values + # include: 'SQL', 'ADPassword'. Default value: 'SQL' . attr_accessor :authentication_type - # @return [String] The type of Import/Export operation being performed. - # This is always Import. Default value: 'Import' . + # @return [String] The type of import operation being performed. This is + # always Import. Default value: 'Import' . attr_accessor :operation_mode # - # Mapper for ImportExtensionRequestParameters class as Ruby Hash. + # Mapper for ImportExtensionRequest class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ImportExtensionRequestParameters', + serialized_name: 'ImportExtensionRequest', type: { name: 'Composite', - class_name: 'ImportExtensionRequestParameters', + class_name: 'ImportExtensionRequest', model_properties: { name: { required: false, @@ -110,6 +109,7 @@ def self.mapper() authentication_type: { required: false, serialized_name: 'properties.authenticationType', + default_value: 'SQL', type: { name: 'Enum', module: 'AuthenticationType' diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_request_parameters.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_request.rb similarity index 81% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_request_parameters.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_request.rb index 5f0b759c2e..672293497a 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_request_parameters.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/import_request.rb @@ -8,18 +8,22 @@ module Models # # Import database parameters. # - class ImportRequestParameters < ExportRequestParameters + class ImportRequest < ExportRequest include MsRestAzure # @return [String] The name of the database to import. attr_accessor :database_name - # @return [String] The edition for the database being created. + # @return [DatabaseEdition] The edition for the database being created. + # Possible values include: 'Web', 'Business', 'Basic', 'Standard', + # 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' attr_accessor :edition - # @return [String] The name of the service objective to assign to the - # database. + # @return [ServiceObjectiveName] The name of the service objective to + # assign to the database. Possible values include: 'Basic', 'S0', 'S1', + # 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', + # 'System2', 'ElasticPool' attr_accessor :service_objective_name # @return [String] The maximum size for the newly imported database. @@ -27,16 +31,16 @@ class ImportRequestParameters < ExportRequestParameters # - # Mapper for ImportRequestParameters class as Ruby Hash. + # Mapper for ImportRequest class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'ImportRequestParameters', + serialized_name: 'ImportRequest', type: { name: 'Composite', - class_name: 'ImportRequestParameters', + class_name: 'ImportRequest', model_properties: { storage_key_type: { required: true, @@ -77,6 +81,7 @@ def self.mapper() authentication_type: { required: false, serialized_name: 'authenticationType', + default_value: 'SQL', type: { name: 'Enum', module: 'AuthenticationType' diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/partner_info.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/partner_info.rb new file mode 100755 index 0000000000..30fefda3a4 --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/partner_info.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + module Models + # + # Model object. + # + # + class PartnerInfo + + include MsRestAzure + + # @return [String] Resource identifier of the partner server. + attr_accessor :id + + # @return [String] Geo location of the partner server. + attr_accessor :location + + # @return [FailoverGroupReplicationRole] Replication role of the partner + # server. Possible values include: 'Primary', 'Secondary' + attr_accessor :replication_role + + + # + # Mapper for PartnerInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'PartnerInfo', + type: { + name: 'Composite', + class_name: 'PartnerInfo', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + location: { + required: false, + read_only: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + replication_role: { + required: false, + read_only: true, + serialized_name: 'replicationRole', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sql_typed_sub_resource.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/proxy_resource.rb similarity index 80% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sql_typed_sub_resource.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/proxy_resource.rb index 52d3fd957c..d681e5b5b0 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sql_typed_sub_resource.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/proxy_resource.rb @@ -6,40 +6,37 @@ module Azure::ARM::SQL module Models # - # Subresource properties + # ARM proxy resource. # - class SqlTypedSubResource < SqlSubResource + class ProxyResource < MsRestAzure::Resource include MsRestAzure - # @return [String] Resource type - attr_accessor :type - # - # Mapper for SqlTypedSubResource class as Ruby Hash. + # Mapper for ProxyResource class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'SqlTypedSubResource', + serialized_name: 'ProxyResource', type: { name: 'Composite', - class_name: 'SqlTypedSubResource', + class_name: 'ProxyResource', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_states.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb similarity index 74% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_states.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb index 078bb9f37c..9aab597420 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_states.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb @@ -6,11 +6,11 @@ module Azure::ARM::SQL module Models # - # Defines values for TransparentDataEncryptionStates + # Defines values for ReadOnlyEndpointFailoverPolicy # - module TransparentDataEncryptionStates - Enabled = "Enabled" + module ReadOnlyEndpointFailoverPolicy Disabled = "Disabled" + Enabled = "Enabled" end end end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb new file mode 100755 index 0000000000..22b8fac9ae --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + module Models + # + # Defines values for ReadWriteEndpointFailoverPolicy + # + module ReadWriteEndpointFailoverPolicy + Manual = "Manual" + Automatic = "Automatic" + end + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb index 6c1fae5129..32f531c800 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb @@ -8,12 +8,12 @@ module Models # # Represents a recommented elastic pool. # - class RecommendedElasticPool < MsRestAzure::Resource + class RecommendedElasticPool < ProxyResource include MsRestAzure - # @return [ElasticPoolEditions] The edition of the recommended elastic - # pool. The ElasticPoolEditions enumeration contains all the valid + # @return [ElasticPoolEdition] The edition of the recommended elastic + # pool. The ElasticPoolEdition enumeration contains all the valid # editions. Possible values include: 'Basic', 'Standard', 'Premium' attr_accessor :database_edition @@ -62,18 +62,18 @@ def self.mapper() name: 'Composite', class_name: 'RecommendedElasticPool', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -86,27 +86,6 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, database_edition: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index.rb index a6d8eb70af..6e33e7cd0d 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index.rb @@ -8,17 +8,17 @@ module Models # # Represents a database recommended index. # - class RecommendedIndex < MsRestAzure::Resource + class RecommendedIndex < ProxyResource include MsRestAzure - # @return [RecommendedIndexActions] The proposed index action. You can + # @return [RecommendedIndexAction] The proposed index action. You can # create a missing index, drop an unused index, or rebuild an existing # index to improve its performance. Possible values include: 'Create', # 'Drop', 'Rebuild' attr_accessor :action - # @return [RecommendedIndexStates] The current recommendation state. + # @return [RecommendedIndexState] The current recommendation state. # Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', # 'Pending Revert', 'Reverting', 'Reverted', 'Ignored', 'Expired', # 'Blocked', 'Success' @@ -32,7 +32,7 @@ class RecommendedIndex < MsRestAzure::Resource # changed (ISO8601 format). attr_accessor :last_modified - # @return [RecommendedIndexTypes] The type of index (CLUSTERED, + # @return [RecommendedIndexType] The type of index (CLUSTERED, # NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values # include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED # COLUMNSTORE' @@ -75,18 +75,18 @@ def self.mapper() name: 'Composite', class_name: 'RecommendedIndex', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -99,34 +99,13 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, action: { required: false, read_only: true, serialized_name: 'properties.action', type: { name: 'Enum', - module: 'RecommendedIndexActions' + module: 'RecommendedIndexAction' } }, state: { @@ -135,7 +114,7 @@ def self.mapper() serialized_name: 'properties.state', type: { name: 'Enum', - module: 'RecommendedIndexStates' + module: 'RecommendedIndexState' } }, created: { @@ -160,7 +139,7 @@ def self.mapper() serialized_name: 'properties.indexType', type: { name: 'Enum', - module: 'RecommendedIndexTypes' + module: 'RecommendedIndexType' } }, schema: { diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_actions.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_action.rb similarity index 78% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_actions.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_action.rb index be3ad48b53..c842e5d04b 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_actions.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_action.rb @@ -6,9 +6,9 @@ module Azure::ARM::SQL module Models # - # Defines values for RecommendedIndexActions + # Defines values for RecommendedIndexAction # - module RecommendedIndexActions + module RecommendedIndexAction Create = "Create" Drop = "Drop" Rebuild = "Rebuild" diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_states.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_state.rb similarity index 87% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_states.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_state.rb index b0d60f00c4..36b12d8d20 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_states.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_state.rb @@ -6,9 +6,9 @@ module Azure::ARM::SQL module Models # - # Defines values for RecommendedIndexStates + # Defines values for RecommendedIndexState # - module RecommendedIndexStates + module RecommendedIndexState Active = "Active" Pending = "Pending" Executing = "Executing" diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_types.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_type.rb similarity index 83% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_types.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_type.rb index 06dea7abfa..c0c541f006 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_types.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/recommended_index_type.rb @@ -6,9 +6,9 @@ module Azure::ARM::SQL module Models # - # Defines values for RecommendedIndexTypes + # Defines values for RecommendedIndexType # - module RecommendedIndexTypes + module RecommendedIndexType CLUSTERED = "CLUSTERED" NONCLUSTERED = "NONCLUSTERED" COLUMNSTORE = "COLUMNSTORE" diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/replication_link.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/replication_link.rb index 6b32829a9d..cc5eab99ee 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/replication_link.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/replication_link.rb @@ -8,7 +8,7 @@ module Models # # Represents a database replication link. # - class ReplicationLink < SqlSubResource + class ReplicationLink < SubResource include MsRestAzure diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/restore_point.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/restore_point.rb index f3244f6ddd..451200440d 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/restore_point.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/restore_point.rb @@ -8,7 +8,7 @@ module Models # # Represents a database restore point. # - class RestorePoint < MsRestAzure::Resource + class RestorePoint < ProxyResource include MsRestAzure @@ -37,18 +37,18 @@ def self.mapper() name: 'Composite', class_name: 'RestorePoint', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -61,27 +61,6 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, restore_point_type: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/schema.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/schema.rb deleted file mode 100755 index 0b753e1376..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/schema.rb +++ /dev/null @@ -1,98 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Represents a database schema. - # - class Schema < MsRestAzure::Resource - - include MsRestAzure - - # @return [Array] The tables from this database. - attr_accessor :tables - - - # - # Mapper for Schema class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'Schema', - type: { - name: 'Composite', - class_name: 'Schema', - model_properties: { - name: { - required: false, - read_only: true, - serialized_name: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - read_only: true, - serialized_name: 'id', - type: { - name: 'String' - } - }, - type: { - required: false, - read_only: true, - serialized_name: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - tables: { - required: false, - read_only: true, - serialized_name: 'properties.tables', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'TableElementType', - type: { - name: 'Composite', - class_name: 'Table' - } - } - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/security_alert.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/security_alert.rb deleted file mode 100755 index 71f3bdeb60..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/security_alert.rb +++ /dev/null @@ -1,19 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Defines values for SecurityAlert - # - module SecurityAlert - SqlInjection = "Sql_Injection" - SqlInjectionVulnerability = "Sql_Injection_Vulnerability" - AccessAnomaly = "Access_Anomaly" - UsageAnomaly = "Usage_Anomaly" - Preview = "Preview" - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server.rb index 4674c1221a..2015df5fa7 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/server.rb @@ -8,7 +8,7 @@ module Models # # Represents a server. # - class Server < MsRestAzure::Resource + class Server < TrackedResource include MsRestAzure @@ -60,18 +60,18 @@ def self.mapper() name: 'Composite', class_name: 'Server', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -84,13 +84,6 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, tags: { required: false, serialized_name: 'tags', @@ -105,6 +98,13 @@ def self.mapper() } } }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, kind: { required: false, read_only: true, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective.rb index 8d2b0f9711..e8e8d66b43 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective.rb @@ -8,7 +8,7 @@ module Models # # Represents a database service objective. # - class ServiceObjective < SqlSubResource + class ServiceObjective < SubResource include MsRestAzure diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective_name.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective_name.rb index 067a3c3d32..cba283c9a1 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective_name.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_objective_name.rb @@ -22,6 +22,7 @@ module ServiceObjectiveName P11 = "P11" P15 = "P15" System = "System" + System2 = "System2" ElasticPool = "ElasticPool" end end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb index ea677a2335..7be858f517 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb @@ -8,7 +8,7 @@ module Models # # Represents a Service Tier Advisor. # - class ServiceTierAdvisor < SqlSubResource + class ServiceTierAdvisor < SubResource include MsRestAzure diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb index 3152b40d47..7bbcbdbaf6 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb @@ -14,7 +14,8 @@ class SloUsageMetric # @return [ServiceObjectiveName] The serviceLevelObjective for SLO usage # metric. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', - # 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'ElasticPool' + # 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', + # 'ElasticPool' attr_accessor :service_level_objective # @return The serviceLevelObjectiveId for SLO usage metric. diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sub_resource.rb similarity index 82% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sub_resource.rb index cae60b505a..bbc4daafb6 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/sub_resource.rb @@ -8,28 +8,25 @@ module Models # # Subresource properties # - class SqlSubResource + class SubResource < MsRestAzure::SubResource include MsRestAzure # @return [String] Resource name attr_accessor :name - # @return [String] The resource ID. - attr_accessor :id - # - # Mapper for SqlSubResource class as Ruby Hash. + # Mapper for SubResource class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'SqlSubResource', + serialized_name: 'SubResource', type: { name: 'Composite', - class_name: 'SqlSubResource', + class_name: 'SubResource', model_properties: { name: { required: false, diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/table.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/table.rb deleted file mode 100755 index d7bec25372..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/table.rb +++ /dev/null @@ -1,131 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Represents a database table. - # - class Table < MsRestAzure::Resource - - include MsRestAzure - - # @return [TableType] The type of database table. Possible values - # include: 'BaseTable', 'View' - attr_accessor :table_type - - # @return [Array] The columns from this table. - attr_accessor :columns - - # @return [Array] The recommended indices for this - # table. - attr_accessor :recommended_indexes - - - # - # Mapper for Table class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'Table', - type: { - name: 'Composite', - class_name: 'Table', - model_properties: { - name: { - required: false, - read_only: true, - serialized_name: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - read_only: true, - serialized_name: 'id', - type: { - name: 'String' - } - }, - type: { - required: false, - read_only: true, - serialized_name: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serialized_name: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - table_type: { - required: false, - read_only: true, - serialized_name: 'properties.tableType', - type: { - name: 'Enum', - module: 'TableType' - } - }, - columns: { - required: false, - read_only: true, - serialized_name: 'properties.columns', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'ColumnElementType', - type: { - name: 'Composite', - class_name: 'Column' - } - } - } - }, - recommended_indexes: { - required: false, - read_only: true, - serialized_name: 'properties.recommendedIndexes', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'RecommendedIndexElementType', - type: { - name: 'Composite', - class_name: 'RecommendedIndex' - } - } - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb deleted file mode 100755 index ce0c02e868..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Defines values for TargetElasticPoolEditions - # - module TargetElasticPoolEditions - Basic = "Basic" - Standard = "Standard" - Premium = "Premium" - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/column.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/tracked_resource.rb similarity index 77% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/column.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/tracked_resource.rb index dad5de777d..839562513c 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/column.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/tracked_resource.rb @@ -6,40 +6,43 @@ module Azure::ARM::SQL module Models # - # Represents a database table column. + # ARM tracked top level resource. # - class Column < MsRestAzure::Resource + class TrackedResource < MsRestAzure::Resource include MsRestAzure - # @return [String] The type of database table column. - attr_accessor :column_type + # @return [Hash{String => String}] Resource tags. + attr_accessor :tags + + # @return [String] Resource location. + attr_accessor :location # - # Mapper for Column class as Ruby Hash. + # Mapper for TrackedResource class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'Column', + serialized_name: 'TrackedResource', type: { name: 'Composite', - class_name: 'Column', + class_name: 'TrackedResource', model_properties: { - name: { + id: { required: false, read_only: true, - serialized_name: 'name', + serialized_name: 'id', type: { name: 'String' } }, - id: { + name: { required: false, read_only: true, - serialized_name: 'id', + serialized_name: 'name', type: { name: 'String' } @@ -52,13 +55,6 @@ def self.mapper() name: 'String' } }, - location: { - required: true, - serialized_name: 'location', - type: { - name: 'String' - } - }, tags: { required: false, serialized_name: 'tags', @@ -73,10 +69,9 @@ def self.mapper() } } }, - column_type: { - required: false, - read_only: true, - serialized_name: 'properties.columnType', + location: { + required: true, + serialized_name: 'location', type: { name: 'String' } diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb index 9960e6dfcf..780668635d 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb @@ -8,11 +8,11 @@ module Models # # Represents a database transparent data encryption . # - class TransparentDataEncryption < SqlSubResource + class TransparentDataEncryption < SubResource include MsRestAzure - # @return [TransparentDataEncryptionStates] The status of the database + # @return [TransparentDataEncryptionStatus] The status of the database # transparent data encryption. Possible values include: 'Enabled', # 'Disabled' attr_accessor :status @@ -51,7 +51,7 @@ def self.mapper() serialized_name: 'properties.status', type: { name: 'Enum', - module: 'TransparentDataEncryptionStates' + module: 'TransparentDataEncryptionStatus' } } } diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb index 455eb496ee..ecf5d81225 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb @@ -8,11 +8,11 @@ module Models # # Represents a database transparent data encryption Scan. # - class TransparentDataEncryptionActivity < SqlSubResource + class TransparentDataEncryptionActivity < SubResource include MsRestAzure - # @return [TransparentDataEncryptionActivityStates] The status of the + # @return [TransparentDataEncryptionActivityStatus] The status of the # database. Possible values include: 'Encrypting', 'Decrypting' attr_accessor :status diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_status.rb similarity index 72% rename from management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb rename to management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_status.rb index 80f9a8f944..34bf185d6b 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_status.rb @@ -6,9 +6,9 @@ module Azure::ARM::SQL module Models # - # Defines values for TransparentDataEncryptionActivityStates + # Defines values for TransparentDataEncryptionActivityStatus # - module TransparentDataEncryptionActivityStates + module TransparentDataEncryptionActivityStatus Encrypting = "Encrypting" Decrypting = "Decrypting" end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_status.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_status.rb new file mode 100755 index 0000000000..1994e02ca9 --- /dev/null +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_status.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::SQL + module Models + # + # Defines values for TransparentDataEncryptionStatus + # + module TransparentDataEncryptionStatus + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb deleted file mode 100755 index 403e2d8368..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb +++ /dev/null @@ -1,54 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Represents a Upgrade Hint. - # - class UpgradeHint - - include MsRestAzure - - # @return [String] TargetServiceLevelObjective for upgrade hint. - attr_accessor :target_service_level_objective - - # @return TargetServiceLevelObjectiveId for upgrade hint. - attr_accessor :target_service_level_objective_id - - - # - # Mapper for UpgradeHint class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'UpgradeHint', - type: { - name: 'Composite', - class_name: 'UpgradeHint', - model_properties: { - target_service_level_objective: { - required: false, - serialized_name: 'targetServiceLevelObjective', - type: { - name: 'String' - } - }, - target_service_level_objective_id: { - required: false, - serialized_name: 'targetServiceLevelObjectiveId', - type: { - name: 'String' - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb deleted file mode 100755 index 68a6d1f742..0000000000 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb +++ /dev/null @@ -1,131 +0,0 @@ -# encoding: utf-8 -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. - -module Azure::ARM::SQL - module Models - # - # Represents the properties of a recommended elastic pool being upgraded. - # - class UpgradeRecommendedElasticPoolProperties - - include MsRestAzure - - # @return [String] The name of the recommended elastic pool being - # upgraded. - attr_accessor :name - - # @return [TargetElasticPoolEditions] The target edition for the - # recommended elastic pool being upgraded. Possible values include: - # 'Basic', 'Standard', 'Premium' - attr_accessor :edition - - # @return [Integer] The DTU guarantee for the recommended elastic pool - # being upgraded. - attr_accessor :dtu - - # @return [Integer] The storage limit in MB for the recommended elastic - # pool being upgraded. - attr_accessor :storage_mb - - # @return [Integer] The DTU guarantee for database for the recommended - # elastic pool being upgraded. - attr_accessor :database_dtu_min - - # @return [Integer] The DTU cap for database for the recommended elastic - # pool being upgraded. - attr_accessor :database_dtu_max - - # @return [Array] The list of database names to be put in the - # recommended elastic pool being upgraded. - attr_accessor :database_collection - - # @return [Boolean] Gets or sets whether all databases to be put in the - # recommended elastic pool being upgraded. - attr_accessor :include_all_databases - - - # - # Mapper for UpgradeRecommendedElasticPoolProperties class as Ruby Hash. - # This will be used for serialization/deserialization. - # - def self.mapper() - { - required: false, - serialized_name: 'UpgradeRecommendedElasticPoolProperties', - type: { - name: 'Composite', - class_name: 'UpgradeRecommendedElasticPoolProperties', - model_properties: { - name: { - required: true, - serialized_name: 'Name', - type: { - name: 'String' - } - }, - edition: { - required: true, - serialized_name: 'Edition', - type: { - name: 'Enum', - module: 'TargetElasticPoolEditions' - } - }, - dtu: { - required: false, - serialized_name: 'Dtu', - type: { - name: 'Number' - } - }, - storage_mb: { - required: false, - serialized_name: 'StorageMb', - type: { - name: 'Number' - } - }, - database_dtu_min: { - required: false, - serialized_name: 'DatabaseDtuMin', - type: { - name: 'Number' - } - }, - database_dtu_max: { - required: false, - serialized_name: 'DatabaseDtuMax', - type: { - name: 'Number' - } - }, - database_collection: { - required: false, - serialized_name: 'DatabaseCollection', - type: { - name: 'Sequence', - element: { - required: false, - serialized_name: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - include_all_databases: { - required: false, - serialized_name: 'IncludeAllDatabases', - type: { - name: 'Boolean' - } - } - } - } - } - end - end - end -end diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb index 2a849be0dc..c2c8c113bd 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb @@ -11,7 +11,6 @@ module Azure::ARM::SQL # databases. # class RecommendedElasticPools - include Azure::ARM::SQL::Models include MsRestAzure # @@ -89,7 +88,7 @@ def get_async(resource_group_name, server_name, recommended_elastic_pool_name, c # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}' request_url = @base_url || @client.base_url @@ -116,7 +115,7 @@ def get_async(resource_group_name, server_name, recommended_elastic_pool_name, c if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = RecommendedElasticPool.mapper() + result_mapper = Azure::ARM::SQL::Models::RecommendedElasticPool.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -197,7 +196,7 @@ def get_databases_async(resource_group_name, server_name, recommended_elastic_po # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}' request_url = @base_url || @client.base_url @@ -224,7 +223,7 @@ def get_databases_async(resource_group_name, server_name, recommended_elastic_po if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Database.mapper() + result_mapper = Azure::ARM::SQL::Models::Database.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -249,8 +248,8 @@ def get_databases_async(resource_group_name, server_name, recommended_elastic_po # # @return [RecommendedElasticPoolListResult] operation results. # - def list(resource_group_name, server_name, custom_headers = nil) - response = list_async(resource_group_name, server_name, custom_headers).value! + def list_by_server(resource_group_name, server_name, custom_headers = nil) + response = list_by_server_async(resource_group_name, server_name, custom_headers).value! response.body unless response.nil? end @@ -266,8 +265,8 @@ def list(resource_group_name, server_name, custom_headers = nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_with_http_info(resource_group_name, server_name, custom_headers = nil) - list_async(resource_group_name, server_name, custom_headers).value! + def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil) + list_by_server_async(resource_group_name, server_name, custom_headers).value! end # @@ -282,7 +281,7 @@ def list_with_http_info(resource_group_name, server_name, custom_headers = nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_async(resource_group_name, server_name, custom_headers = nil) + def list_by_server_async(resource_group_name, server_name, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @@ -294,7 +293,7 @@ def list_async(resource_group_name, server_name, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools' request_url = @base_url || @client.base_url @@ -321,7 +320,7 @@ def list_async(resource_group_name, server_name, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = RecommendedElasticPoolListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::RecommendedElasticPoolListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -398,7 +397,7 @@ def list_databases_async(resource_group_name, server_name, recommended_elastic_p # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases' request_url = @base_url || @client.base_url @@ -425,7 +424,7 @@ def list_databases_async(resource_group_name, server_name, recommended_elastic_p if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = DatabaseListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -502,7 +501,7 @@ def list_metrics_async(resource_group_name, server_name, recommended_elastic_poo # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/metrics' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/metrics' request_url = @base_url || @client.base_url @@ -529,7 +528,7 @@ def list_metrics_async(resource_group_name, server_name, recommended_elastic_poo if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = RecommendedElasticPoolListMetricsResult.mapper() + result_mapper = Azure::ARM::SQL::Models::RecommendedElasticPoolListMetricsResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/servers.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/servers.rb index 7f1cabd290..bdbc5657ca 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/servers.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/servers.rb @@ -11,7 +11,6 @@ module Azure::ARM::SQL # databases. # class Servers - include Azure::ARM::SQL::Models include MsRestAzure # @@ -25,471 +24,6 @@ def initialize(client) # @return [SqlManagementClient] reference to the SqlManagementClient attr_reader :client - # - # Creates or updates a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param parameters [ServerFirewallRule] The required parameters for creating - # or updating a firewall rule. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ServerFirewallRule] operation results. - # - def create_or_update_firewall_rule(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers = nil) - response = create_or_update_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers).value! - response.body unless response.nil? - end - - # - # Creates or updates a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param parameters [ServerFirewallRule] The required parameters for creating - # or updating a firewall rule. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def create_or_update_firewall_rule_with_http_info(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers = nil) - create_or_update_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers).value! - end - - # - # Creates or updates a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param parameters [ServerFirewallRule] The required parameters for creating - # or updating a firewall rule. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def create_or_update_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, parameters, custom_headers = nil) - api_version = '2014-04-01' - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? - fail ArgumentError, 'parameters is nil' if parameters.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - - request_headers['Content-Type'] = 'application/json; charset=utf-8' - - # Serialize Request - request_mapper = ServerFirewallRule.mapper() - request_content = @client.serialize(request_mapper, parameters, 'parameters') - request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'firewallRuleName' => firewall_rule_name}, - query_params: {'api-version' => api_version}, - body: request_content, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:put, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 || status_code == 201 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerFirewallRule.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - # Deserialize Response - if status_code == 201 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerFirewallRule.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Deletes a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # - def delete_firewall_rule(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) - response = delete_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! - nil - end - - # - # Deletes a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def delete_firewall_rule_with_http_info(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) - delete_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! - end - - # - # Deletes a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def delete_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) - api_version = '2014-04-01' - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'firewallRuleName' => firewall_rule_name}, - query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:delete, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 || status_code == 204 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - - result - end - - promise.execute - end - - # - # Gets a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ServerFirewallRule] operation results. - # - def get_firewall_rule(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) - response = get_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! - response.body unless response.nil? - end - - # - # Gets a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def get_firewall_rule_with_http_info(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) - get_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, custom_headers).value! - end - - # - # Gets a firewall rule. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param firewall_rule_name [String] The name of the firewall rule. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def get_firewall_rule_async(resource_group_name, server_name, firewall_rule_name, custom_headers = nil) - api_version = '2014-04-01' - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'firewall_rule_name is nil' if firewall_rule_name.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'firewallRuleName' => firewall_rule_name}, - query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerFirewallRule.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Returns a list of firewall rules. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ServerFirewallRuleListResult] operation results. - # - def list_firewall_rules(resource_group_name, server_name, custom_headers = nil) - response = list_firewall_rules_async(resource_group_name, server_name, custom_headers).value! - response.body unless response.nil? - end - - # - # Returns a list of firewall rules. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def list_firewall_rules_with_http_info(resource_group_name, server_name, custom_headers = nil) - list_firewall_rules_async(resource_group_name, server_name, custom_headers).value! - end - - # - # Returns a list of firewall rules. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def list_firewall_rules_async(resource_group_name, server_name, custom_headers = nil) - api_version = '2014-04-01' - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, - query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerFirewallRuleListResult.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Imports a bacpac into a new database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param parameters [ImportRequestParameters] The required parameters for - # importing a Bacpac into a database. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ImportExportOperationResponse] operation results. - # - def import_database(resource_group_name, server_name, parameters, custom_headers = nil) - response = import_database_async(resource_group_name, server_name, parameters, custom_headers).value! - response.body unless response.nil? - end - - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param parameters [ImportRequestParameters] The required parameters for - # importing a Bacpac into a database. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [Concurrent::Promise] promise which provides async access to http - # response. - # - def import_database_async(resource_group_name, server_name, parameters, custom_headers = nil) - # Send request - promise = begin_import_database_async(resource_group_name, server_name, parameters, custom_headers) - - promise = promise.then do |response| - # Defining deserialization method. - deserialize_method = lambda do |parsed_response| - result_mapper = ImportExportOperationResponse.mapper() - parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response') - end - - # Waiting for response. - @client.get_long_running_operation_result(response, deserialize_method) - end - - promise - end - # # Returns a list of servers. # @@ -533,7 +67,7 @@ def list_async(custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers' + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers' request_url = @base_url || @client.base_url @@ -560,7 +94,7 @@ def list_async(custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -641,11 +175,11 @@ def create_or_update_async(resource_group_name, server_name, parameters, custom_ request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request - request_mapper = Server.mapper() + request_mapper = Azure::ARM::SQL::Models::Server.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}' request_url = @base_url || @client.base_url @@ -673,7 +207,7 @@ def create_or_update_async(resource_group_name, server_name, parameters, custom_ if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Server.mapper() + result_mapper = Azure::ARM::SQL::Models::Server.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -683,7 +217,7 @@ def create_or_update_async(resource_group_name, server_name, parameters, custom_ if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Server.mapper() + result_mapper = Azure::ARM::SQL::Models::Server.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -752,7 +286,7 @@ def delete_async(resource_group_name, server_name, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}' request_url = @base_url || @client.base_url @@ -794,8 +328,8 @@ def delete_async(resource_group_name, server_name, custom_headers = nil) # # @return [Server] operation results. # - def get_by_resource_group(resource_group_name, server_name, custom_headers = nil) - response = get_by_resource_group_async(resource_group_name, server_name, custom_headers).value! + def get(resource_group_name, server_name, custom_headers = nil) + response = get_async(resource_group_name, server_name, custom_headers).value! response.body unless response.nil? end @@ -811,8 +345,8 @@ def get_by_resource_group(resource_group_name, server_name, custom_headers = nil # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def get_by_resource_group_with_http_info(resource_group_name, server_name, custom_headers = nil) - get_by_resource_group_async(resource_group_name, server_name, custom_headers).value! + def get_with_http_info(resource_group_name, server_name, custom_headers = nil) + get_async(resource_group_name, server_name, custom_headers).value! end # @@ -827,7 +361,7 @@ def get_by_resource_group_with_http_info(resource_group_name, server_name, custo # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def get_by_resource_group_async(resource_group_name, server_name, custom_headers = nil) + def get_async(resource_group_name, server_name, custom_headers = nil) api_version = '2014-04-01' fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @@ -839,7 +373,7 @@ def get_by_resource_group_async(resource_group_name, server_name, custom_headers # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}' request_url = @base_url || @client.base_url @@ -866,7 +400,7 @@ def get_by_resource_group_async(resource_group_name, server_name, custom_headers if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Server.mapper() + result_mapper = Azure::ARM::SQL::Models::Server.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -932,7 +466,7 @@ def list_by_resource_group_async(resource_group_name, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers' request_url = @base_url || @client.base_url @@ -959,7 +493,7 @@ def list_by_resource_group_async(resource_group_name, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1029,7 +563,7 @@ def list_usages_async(resource_group_name, server_name, custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages' request_url = @base_url || @client.base_url @@ -1056,7 +590,7 @@ def list_usages_async(resource_group_name, server_name, custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServerMetricListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::ServerMetricListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1133,7 +667,7 @@ def get_service_objective_async(resource_group_name, server_name, service_object # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}' request_url = @base_url || @client.base_url @@ -1160,7 +694,7 @@ def get_service_objective_async(resource_group_name, server_name, service_object if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServiceObjective.mapper() + result_mapper = Azure::ARM::SQL::Models::ServiceObjective.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1230,7 +764,7 @@ def list_service_objectives_async(resource_group_name, server_name, custom_heade # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives' + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives' request_url = @base_url || @client.base_url @@ -1257,120 +791,7 @@ def list_service_objectives_async(resource_group_name, server_name, custom_heade if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ServiceObjectiveListResult.mapper() - result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Imports a bacpac into a new database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param parameters [ImportRequestParameters] The required parameters for - # importing a Bacpac into a database. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ImportExportOperationResponse] operation results. - # - def begin_import_database(resource_group_name, server_name, parameters, custom_headers = nil) - response = begin_import_database_async(resource_group_name, server_name, parameters, custom_headers).value! - response.body unless response.nil? - end - - # - # Imports a bacpac into a new database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param parameters [ImportRequestParameters] The required parameters for - # importing a Bacpac into a database. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def begin_import_database_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil) - begin_import_database_async(resource_group_name, server_name, parameters, custom_headers).value! - end - - # - # Imports a bacpac into a new database. - # - # @param resource_group_name [String] 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 server_name [String] The name of the server. - # @param parameters [ImportRequestParameters] The required parameters for - # importing a Bacpac into a database. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def begin_import_database_async(resource_group_name, server_name, parameters, custom_headers = nil) - api_version = '2014-04-01' - fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? - fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? - fail ArgumentError, 'server_name is nil' if server_name.nil? - fail ArgumentError, 'parameters is nil' if parameters.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - - request_headers['Content-Type'] = 'application/json; charset=utf-8' - - # Serialize Request - request_mapper = ImportRequestParameters.mapper() - request_content = @client.serialize(request_mapper, parameters, 'parameters') - request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - - path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name}, - query_params: {'api-version' => api_version}, - body: request_content, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:post, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 201 || status_code == 202 - error_model = JSON.load(response_content) - fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 201 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = ImportExportOperationResponse.mapper() + result_mapper = Azure::ARM::SQL::Models::ServiceObjectiveListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/sql_management_client.rb b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/sql_management_client.rb index 9e3c066b91..3360c0daed 100755 --- a/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/sql_management_client.rb +++ b/management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/sql_management_client.rb @@ -21,6 +21,9 @@ class SqlManagementClient < MsRestAzure::AzureServiceClient # subscription. attr_accessor :subscription_id + # @return [FailoverGroupResource] The failover group. + attr_accessor :failover_group + # @return [String] Gets or sets the preferred language for the response. attr_accessor :accept_language @@ -35,14 +38,14 @@ class SqlManagementClient < MsRestAzure::AzureServiceClient # @return [Capabilities] capabilities attr_reader :capabilities - # @return [Servers] servers - attr_reader :servers + # @return [FirewallRules] firewall_rules + attr_reader :firewall_rules # @return [Databases] databases attr_reader :databases - # @return [ImportExportOperations] import_export_operations - attr_reader :import_export_operations + # @return [Servers] servers + attr_reader :servers # @return [ElasticPools] elastic_pools attr_reader :elastic_pools @@ -50,12 +53,8 @@ class SqlManagementClient < MsRestAzure::AzureServiceClient # @return [RecommendedElasticPools] recommended_elastic_pools attr_reader :recommended_elastic_pools - # @return [DatabaseThreatDetectionPolicies] - # database_threat_detection_policies - attr_reader :database_threat_detection_policies - - # @return [DatabaseBlobAuditingPolicies] database_blob_auditing_policies - attr_reader :database_blob_auditing_policies + # @return [FailoverGroups] failover_groups + attr_reader :failover_groups # # Creates initializes a new instance of the SqlManagementClient class. @@ -71,13 +70,12 @@ def initialize(credentials = nil, base_url = nil, options = nil) @credentials = credentials @capabilities = Capabilities.new(self) - @servers = Servers.new(self) + @firewall_rules = FirewallRules.new(self) @databases = Databases.new(self) - @import_export_operations = ImportExportOperations.new(self) + @servers = Servers.new(self) @elastic_pools = ElasticPools.new(self) @recommended_elastic_pools = RecommendedElasticPools.new(self) - @database_threat_detection_policies = DatabaseThreatDetectionPolicies.new(self) - @database_blob_auditing_policies = DatabaseBlobAuditingPolicies.new(self) + @failover_groups = FailoverGroups.new(self) @accept_language = 'en-US' @long_running_operation_retry_timeout = 30 @generate_client_request_id = true @@ -181,7 +179,7 @@ def list_operations_async(custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? - path_template = '/providers/Microsoft.Sql/operations' + path_template = 'providers/Microsoft.Sql/operations' request_url = @base_url || self.base_url @@ -207,7 +205,7 @@ def list_operations_async(custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = OperationListResult.mapper() + result_mapper = Azure::ARM::SQL::Models::OperationListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)