Class: Azure::ADHybridHealthService::Mgmt::V2014_01_01::ServicesOperations

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb

Overview

REST APIs for Azure Active Directory Connect Health

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ServicesOperations

Creates and initializes a new instance of the ServicesOperations class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientADHybridHealthService (readonly)

Returns reference to the ADHybridHealthService.

Returns:



22
23
24
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 22

def client
  @client
end

Instance Method Details

#add(service, custom_headers: nil) ⇒ ServiceProperties

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

will be added to the HTTP request.

Parameters:

  • service (ServiceProperties)

    The service object.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ServiceProperties)

    operation results.



151
152
153
154
# 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) ⇒ AlertFeedback

Adds an alert feedback submitted by customer.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • alert_feedback (AlertFeedback)

    The alert feedback.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (AlertFeedback)

    operation results.



1122
1123
1124
1125
# 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) ⇒ Concurrent::Promise

Adds an alert feedback submitted by customer.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • alert_feedback (AlertFeedback)

    The alert feedback.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
# 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) ⇒ MsRestAzure::AzureOperationResponse

Adds an alert feedback submitted by customer.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • alert_feedback (AlertFeedback)

    The alert feedback.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1137
1138
1139
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service (ServiceProperties)

    The service object.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service (ServiceProperties)

    The service object.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



166
167
168
# 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) ⇒ Object

Deletes a service which is onboarded to Azure Active Directory Connect Health.

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. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service which needs to be

  • confirm (Boolean) (defaults to: nil)

    Indicates if the service will be permanently deleted

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



462
463
464
465
# 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) ⇒ Concurrent::Promise

Deletes a service which is onboarded to Azure Active Directory Connect Health.

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. to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service which needs to be

  • confirm (Boolean) (defaults to: nil)

    Indicates if the service will be permanently deleted

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# 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) ⇒ MsRestAzure::AzureOperationResponse

Deletes a service which is onboarded to Azure Active Directory Connect Health.

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. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service which needs to be

  • confirm (Boolean) (defaults to: nil)

    Indicates if the service will be permanently deleted

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



482
483
484
# 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) ⇒ ServiceProperties

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ServiceProperties)

    operation results.



366
367
368
369
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# 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) ⇒ Result

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • feature_name (String)

    The name of the feature.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Result)

    operation results.



758
759
760
761
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • feature_name (String)

    The name of the feature.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • feature_name (String)

    The name of the feature.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



773
774
775
# 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) ⇒ MetricMetadata

Gets the service related metrics information.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MetricMetadata)

    operation results.



1610
1611
1612
1613
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1610

def (service_name, metric_name, custom_headers:nil)
  response = (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) ⇒ Concurrent::Promise

Gets the service related metrics information.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1639

def (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) ⇒ MetricSets

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • group_key (String) (defaults to: nil)

    The group key

  • from_date (DateTime) (defaults to: nil)

    The start date.

  • to_date (DateTime) (defaults to: nil)

    The end date.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MetricSets)

    operation results.



1707
1708
1709
1710
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1707

def (service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
  response = (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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • group_key (String) (defaults to: nil)

    The group key

  • from_date (DateTime) (defaults to: nil)

    The start date.

  • to_date (DateTime) (defaults to: nil)

    The end date.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1744

def (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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • group_key (String) (defaults to: nil)

    The group key

  • from_date (DateTime) (defaults to: nil)

    The start date.

  • to_date (DateTime) (defaults to: nil)

    The end date.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1726
1727
1728
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1726

def (service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
  (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) ⇒ MsRestAzure::AzureOperationResponse

Gets the service related metrics information.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1625
1626
1627
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1625

def (service_name, metric_name, custom_headers:nil)
  (service_name, metric_name, custom_headers:custom_headers).value!
end

#get_tenant_whitelisting(service_name, feature_name, custom_headers: nil) ⇒ Result

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • feature_name (String)

    The name of the feature.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Result)

    operation results.



2083
2084
2085
2086
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • feature_name (String)

    The name of the feature.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • feature_name (String)

    The name of the feature.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2099
2100
2101
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



381
382
383
# 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) ⇒ Array<ServiceProperties>

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<ServiceProperties>)

    operation results.



43
44
45
46
# 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) ⇒ AlertFeedbacks

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • short_name (String)

    The name of the alert.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (AlertFeedbacks)

    operation results.



1222
1223
1224
1225
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • short_name (String)

    The name of the alert.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • short_name (String)

    The name of the alert.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1237
1238
1239
# 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) ⇒ Array<Alert>

Gets the alerts for a given service.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The alert property filter to apply.

  • state (String) (defaults to: nil)

    The alert state to query for.

  • from (DateTime) (defaults to: nil)

    The start date to query for.

  • to (DateTime) (defaults to: nil)

    The end date till when to query for.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Alert>)

    operation results.



660
661
662
663
# 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) ⇒ Alerts

Gets the alerts for a given service.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The alert property filter to apply.

  • state (String) (defaults to: nil)

    The alert state to query for.

  • from (DateTime) (defaults to: nil)

    The start date to query for.

  • to (DateTime) (defaults to: nil)

    The end date till when to query for.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Alerts)

    which provide lazy access to pages of the response.



