class Azure::ADHybridHealthService::Mgmt::V2014_01_01::AddsServices

REST APIs for Azure Active Directory Connect Health

Attributes

client[R]

@return [ADHybridHealthService] reference to the ADHybridHealthService

Private Class Methods

new(client) click to toggle source

Creates and initializes a new instance of the AddsServices class. @param client service class for accessing basic functionality.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 17
def initialize(client)
  @client = client
end

Private Instance Methods

add(service, custom_headers:nil) click to toggle source

Onboards a service for a given tenant in Azure Active Directory Connect Health.

@param service [ServiceProperties] The service object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ServiceProperties] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 151
def add(service, custom_headers:nil)
  response = add_async(service, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_async(service, custom_headers:nil) click to toggle source

Onboards a service for a given tenant in Azure Active Directory Connect Health.

@param service [ServiceProperties] The service object. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 180
def add_async(service, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'service is nil' if service.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
  request_content = @client.serialize(request_mapper,  service)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.ADHybridHealthService/addsservices'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => @client.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 == 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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
add_with_http_info(service, custom_headers:nil) click to toggle source

Onboards a service for a given tenant in Azure Active Directory Connect Health.

@param service [ServiceProperties] The service object. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 166
def add_with_http_info(service, custom_headers:nil)
  add_async(service, custom_headers:custom_headers).value!
end
delete(service_name, confirm:nil, custom_headers:nil) click to toggle source

Deletes an Active Directory Domain Service which is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service which needs to be deleted. @param confirm [Boolean] Indicates if the service will be permanently deleted or disabled. True indicates that the service will be permanently deleted and False indicates that the service will be marked disabled and then deleted after 30 days, if it is not re-registered. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 348
def delete(service_name, confirm:nil, custom_headers:nil)
  response = delete_async(service_name, confirm:confirm, custom_headers:custom_headers).value!
  nil
end
delete_async(service_name, confirm:nil, custom_headers:nil) click to toggle source

Deletes an Active Directory Domain Service which is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service which needs to be deleted. @param confirm [Boolean] Indicates if the service will be permanently deleted or disabled. True indicates that the service will be permanently deleted and False indicates that the service will be marked disabled and then deleted after 30 days, if it is not re-registered. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 387
def delete_async(service_name, confirm:nil, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'confirm' => confirm,'api-version' => @client.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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end
delete_with_http_info(service_name, confirm:nil, custom_headers:nil) click to toggle source

Deletes an Active Directory Domain Service which is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service which needs to be deleted. @param confirm [Boolean] Indicates if the service will be permanently deleted or disabled. True indicates that the service will be permanently deleted and False indicates that the service will be marked disabled and then deleted after 30 days, if it is not re-registered. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 368
def delete_with_http_info(service_name, confirm:nil, custom_headers:nil)
  delete_async(service_name, confirm:confirm, custom_headers:custom_headers).value!
end
get(service_name, custom_headers:nil) click to toggle source

Gets the details of an Active Directory Domain Service for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ServiceProperties] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 250
def get(service_name, custom_headers:nil)
  response = get_async(service_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_async(service_name, custom_headers:nil) click to toggle source

Gets the details of an Active Directory Domain Service for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 281
def get_async(service_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
get_forest_summary(service_name, custom_headers:nil) click to toggle source

Gets the forest summary for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ForestSummary] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 546
def get_forest_summary(service_name, custom_headers:nil)
  response = get_forest_summary_async(service_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_forest_summary_async(service_name, custom_headers:nil) click to toggle source

Gets the forest summary for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 575
def get_forest_summary_async(service_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/forestsummary'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::ForestSummary.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
get_forest_summary_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets the forest summary for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 561
def get_forest_summary_with_http_info(service_name, custom_headers:nil)
  get_forest_summary_async(service_name, custom_headers:custom_headers).value!
end
get_metric_metadata(service_name, metric_name, custom_headers:nil) click to toggle source

Gets the service related metric information.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MetricMetadata] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 933
def get_metric_metadata(service_name, metric_name, custom_headers:nil)
  response = get_metric_metadata_async(service_name, metric_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_metric_metadata_async(service_name, metric_name, custom_headers:nil) click to toggle source

Gets the service related metric information.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 962
def get_metric_metadata_async(service_name, metric_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'metric_name is nil' if metric_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata/{metricName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'metricName' => metric_name},
      query_params: {'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadata.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
get_metric_metadata_for_group(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil) click to toggle source

Gets the service related metrics for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param group_key [String] The group key @param from_date [DateTime] The start date. @param to_date [DateTime] The end date. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MetricSets] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1030
def get_metric_metadata_for_group(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
  response = get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:group_key, from_date:from_date, to_date:to_date, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil) click to toggle source

Gets the service related metrics for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param group_key [String] The group key @param from_date [DateTime] The start date. @param to_date [DateTime] The end date. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1067
def get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'metric_name is nil' if metric_name.nil?
  fail ArgumentError, 'group_name is nil' if group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata/{metricName}/groups/{groupName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
      query_params: {'groupKey' => group_key,'fromDate' => from_date,'toDate' => to_date,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricSets.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
get_metric_metadata_for_group_with_http_info(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil) click to toggle source

Gets the service related metrics for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param group_key [String] The group key @param from_date [DateTime] The start date. @param to_date [DateTime] The end date. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1049
def get_metric_metadata_for_group_with_http_info(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
  get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:group_key, from_date:from_date, to_date:to_date, custom_headers:custom_headers).value!
end
get_metric_metadata_with_http_info(service_name, metric_name, custom_headers:nil) click to toggle source

Gets the service related metric information.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 948
def get_metric_metadata_with_http_info(service_name, metric_name, custom_headers:nil)
  get_metric_metadata_async(service_name, metric_name, custom_headers:custom_headers).value!
end
get_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets the details of an Active Directory Domain Service for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 266
def get_with_http_info(service_name, custom_headers:nil)
  get_async(service_name, custom_headers:custom_headers).value!
end
list(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ServiceProperties>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 43
def list(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  first_page = list_as_lazy(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers)
  first_page.get_all_items
end
list_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Services] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2148
def list_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  response = list_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 90
def list_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'$filter' => filter,'serviceType' => service_type,'skipCount' => skip_count,'takeCount' => take_count,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metric_metadata(service_name, filter:nil, perf_counter:nil, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param service_name [String] The name of the service. @param filter [String] The metric metadata property filter to apply. @param perf_counter [Boolean] Indicates if only performance counter metrics are requested. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<MetricMetadata>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 837
def list_metric_metadata(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  first_page = list_metric_metadata_as_lazy(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers)
  first_page.get_all_items
end
list_metric_metadata_as_lazy(service_name, filter:nil, perf_counter:nil, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param service_name [String] The name of the service. @param filter [String] The metric metadata property filter to apply. @param perf_counter [Boolean] Indicates if only performance counter metrics are requested. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MetricMetadataList] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2217
def list_metric_metadata_as_lazy(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  response = list_metric_metadata_async(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_metric_metadata_async(service_name, filter:nil, perf_counter:nil, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param service_name [String] The name of the service. @param filter [String] The metric metadata property filter to apply. @param perf_counter [Boolean] Indicates if only performance counter metrics are requested. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 870
def list_metric_metadata_async(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'$filter' => filter,'perfCounter' => perf_counter,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadataList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metric_metadata_next(next_page_link, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MetricMetadataList] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1860
def list_metric_metadata_next(next_page_link, custom_headers:nil)
  response = list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_metric_metadata_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1889
def list_metric_metadata_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadataList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metric_metadata_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1875
def list_metric_metadata_next_with_http_info(next_page_link, custom_headers:nil)
  list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_metric_metadata_with_http_info(service_name, filter:nil, perf_counter:nil, custom_headers:nil) click to toggle source

Gets the service related metrics information.

@param service_name [String] The name of the service. @param filter [String] The metric metadata property filter to apply. @param perf_counter [Boolean] Indicates if only performance counter metrics are requested. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 854
def list_metric_metadata_with_http_info(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  list_metric_metadata_async(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers).value!
end
list_metrics_average(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Item>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 640
def list_metrics_average(service_name, metric_name, group_name, custom_headers:nil)
  first_page = list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Metrics] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2171
def list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:nil)
  response = list_metrics_average_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_metrics_average_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_metrics_average_async(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 673
def list_metrics_average_async(service_name, metric_name, group_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'metric_name is nil' if metric_name.nil?
  fail ArgumentError, 'group_name is nil' if group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}/average'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
      query_params: {'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metrics_average_next(next_page_link, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Metrics] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1678
def list_metrics_average_next(next_page_link, custom_headers:nil)
  response = list_metrics_average_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_metrics_average_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1709
def list_metrics_average_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metrics_average_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1694
def list_metrics_average_next_with_http_info(next_page_link, custom_headers:nil)
  list_metrics_average_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_metrics_average_with_http_info(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the average of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 657
def list_metrics_average_with_http_info(service_name, metric_name, group_name, custom_headers:nil)
  list_metrics_average_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
end
list_metrics_sum(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Item>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 739
def list_metrics_sum(service_name, metric_name, group_name, custom_headers:nil)
  first_page = list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Metrics] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2193
def list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:nil)
  response = list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 770
def list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'metric_name is nil' if metric_name.nil?
  fail ArgumentError, 'group_name is nil' if group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}/sum'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
      query_params: {'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metrics_sum_next(next_page_link, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Metrics] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1770
def list_metrics_sum_next(next_page_link, custom_headers:nil)
  response = list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_metrics_sum_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1799
def list_metrics_sum_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_metrics_sum_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1785
def list_metrics_sum_next_with_http_info(next_page_link, custom_headers:nil)
  list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_metrics_sum_with_http_info(service_name, metric_name, group_name, custom_headers:nil) click to toggle source

Gets the sum of the metric values for a given metric and group combination.

@param service_name [String] The name of the service. @param metric_name [String] The metric name @param group_name [String] The group name @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 755
def list_metrics_sum_with_http_info(service_name, metric_name, group_name, custom_headers:nil)
  list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
end
list_next(next_page_link, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Services] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1585
def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1616
def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1601
def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_premium_services(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ServiceProperties>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1474
def list_premium_services(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  first_page = list_premium_services_as_lazy(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers)
  first_page.get_all_items
end
list_premium_services_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Services] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2275
def list_premium_services_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  response = list_premium_services_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_premium_services_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_premium_services_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1523
def list_premium_services_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/premiumCheck'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'$filter' => filter,'serviceType' => service_type,'skipCount' => skip_count,'takeCount' => take_count,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_premium_services_next(next_page_link, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Services] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2045
def list_premium_services_next(next_page_link, custom_headers:nil)
  response = list_premium_services_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_premium_services_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2078
def list_premium_services_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_premium_services_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2062
def list_premium_services_next_with_http_info(next_page_link, custom_headers:nil)
  list_premium_services_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_premium_services_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Services for a tenant having Azure AD Premium license and is onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1499
def list_premium_services_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  list_premium_services_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
end
list_replication_details(service_name, filter:nil, with_details:nil, custom_headers:nil) click to toggle source

Gets complete domain controller list along with replication details for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param filter [String] The server property filter to apply. @param with_details [Boolean] Indicates if InboundReplicationNeighbor details are required or not. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ReplicationDetailsList] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1136
def list_replication_details(service_name, filter:nil, with_details:nil, custom_headers:nil)
  response = list_replication_details_async(service_name, filter:filter, with_details:with_details, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_replication_details_async(service_name, filter:nil, with_details:nil, custom_headers:nil) click to toggle source

Gets complete domain controller list along with replication details for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param filter [String] The server property filter to apply. @param with_details [Boolean] Indicates if InboundReplicationNeighbor details are required or not. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1173
def list_replication_details_async(service_name, filter:nil, with_details:nil, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationdetails'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'$filter' => filter,'withDetails' => with_details,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::ReplicationDetailsList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_replication_details_with_http_info(service_name, filter:nil, with_details:nil, custom_headers:nil) click to toggle source

Gets complete domain controller list along with replication details for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param filter [String] The server property filter to apply. @param with_details [Boolean] Indicates if InboundReplicationNeighbor details are required or not. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1155
def list_replication_details_with_http_info(service_name, filter:nil, with_details:nil, custom_headers:nil)
  list_replication_details_async(service_name, filter:filter, with_details:with_details, custom_headers:custom_headers).value!
end
list_replication_summary(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets complete domain controller list along with replication details for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param is_groupby_site [Boolean] Indicates if the result should be grouped by site or not. @param query [String] The custom query. @param filter [String] The server property filter to apply. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ReplicationSummaryList] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1243
def list_replication_summary(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil)
  response = list_replication_summary_async(service_name, is_groupby_site, query, filter:filter, take_count:take_count, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_replication_summary_async(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets complete domain controller list along with replication details for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param is_groupby_site [Boolean] Indicates if the result should be grouped by site or not. @param query [String] The custom query. @param filter [String] The server property filter to apply. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1286
def list_replication_summary_async(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'is_groupby_site is nil' if is_groupby_site.nil?
  fail ArgumentError, 'query is nil' if query.nil?
  next_partition_key = ''
  next_row_key = ''
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationsummary'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'$filter' => filter,'isGroupbySite' => is_groupby_site,'query' => query,'nextPartitionKey' => next_partition_key,'nextRowKey' => next_row_key,'takeCount' => take_count,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::ReplicationSummaryList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_replication_summary_with_http_info(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets complete domain controller list along with replication details for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.

@param service_name [String] The name of the service. @param is_groupby_site [Boolean] Indicates if the result should be grouped by site or not. @param query [String] The custom query. @param filter [String] The server property filter to apply. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1265
def list_replication_summary_with_http_info(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil)
  list_replication_summary_async(service_name, is_groupby_site, query, filter:filter, take_count:take_count, custom_headers:custom_headers).value!
end
list_server_alerts(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param service_member_id The server Id for which the alert details needs to be queried. @param service_name [String] The name of the service. @param filter [String] The alert property filter to apply. @param state [String] The alert state to query for. @param from [DateTime] The start date to query for. @param to [DateTime] The end date till when to query for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Alert>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1359
def list_server_alerts(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  first_page = list_server_alerts_as_lazy(service_member_id, service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers)
  first_page.get_all_items
end
list_server_alerts_as_lazy(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param service_member_id The server Id for which the alert details needs to be queried. @param service_name [String] The name of the service. @param filter [String] The alert property filter to apply. @param state [String] The alert state to query for. @param from [DateTime] The start date to query for. @param to [DateTime] The end date till when to query for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Alerts] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 2244
def list_server_alerts_as_lazy(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  response = list_server_alerts_async(service_member_id, service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_server_alerts_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_server_alerts_async(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param service_member_id The server Id for which the alert details needs to be queried. @param service_name [String] The name of the service. @param filter [String] The alert property filter to apply. @param state [String] The alert state to query for. @param from [DateTime] The start date to query for. @param to [DateTime] The end date till when to query for. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1400
def list_server_alerts_async(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  fail ArgumentError, 'service_member_id is nil' if service_member_id.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers/{serviceMemberId}/alerts'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceMemberId' => service_member_id,'serviceName' => service_name},
      query_params: {'$filter' => filter,'state' => state,'from' => from,'to' => to,'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Alerts.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_server_alerts_next(next_page_link, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Alerts] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1951
def list_server_alerts_next(next_page_link, custom_headers:nil)
  response = list_server_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_server_alerts_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1982
def list_server_alerts_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::Alerts.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
list_server_alerts_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param next_page_link [String] The NextLink from the previous successful call to List 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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1967
def list_server_alerts_next_with_http_info(next_page_link, custom_headers:nil)
  list_server_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_server_alerts_with_http_info(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the details of an alert for a given Active Directory Domain Controller service and server combination.

@param service_member_id The server Id for which the alert details needs to be queried. @param service_name [String] The name of the service. @param filter [String] The alert property filter to apply. @param state [String] The alert state to query for. @param from [DateTime] The start date to query for. @param to [DateTime] The end date till when to query for. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 1380
def list_server_alerts_with_http_info(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  list_server_alerts_async(service_member_id, service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
end
list_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory Connect Health.

@param filter [String] The service property filter to apply. @param service_type [String] The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. @param skip_count [Integer] The skip count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining elements. @param take_count [Integer] The take count , which specifies the number of elements that can be returned from a sequence. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 67
def list_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  list_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
end
update(service_name, service, custom_headers:nil) click to toggle source

Updates an Active Directory Domain Service properties of an onboarded service.

@param service_name [String] The name of the service which needs to be deleted. @param service [ServiceProperties] The service object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ServiceProperties] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 442
def update(service_name, service, custom_headers:nil)
  response = update_async(service_name, service, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_async(service_name, service, custom_headers:nil) click to toggle source

Updates an Active Directory Domain Service properties of an onboarded service.

@param service_name [String] The name of the service which needs to be deleted. @param service [ServiceProperties] The service object. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 475
def update_async(service_name, service, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'service is nil' if service.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
  request_content = @client.serialize(request_mapper,  service)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name},
      query_params: {'api-version' => @client.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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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
update_with_http_info(service_name, service, custom_headers:nil) click to toggle source

Updates an Active Directory Domain Service properties of an onboarded service.

@param service_name [String] The name of the service which needs to be deleted. @param service [ServiceProperties] The service object. @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.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb, line 459
def update_with_http_info(service_name, service, custom_headers:nil)
  update_async(service_name, service, custom_headers:custom_headers).value!
end