class Azure::ADHybridHealthService::Mgmt::V2014_01_01::ServicesOperations

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 ServicesOperations class. @param client service class for accessing basic functionality.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.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/services_operations.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_alert_feedback(service_name, alert_feedback, custom_headers:nil) click to toggle source

Adds an alert feedback submitted by customer.

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

@return [AlertFeedback] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 1122
def add_alert_feedback(service_name, alert_feedback, custom_headers:nil)
  response = add_alert_feedback_async(service_name, alert_feedback, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_alert_feedback_async(service_name, alert_feedback, custom_headers:nil) click to toggle source

Adds an alert feedback submitted by customer.

@param service_name [String] The name of the service. @param alert_feedback [AlertFeedback] The alert feedback. @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/services_operations.rb, line 1151
def add_alert_feedback_async(service_name, alert_feedback, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'alert_feedback is nil' if alert_feedback.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::AlertFeedback.mapper()
  request_content = @client.serialize(request_mapper,  alert_feedback)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/feedback'

  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(: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::AlertFeedback.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_alert_feedback_with_http_info(service_name, alert_feedback, custom_headers:nil) click to toggle source

Adds an alert feedback submitted by customer.

@param service_name [String] The name of the service. @param alert_feedback [AlertFeedback] The alert feedback. @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/services_operations.rb, line 1137
def add_alert_feedback_with_http_info(service_name, alert_feedback, custom_headers:nil)
  add_alert_feedback_async(service_name, alert_feedback, custom_headers:custom_headers).value!
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/services_operations.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/services'

  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/services_operations.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 a 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/services_operations.rb, line 462
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 a 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/services_operations.rb, line 501
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/services/{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 a 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/services_operations.rb, line 482
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 a 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/services_operations.rb, line 366
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 a 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/services_operations.rb, line 395
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/services/{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_feature_availibility(service_name, feature_name, custom_headers:nil) click to toggle source

Checks if the service has all the pre-requisites met to use a feature.

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

@return [Result] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 758
def get_feature_availibility(service_name, feature_name, custom_headers:nil)
  response = get_feature_availibility_async(service_name, feature_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_feature_availibility_async(service_name, feature_name, custom_headers:nil) click to toggle source

Checks if the service has all the pre-requisites met to use a feature.

@param service_name [String] The name of the service. @param feature_name [String] The name of the feature. @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/services_operations.rb, line 787
def get_feature_availibility_async(service_name, feature_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'feature_name is nil' if feature_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/services/{serviceName}/checkServiceFeatureAvailibility/{featureName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'featureName' => feature_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::Result.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_feature_availibility_with_http_info(service_name, feature_name, custom_headers:nil) click to toggle source

Checks if the service has all the pre-requisites met to use a feature.

@param service_name [String] The name of the service. @param feature_name [String] The name of the feature. @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/services_operations.rb, line 773
def get_feature_availibility_with_http_info(service_name, feature_name, custom_headers:nil)
  get_feature_availibility_async(service_name, feature_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 metrics 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/services_operations.rb, line 1610
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 metrics 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/services_operations.rb, line 1639
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/services/{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/services_operations.rb, line 1707
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/services_operations.rb, line 1744
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/services/{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/services_operations.rb, line 1726
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 metrics 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/services_operations.rb, line 1625
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_tenant_whitelisting(service_name, feature_name, custom_headers:nil) click to toggle source

Checks if the tenant, to which a service is registered, is whitelisted to use a feature.

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

@return [Result] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 2083
def get_tenant_whitelisting(service_name, feature_name, custom_headers:nil)
  response = get_tenant_whitelisting_async(service_name, feature_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_tenant_whitelisting_async(service_name, feature_name, custom_headers:nil) click to toggle source

Checks if the tenant, to which a service is registered, is whitelisted to use a feature.

@param service_name [String] The name of the service. @param feature_name [String] The name of the feature. @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/services_operations.rb, line 2114
def get_tenant_whitelisting_async(service_name, feature_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'feature_name is nil' if feature_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/services/{serviceName}/TenantWhitelisting/{featureName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'featureName' => feature_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::Result.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_tenant_whitelisting_with_http_info(service_name, feature_name, custom_headers:nil) click to toggle source

Checks if the tenant, to which a service is registered, is whitelisted to use a feature.

@param service_name [String] The name of the service. @param feature_name [String] The name of the feature. @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/services_operations.rb, line 2099
def get_tenant_whitelisting_with_http_info(service_name, feature_name, custom_headers:nil)
  get_tenant_whitelisting_async(service_name, feature_name, custom_headers:custom_headers).value!
end
get_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets the details of a 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/services_operations.rb, line 381
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 services, 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/services_operations.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_alert_feedback(service_name, short_name, custom_headers:nil) click to toggle source

Gets a list of all alert feedback for a given tenant and alert type.

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

@return [AlertFeedbacks] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 1222
def list_alert_feedback(service_name, short_name, custom_headers:nil)
  response = list_alert_feedback_async(service_name, short_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_alert_feedback_async(service_name, short_name, custom_headers:nil) click to toggle source

Gets a list of all alert feedback for a given tenant and alert type.

@param service_name [String] The name of the service. @param short_name [String] The name of the alert. @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/services_operations.rb, line 1251
def list_alert_feedback_async(service_name, short_name, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'short_name is nil' if short_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/services/{serviceName}/feedbacktype/alerts/{shortName}/alertfeedback'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'serviceName' => service_name,'shortName' => short_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::AlertFeedbacks.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_alert_feedback_with_http_info(service_name, short_name, custom_headers:nil) click to toggle source

Gets a list of all alert feedback for a given tenant and alert type.

@param service_name [String] The name of the service. @param short_name [String] The name of the alert. @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/services_operations.rb, line 1237
def list_alert_feedback_with_http_info(service_name, short_name, custom_headers:nil)
  list_alert_feedback_async(service_name, short_name, custom_headers:custom_headers).value!
end
list_alerts(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 660
def list_alerts(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  first_page = list_alerts_as_lazy(service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers)
  first_page.get_all_items
end
list_alerts_as_lazy(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 3061
def list_alerts_as_lazy(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  response = list_alerts_async(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_alerts_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_alerts_async(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 695
def list_alerts_async(service_name, filter:nil, state:nil, from:nil, to: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/services/{serviceName}/alerts'

  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,'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_alerts_next(next_page_link, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 2545
def list_alerts_next(next_page_link, custom_headers:nil)
  response = list_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_alerts_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 2574
def list_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_alerts_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 2560
def list_alerts_next_with_http_info(next_page_link, custom_headers:nil)
  list_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_alerts_with_http_info(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil) click to toggle source

Gets the alerts for a given service.

@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/services_operations.rb, line 678
def list_alerts_with_http_info(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
  list_alerts_async(service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
end
list_all_risky_ip_download_report(service_name, custom_headers:nil) click to toggle source

Gets all Risky IP report URIs for the last 7 days.

@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 [RiskyIPBlobUris] operation results.

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

Gets all Risky IP report URIs for the last 7 days.

@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/services_operations.rb, line 2204
def list_all_risky_ip_download_report_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/services/{serviceName}/reports/riskyIp/blobUris'

  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::RiskyIPBlobUris.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_all_risky_ip_download_report_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets all Risky IP report URIs for the last 7 days.

@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/services_operations.rb, line 2191
def list_all_risky_ip_download_report_with_http_info(service_name, custom_headers:nil)
  list_all_risky_ip_download_report_async(service_name, custom_headers:custom_headers).value!
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 services, 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/services_operations.rb, line 3007
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 services, 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/services_operations.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/services'

  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_current_risky_ip_download_report(service_name, custom_headers:nil) click to toggle source

Initiate the generation of a new Risky IP report. Returns the URI for the new one.

@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 [RiskyIPBlobUris] operation results.

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

Initiate the generation of a new Risky IP report. Returns the URI for the new one.

@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/services_operations.rb, line 2296
def list_current_risky_ip_download_report_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/services/{serviceName}/reports/riskyIp/generateBlobUri'

  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(: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::RiskyIPBlobUris.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_current_risky_ip_download_report_with_http_info(service_name, custom_headers:nil) click to toggle source

Initiate the generation of a new Risky IP report. Returns the URI for the new one.

@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/services_operations.rb, line 2282
def list_current_risky_ip_download_report_with_http_info(service_name, custom_headers:nil)
  list_current_risky_ip_download_report_async(service_name, custom_headers:custom_headers).value!
end
list_export_errors(service_name, custom_headers:nil) click to toggle source

Gets the count of latest AAD export errors.

@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 [ErrorCounts] operation results.

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

Gets the count of latest AAD export errors.

@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/services_operations.rb, line 877
def list_export_errors_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/services/{serviceName}/exporterrors/counts'

  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::ErrorCounts.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_export_errors_v2(service_name, error_bucket, custom_headers:nil) click to toggle source

Gets the categorized export errors.

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

@return [MergedExportErrors] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 940
def list_export_errors_v2(service_name, error_bucket, custom_headers:nil)
  response = list_export_errors_v2_async(service_name, error_bucket, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_export_errors_v2_async(service_name, error_bucket, custom_headers:nil) click to toggle source

Gets the categorized export errors.

@param service_name [String] The name of the service. @param error_bucket [String] The error category 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/services_operations.rb, line 969
def list_export_errors_v2_async(service_name, error_bucket, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'error_bucket is nil' if error_bucket.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/services/{serviceName}/exporterrors/listV2'

  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: {'errorBucket' => error_bucket,'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::MergedExportErrors.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_export_errors_v2_with_http_info(service_name, error_bucket, custom_headers:nil) click to toggle source

Gets the categorized export errors.

@param service_name [String] The name of the service. @param error_bucket [String] The error category 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/services_operations.rb, line 955
def list_export_errors_v2_with_http_info(service_name, error_bucket, custom_headers:nil)
  list_export_errors_v2_async(service_name, error_bucket, custom_headers:custom_headers).value!
end
list_export_errors_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets the count of latest AAD export errors.

@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/services_operations.rb, line 864
def list_export_errors_with_http_info(service_name, custom_headers:nil)
  list_export_errors_async(service_name, custom_headers:custom_headers).value!
end
list_export_status(service_name, custom_headers:nil) click to toggle source

Gets the export status.

@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 [Array<ExportStatus>] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 1032
def list_export_status(service_name, custom_headers:nil)
  first_page = list_export_status_as_lazy(service_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_export_status_as_lazy(service_name, custom_headers:nil) click to toggle source

Gets the export status.

@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 [ExportStatuses] which provide lazy access to pages of the response.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 3081
def list_export_status_as_lazy(service_name, custom_headers:nil)
  response = list_export_status_async(service_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_export_status_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_export_status_async(service_name, custom_headers:nil) click to toggle source

Gets the export status.

@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/services_operations.rb, line 1059
def list_export_status_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/services/{serviceName}/exportstatus'

  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::ExportStatuses.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_export_status_next(next_page_link, custom_headers:nil) click to toggle source

Gets the export status.

@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 [ExportStatuses] operation results.

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

Gets the export status.

@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/services_operations.rb, line 2664
def list_export_status_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::ExportStatuses.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_export_status_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the export status.

@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/services_operations.rb, line 2650
def list_export_status_next_with_http_info(next_page_link, custom_headers:nil)
  list_export_status_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_export_status_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets the export status.

@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/services_operations.rb, line 1046
def list_export_status_with_http_info(service_name, custom_headers:nil)
  list_export_status_async(service_name, custom_headers:custom_headers).value!
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/services_operations.rb, line 1514
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/services_operations.rb, line 3150
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/services_operations.rb, line 1547
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/services/{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/services_operations.rb, line 2908
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/services_operations.rb, line 2937
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/services_operations.rb, line 2923
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/services_operations.rb, line 1531
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/services_operations.rb, line 1317
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/services_operations.rb, line 3104
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/services_operations.rb, line 1350
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/services/{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/services_operations.rb, line 2726
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/services_operations.rb, line 2757
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/services_operations.rb, line 2742
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/services_operations.rb, line 1334
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/services_operations.rb, line 1416
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/services_operations.rb, line 3126
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/services_operations.rb, line 1447
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/services/{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/services_operations.rb, line 2818
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/services_operations.rb, line 2847
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/services_operations.rb, line 2833
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/services_operations.rb, line 1432
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_monitoring_configurations(service_name, custom_headers:nil) click to toggle source

Gets the service level monitoring configurations.

@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 [Items] operation results.

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

Gets the service level monitoring configurations.

@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/services_operations.rb, line 1924
def list_monitoring_configurations_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/services/{serviceName}/monitoringconfigurations'

  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::Items.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_monitoring_configurations_with_http_info(service_name, custom_headers:nil) click to toggle source

Gets the service level monitoring configurations.

@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/services_operations.rb, line 1911
def list_monitoring_configurations_with_http_info(service_name, custom_headers:nil)
  list_monitoring_configurations_async(service_name, custom_headers:custom_headers).value!
end
list_next(next_page_link, custom_headers:nil) click to toggle source

Gets the details of services, 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/services_operations.rb, line 2360
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 services, 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/services_operations.rb, line 2391
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 services, 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/services_operations.rb, line 2376
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(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of 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/services_operations.rb, line 258
def list_premium(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  first_page = list_premium_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_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of 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/services_operations.rb, line 3037
def list_premium_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  response = list_premium_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_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_premium_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil) click to toggle source

Gets the details of 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/services_operations.rb, line 305
def list_premium_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/services/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_next(next_page_link, custom_headers:nil) click to toggle source

Gets the details of 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/services_operations.rb, line 2453
def list_premium_next(next_page_link, custom_headers:nil)
  response = list_premium_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_premium_next_async(next_page_link, custom_headers:nil) click to toggle source

Gets the details of 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/services_operations.rb, line 2484
def list_premium_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_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Gets the details of 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/services_operations.rb, line 2469
def list_premium_next_with_http_info(next_page_link, custom_headers:nil)
  list_premium_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_premium_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 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/services_operations.rb, line 282
def list_premium_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
  list_premium_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
end
list_user_bad_password_report(service_name, data_source:nil, custom_headers:nil) click to toggle source

Gets the bad password login attempt report for an user

@param service_name [String] The name of the service. @param data_source [String] The source of data, if its test data or customer data. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ErrorReportUsersEntries] operation results.

# File lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb, line 1988
def list_user_bad_password_report(service_name, data_source:nil, custom_headers:nil)
  response = list_user_bad_password_report_async(service_name, data_source:data_source, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_user_bad_password_report_async(service_name, data_source:nil, custom_headers:nil) click to toggle source

Gets the bad password login attempt report for an user

@param service_name [String] The name of the service. @param data_source [String] The source of data, if its test data or customer data. @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/services_operations.rb, line 2019
def list_user_bad_password_report_async(service_name, data_source: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/services/{serviceName}/reports/badpassword/details/user'

  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: {'dataSource' => data_source,'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::ErrorReportUsersEntries.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_user_bad_password_report_with_http_info(service_name, data_source:nil, custom_headers:nil) click to toggle source

Gets the bad password login attempt report for an user

@param service_name [String] The name of the service. @param data_source [String] The source of data, if its test data or customer data. @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/services_operations.rb, line 2004
def list_user_bad_password_report_with_http_info(service_name, data_source:nil, custom_headers:nil)
  list_user_bad_password_report_async(service_name, data_source:data_source, 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 services, 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/services_operations.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 the 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/services_operations.rb, line 555
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 the 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/services_operations.rb, line 586
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/services/{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_monitoring_configuration(service_name, configuration_setting, custom_headers:nil) click to toggle source

Updates the service level monitoring configuration.

@param service_name [String] The name of the service. @param configuration_setting [Item] The monitoring configuration to update @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/services_operations.rb, line 1808
def update_monitoring_configuration(service_name, configuration_setting, custom_headers:nil)
  response = update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:custom_headers).value!
  nil
end
update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:nil) click to toggle source

Updates the service level monitoring configuration.

@param service_name [String] The name of the service. @param configuration_setting [Item] The monitoring configuration to update @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/services_operations.rb, line 1837
def update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:nil)
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, 'configuration_setting is nil' if configuration_setting.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::Item.mapper()
  request_content = @client.serialize(request_mapper,  configuration_setting)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfiguration'

  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?

    result
  end

  promise.execute
end
update_monitoring_configuration_with_http_info(service_name, configuration_setting, custom_headers:nil) click to toggle source

Updates the service level monitoring configuration.

@param service_name [String] The name of the service. @param configuration_setting [Item] The monitoring configuration to update @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/services_operations.rb, line 1823
def update_monitoring_configuration_with_http_info(service_name, configuration_setting, custom_headers:nil)
  update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:custom_headers).value!
end
update_with_http_info(service_name, service, custom_headers:nil) click to toggle source

Updates the 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/services_operations.rb, line 571
def update_with_http_info(service_name, service, custom_headers:nil)
  update_async(service_name, service, custom_headers:custom_headers).value!
end