3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
# 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) ⇒ Concurrent::Promise

Gets the alerts for a given service.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The alert property filter to apply.

  • state (String) (defaults to: nil)

    The alert state to query for.

  • from (DateTime) (defaults to: nil)

    The start date to query for.

  • to (DateTime) (defaults to: nil)

    The end date till when to query for.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
# 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) ⇒ Alerts

Gets the alerts for a given service.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Alerts)

    operation results.



2545
2546
2547
2548
# 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) ⇒ Concurrent::Promise

Gets the alerts for a given service.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the alerts for a given service.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2560
2561
2562
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the alerts for a given service.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The alert property filter to apply.

  • state (String) (defaults to: nil)

    The alert state to query for.

  • from (DateTime) (defaults to: nil)

    The start date to query for.

  • to (DateTime) (defaults to: nil)

    The end date till when to query for.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



678
679
680
# 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) ⇒ RiskyIPBlobUris

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RiskyIPBlobUris)

    operation results.



2177
2178
2179
2180
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2191
2192
2193
# 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) ⇒ Services

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Services)

    which provide lazy access to pages of the response.



3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
# 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) ⇒ Concurrent::Promise

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# 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) ⇒ RiskyIPBlobUris

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RiskyIPBlobUris)

    operation results.



2267
2268
2269
2270
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2282
2283
2284
# 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) ⇒ ErrorCounts

Gets the count of latest AAD export errors.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ErrorCounts)

    operation results.



850
851
852
853
# 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) ⇒ Concurrent::Promise

Gets the count of latest AAD export errors.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
# 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) ⇒ MergedExportErrors

Gets the categorized export errors.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • error_bucket (String)

    The error category to query for.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MergedExportErrors)

    operation results.



940
941
942
943
# 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) ⇒ Concurrent::Promise

Gets the categorized export errors.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • error_bucket (String)

    The error category to query for.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the categorized export errors.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • error_bucket (String)

    The error category to query for.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



955
956
957
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the count of latest AAD export errors.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



864
865
866
# 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) ⇒ Array<ExportStatus>

Gets the export status.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<ExportStatus>)

    operation results.



1032
1033
1034
1035
# 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) ⇒ ExportStatuses

Gets the export status.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ExportStatuses)

    which provide lazy access to pages of the response.



3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
# 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) ⇒ Concurrent::Promise

Gets the export status.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
# 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) ⇒ ExportStatuses

Gets the export status.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ExportStatuses)

    operation results.



2635
2636
2637
2638
# 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) ⇒ Concurrent::Promise

Gets the export status.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the export status.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2650
2651
2652
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the export status.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1046
1047
1048
# 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) ⇒ Array<MetricMetadata>

Gets the service related metrics information.

are requested. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The metric metadata property filter to apply.

  • perf_counter (Boolean) (defaults to: nil)

    Indicates if only performance counter metrics

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<MetricMetadata>)

    operation results.



1514
1515
1516
1517
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1514

def (service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  first_page = (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) ⇒ MetricMetadataList

Gets the service related metrics information.

are requested. will be added to the HTTP request.

response.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The metric metadata property filter to apply.

  • perf_counter (Boolean) (defaults to: nil)

    Indicates if only performance counter metrics

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MetricMetadataList)

    which provide lazy access to pages of the



3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 3150

def (service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  response = (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|
      (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) ⇒ Concurrent::Promise

Gets the service related metrics information.

are requested. to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The metric metadata property filter to apply.

  • perf_counter (Boolean) (defaults to: nil)

    Indicates if only performance counter metrics

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1547

def (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) ⇒ MetricMetadataList

Gets the service related metrics information.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MetricMetadataList)

    operation results.



2908
2909
2910
2911
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 2908

def (next_page_link, custom_headers:nil)
  response = (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) ⇒ Concurrent::Promise

Gets the service related metrics information.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 2937

def (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) ⇒ MsRestAzure::AzureOperationResponse

Gets the service related metrics information.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2923
2924
2925
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 2923

def (next_page_link, custom_headers:nil)
  (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) ⇒ MsRestAzure::AzureOperationResponse

Gets the service related metrics information.

are requested. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • filter (String) (defaults to: nil)

    The metric metadata property filter to apply.

  • perf_counter (Boolean) (defaults to: nil)

    Indicates if only performance counter metrics

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1531
1532
1533
# File 'lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb', line 1531

def (service_name, filter:nil, perf_counter:nil, custom_headers:nil)
  (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) ⇒ Array<Item>

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Item>)

    operation results.



