Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 46 additions & 33 deletions management/azure_mgmt_sql/lib/generated/azure_mgmt_sql.rb
100755 → 100644

Large diffs are not rendered by default.

Empty file.
411 changes: 310 additions & 101 deletions management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/databases.rb
100755 → 100644

Large diffs are not rendered by default.

209 changes: 209 additions & 0 deletions management/azure_mgmt_sql/lib/generated/azure_mgmt_sql/elastic_pools.rb
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,215 @@ def initialize(client)
# @return [SqlManagementClient] reference to the SqlManagementClient
attr_reader :client

#
# Returns elastic pool metrics.
#
# @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 elastic_pool_name [String] The name of the elastic pool.
# @param filter [String] An OData filter expression that describes a subset of
# metrics to return.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MetricListResult] operation results.
#
def list_metrics(resource_group_name, server_name, elastic_pool_name, filter, custom_headers = nil)
response = list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers).value!
response.body unless response.nil?
end

#
# Returns elastic pool metrics.
#
# @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 elastic_pool_name [String] The name of the elastic pool.
# @param filter [String] An OData filter expression that describes a subset of
# metrics to return.
# @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_metrics_with_http_info(resource_group_name, server_name, elastic_pool_name, filter, custom_headers = nil)
list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers).value!
end

#
# Returns elastic pool metrics.
#
# @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 elastic_pool_name [String] The name of the elastic pool.
# @param filter [String] An OData filter expression that describes a subset of
# metrics to return.
# @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_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, 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, 'elastic_pool_name is nil' if elastic_pool_name.nil?
fail ArgumentError, 'filter is nil' if filter.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}/elasticPools/{elasticPoolName}/metrics'

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,'elasticPoolName' => elastic_pool_name},
query_params: {'api-version' => api_version,'$filter' => filter},
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::MetricListResult.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 elastic pool metric definitions.
#
# @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 elastic_pool_name [String] The name of the elastic pool.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MetricDefinitionListResult] operation results.
#
def list_metric_definitions(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
response = list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
response.body unless response.nil?
end

#
# Returns elastic pool metric definitions.
#
# @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 elastic_pool_name [String] The name of the elastic pool.
# @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_metric_definitions_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
end

#
# Returns elastic pool metric definitions.
#
# @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 elastic_pool_name [String] The name of the elastic pool.
# @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_metric_definitions_async(resource_group_name, server_name, elastic_pool_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, 'elastic_pool_name is nil' if elastic_pool_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}/elasticPools/{elasticPoolName}/metricDefinitions'

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,'elasticPoolName' => elastic_pool_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::MetricDefinitionListResult.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 a new elastic pool or updates an existing elastic pool.
#
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -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 CheckNameAvailabilityReason
#
module CheckNameAvailabilityReason
Invalid = "Invalid"
AlreadyExists = "AlreadyExists"
end
end
end
Original file line number Diff line number Diff line change
@@ -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
#
# A request to check whether the specified name for a resource is
# available.
#
class CheckNameAvailabilityRequest

include MsRestAzure

# @return [String] The name whose availability is to be checked.
attr_accessor :name

# @return [String] The type of resource that is used as the scope of the
# availability check. Default value: 'Microsoft.Sql/servers' .
attr_accessor :type


#
# Mapper for CheckNameAvailabilityRequest class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CheckNameAvailabilityRequest',
type: {
name: 'Composite',
class_name: 'CheckNameAvailabilityRequest',
model_properties: {
name: {
required: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: true,
is_constant: true,
serialized_name: 'type',
default_value: 'Microsoft.Sql/servers',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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
#
# A response indicating whether the specified name for a resource is
# available.
#
class CheckNameAvailabilityResponse

include MsRestAzure

# @return [Boolean] True if the name is available, otherwise false.
attr_accessor :available

# @return [String] A message explaining why the name is unavailable. Will
# be null if the name is available.
attr_accessor :message

# @return [String] The name whose availability was checked.
attr_accessor :name

# @return [CheckNameAvailabilityReason] The reason code explaining why
# the name is unavailable. Will be null if the name is available.
# Possible values include: 'Invalid', 'AlreadyExists'
attr_accessor :reason


#
# Mapper for CheckNameAvailabilityResponse class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CheckNameAvailabilityResponse',
type: {
name: 'Composite',
class_name: 'CheckNameAvailabilityResponse',
model_properties: {
available: {
required: false,
read_only: true,
serialized_name: 'available',
type: {
name: 'Boolean'
}
},
message: {
required: false,
read_only: true,
serialized_name: 'message',
type: {
name: 'String'
}
},
name: {
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
reason: {
required: false,
read_only: true,
serialized_name: 'reason',
type: {
name: 'Enum',
module: 'CheckNameAvailabilityReason'
}
}
}
}
}
end
end
end
end
Empty file.
Empty file.
Empty file.
Empty file.
Loading