1317
1318
1319
1320
# 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) ⇒ Metrics

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Metrics)

    which provide lazy access to pages of the response.



3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
# 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) ⇒ Metrics

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Metrics)

    operation results.



2726
2727
2728
2729
# 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) ⇒ Concurrent::Promise

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2742
2743
2744
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1334
1335
1336
# 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) ⇒ Array<Item>

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Item>)

    operation results.



1416
1417
1418
1419
# 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) ⇒ Metrics

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Metrics)

    which provide lazy access to pages of the response.



3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
# 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) ⇒ Concurrent::Promise

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

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
# 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) ⇒ Metrics

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Metrics)

    operation results.



2818
2819
2820
2821
# 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) ⇒ Concurrent::Promise

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2833
2834
2835
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • metric_name (String)

    The metric name

  • group_name (String)

    The group name

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1432
1433
1434
# 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) ⇒ Items

Gets the service level monitoring configurations.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Items)

    operation results.



1897
1898
1899
1900
# 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) ⇒ Concurrent::Promise

Gets the service level monitoring configurations.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the service level monitoring configurations.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1911
1912
1913
# 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) ⇒ Services

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Services)

    operation results.



2360
2361
2362
2363
# 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) ⇒ Concurrent::Promise

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2376
2377
2378
# 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) ⇒ Array<ServiceProperties>

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<ServiceProperties>)

    operation results.



258
259
260
261
# 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) ⇒ Services

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Services)

    which provide lazy access to pages of the response.



3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
# 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) ⇒ Concurrent::Promise

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# 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) ⇒ Services

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Services)

    operation results.



2453
2454
2455
2456
# 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) ⇒ Concurrent::Promise

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2469
2470
2471
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



282
283
284
# 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) ⇒ ErrorReportUsersEntries

Gets the bad password login attempt report for an user

data. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • data_source (String) (defaults to: nil)

    The source of data, if its test data or customer

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ErrorReportUsersEntries)

    operation results.



1988
1989
1990
1991
# 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) ⇒ Concurrent::Promise

Gets the bad password login attempt report for an user

data. to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • data_source (String) (defaults to: nil)

    The source of data, if its test data or customer

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
# 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) ⇒ MsRestAzure::AzureOperationResponse

Gets the bad password login attempt report for an user

data. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • data_source (String) (defaults to: nil)

    The source of data, if its test data or customer

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2004
2005
2006
# 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) ⇒ MsRestAzure::AzureOperationResponse

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

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. elements that can be bypassed from a sequence and then return the remaining elements. elements that can be returned from a sequence. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    The service property filter to apply.

  • service_type (String) (defaults to: nil)

    The service type for the services onboarded to

  • skip_count (Integer) (defaults to: nil)

    The skip count, which specifies the number of

  • take_count (Integer) (defaults to: nil)

    The take count , which specifies the number of

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



67
68
69
# 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) ⇒ ServiceProperties

Updates the service properties of an onboarded service.

deleted. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service which needs to be

  • service (ServiceProperties)

    The service object.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ServiceProperties)

    operation results.



555
556
557
558
# 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) ⇒ Concurrent::Promise

Updates the service properties of an onboarded service.

deleted. to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service which needs to be

  • service (ServiceProperties)

    The service object.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# 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) ⇒ Object

Updates the service level monitoring configuration.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • configuration_setting (Item)

    The monitoring configuration to update

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1808
1809
1810
1811
# 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) ⇒ Concurrent::Promise

Updates the service level monitoring configuration.

to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • configuration_setting (Item)

    The monitoring configuration to update

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
# 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) ⇒ MsRestAzure::AzureOperationResponse

Updates the service level monitoring configuration.

will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service.

  • configuration_setting (Item)

    The monitoring configuration to update

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1823
1824
1825
# 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) ⇒ MsRestAzure::AzureOperationResponse

Updates the service properties of an onboarded service.

deleted. will be added to the HTTP request.

Parameters:

  • service_name (String)

    The name of the service which needs to be

  • service (ServiceProperties)

    The service object.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



571
572
573
# 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