Class: Azure::AlertsManagement::Mgmt::V2019_05_05_preview::ActionRules
- Inherits:
-
Object
- Object
- Azure::AlertsManagement::Mgmt::V2019_05_05_preview::ActionRules
- Includes:
- MsRestAzure
- Defined in:
- lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb
Overview
AlertsManagement Client
Instance Attribute Summary collapse
-
#client ⇒ AlertsManagementClient
readonly
Reference to the AlertsManagementClient.
Instance Method Summary collapse
-
#create_update(resource_group_name, action_rule_name, action_rule, custom_headers: nil) ⇒ ActionRule
Create/update an action rule.
-
#create_update_async(resource_group_name, action_rule_name, action_rule, custom_headers: nil) ⇒ Concurrent::Promise
Create/update an action rule.
-
#create_update_with_http_info(resource_group_name, action_rule_name, action_rule, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create/update an action rule.
-
#delete(resource_group_name, action_rule_name, custom_headers: nil) ⇒ Boolean
Delete action rule.
-
#delete_async(resource_group_name, action_rule_name, custom_headers: nil) ⇒ Concurrent::Promise
Delete action rule.
-
#delete_with_http_info(resource_group_name, action_rule_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Delete action rule.
-
#get_by_name(resource_group_name, action_rule_name, custom_headers: nil) ⇒ ActionRule
Get action rule by name.
-
#get_by_name_async(resource_group_name, action_rule_name, custom_headers: nil) ⇒ Concurrent::Promise
Get action rule by name.
-
#get_by_name_with_http_info(resource_group_name, action_rule_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get action rule by name.
-
#initialize(client) ⇒ ActionRules
constructor
Creates and initializes a new instance of the ActionRules class.
-
#list_by_resource_group(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Array<ActionRule>
Get all action rules created in a resource group.
-
#list_by_resource_group_as_lazy(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ ActionRulesList
Get all action rules created in a resource group.
-
#list_by_resource_group_async(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rules created in a resource group.
-
#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ ActionRulesList
Get all action rules created in a resource group.
-
#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rules created in a resource group.
-
#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rules created in a resource group.
-
#list_by_resource_group_with_http_info(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rules created in a resource group.
-
#list_by_subscription(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Array<ActionRule>
Get all action rule in a given subscription.
-
#list_by_subscription_as_lazy(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ ActionRulesList
Get all action rule in a given subscription.
-
#list_by_subscription_async(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rule in a given subscription.
-
#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ ActionRulesList
Get all action rule in a given subscription.
-
#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rule in a given subscription.
-
#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rule in a given subscription.
-
#list_by_subscription_with_http_info(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rule in a given subscription.
-
#update(resource_group_name, action_rule_name, action_rule_patch, custom_headers: nil) ⇒ ActionRule
Patch action rule.
-
#update_async(resource_group_name, action_rule_name, action_rule_patch, custom_headers: nil) ⇒ Concurrent::Promise
Patch action rule.
-
#update_with_http_info(resource_group_name, action_rule_name, action_rule_patch, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Patch action rule.
Constructor Details
#initialize(client) ⇒ ActionRules
Creates and initializes a new instance of the ActionRules class.
17 18 19 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ AlertsManagementClient (readonly)
Returns reference to the AlertsManagementClient.
22 23 24 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 22 def client @client end |
Instance Method Details
#create_update(resource_group_name, action_rule_name, action_rule, custom_headers: nil) ⇒ ActionRule
Create/update an action rule
Creates/Updates a specific action rule
created. created/updated will be added to the HTTP request.
471 472 473 474 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 471 def create_update(resource_group_name, action_rule_name, action_rule, custom_headers:nil) response = create_update_async(resource_group_name, action_rule_name, action_rule, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_update_async(resource_group_name, action_rule_name, action_rule, custom_headers: nil) ⇒ Concurrent::Promise
Create/update an action rule
Creates/Updates a specific action rule
created. created/updated to the HTTP request.
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 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 510 def create_update_async(resource_group_name, action_rule_name, action_rule, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'action_rule_name is nil' if action_rule_name.nil? fail ArgumentError, 'action_rule is nil' if action_rule.nil? @client.api_version = '2019-05-05-preview' 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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRule.mapper() request_content = @client.serialize(request_mapper, action_rule) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'actionRuleName' => action_rule_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(:put, path_template, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRule.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#create_update_with_http_info(resource_group_name, action_rule_name, action_rule, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create/update an action rule
Creates/Updates a specific action rule
created. created/updated will be added to the HTTP request.
491 492 493 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 491 def create_update_with_http_info(resource_group_name, action_rule_name, action_rule, custom_headers:nil) create_update_async(resource_group_name, action_rule_name, action_rule, custom_headers:custom_headers).value! end |
#delete(resource_group_name, action_rule_name, custom_headers: nil) ⇒ Boolean
Delete action rule
Deletes a given action rule
created. will be added to the HTTP request.
586 587 588 589 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 586 def delete(resource_group_name, action_rule_name, custom_headers:nil) response = delete_async(resource_group_name, action_rule_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#delete_async(resource_group_name, action_rule_name, custom_headers: nil) ⇒ Concurrent::Promise
Delete action rule
Deletes a given action rule
created. to the HTTP request.
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 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 621 def delete_async(resource_group_name, action_rule_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'action_rule_name is nil' if action_rule_name.nil? @client.api_version = '2019-05-05-preview' 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'actionRuleName' => action_rule_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) 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 MsRest::HttpOperationError.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 = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Boolean' } } result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#delete_with_http_info(resource_group_name, action_rule_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Delete action rule
Deletes a given action rule
created. will be added to the HTTP request.
604 605 606 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 604 def delete_with_http_info(resource_group_name, action_rule_name, custom_headers:nil) delete_async(resource_group_name, action_rule_name, custom_headers:custom_headers).value! end |
#get_by_name(resource_group_name, action_rule_name, custom_headers: nil) ⇒ ActionRule
Get action rule by name
Get a specific action rule
created. fetched will be added to the HTTP request.
364 365 366 367 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 364 def get_by_name(resource_group_name, action_rule_name, custom_headers:nil) response = get_by_name_async(resource_group_name, action_rule_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_by_name_async(resource_group_name, action_rule_name, custom_headers: nil) ⇒ Concurrent::Promise
Get action rule by name
Get a specific action rule
created. fetched to the HTTP request.
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 447 448 449 450 451 452 453 454 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 401 def get_by_name_async(resource_group_name, action_rule_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'action_rule_name is nil' if action_rule_name.nil? @client.api_version = '2019-05-05-preview' 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'actionRuleName' => action_rule_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, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRule.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_by_name_with_http_info(resource_group_name, action_rule_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get action rule by name
Get a specific action rule
created. fetched will be added to the HTTP request.
383 384 385 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 383 def get_by_name_with_http_info(resource_group_name, action_rule_name, custom_headers:nil) get_by_name_async(resource_group_name, action_rule_name, custom_headers:custom_headers).value! end |
#list_by_resource_group(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Array<ActionRule>
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
created. Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule will be added to the HTTP request.
217 218 219 220 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 217 def list_by_resource_group(resource_group_name, target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) first_page = list_by_resource_group_as_lazy(resource_group_name, target_resource_group:target_resource_group, target_resource_type:target_resource_type, target_resource:target_resource, severity:severity, monitor_service:monitor_service, impacted_scope:impacted_scope, description:description, alert_rule_id:alert_rule_id, action_group:action_group, name:name, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_resource_group_as_lazy(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ ActionRulesList
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
created. Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule will be added to the HTTP request.
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 1070 def list_by_resource_group_as_lazy(resource_group_name, target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) response = list_by_resource_group_async(resource_group_name, target_resource_group:target_resource_group, target_resource_type:target_resource_type, target_resource:target_resource, severity:severity, monitor_service:monitor_service, impacted_scope:impacted_scope, description:description, alert_rule_id:alert_rule_id, action_group:action_group, name:name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_resource_group_async(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
created. Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule to the HTTP request.
296 297 298 299 300 301 302 303 304 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 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 296 def list_by_resource_group_async(resource_group_name, target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? @client.api_version = '2019-05-05-preview' 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, query_params: {'targetResourceGroup' => target_resource_group,'targetResourceType' => target_resource_type,'targetResource' => target_resource,'severity' => severity,'monitorService' => monitor_service,'impactedScope' => impacted_scope,'description' => description,'alertRuleId' => alert_rule_id,'actionGroup' => action_group,'name' => name,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRulesList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ ActionRulesList
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
to List operation. will be added to the HTTP request.
906 907 908 909 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 906 def list_by_resource_group_next(next_page_link, custom_headers:nil) response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
to List operation. to the HTTP request.
941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 941 def list_by_resource_group_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 = { 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, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRulesList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
to List operation. will be added to the HTTP request.
924 925 926 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 924 def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_resource_group_with_http_info(resource_group_name, target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rules created in a resource group
List all action rules of the subscription, created in given resource group and given input filters
created. Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule will be added to the HTTP request.
257 258 259 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 257 def list_by_resource_group_with_http_info(resource_group_name, target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) list_by_resource_group_async(resource_group_name, target_resource_group:target_resource_group, target_resource_type:target_resource_type, target_resource:target_resource, severity:severity, monitor_service:monitor_service, impacted_scope:impacted_scope, description:description, alert_rule_id:alert_rule_id, action_group:action_group, name:name, custom_headers:custom_headers).value! end |
#list_by_subscription(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Array<ActionRule>
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule will be added to the HTTP request.
56 57 58 59 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 56 def list_by_subscription(target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) first_page = list_by_subscription_as_lazy(target_resource_group:target_resource_group, target_resource_type:target_resource_type, target_resource:target_resource, severity:severity, monitor_service:monitor_service, impacted_scope:impacted_scope, description:description, alert_rule_id:alert_rule_id, action_group:action_group, name:name, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_subscription_as_lazy(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ ActionRulesList
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule will be added to the HTTP request.
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 1024 def list_by_subscription_as_lazy(target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) response = list_by_subscription_async(target_resource_group:target_resource_group, target_resource_type:target_resource_type, target_resource:target_resource, severity:severity, monitor_service:monitor_service, impacted_scope:impacted_scope, description:description, alert_rule_id:alert_rule_id, action_group:action_group, name:name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_subscription_async(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule to the HTTP request.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 129 def list_by_subscription_async(target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? @client.api_version = '2019-05-05-preview' 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 = 'subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/actionRules' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id}, query_params: {'targetResourceGroup' => target_resource_group,'targetResourceType' => target_resource_type,'targetResource' => target_resource,'severity' => severity,'monitorService' => monitor_service,'impactedScope' => impacted_scope,'description' => description,'alertRuleId' => alert_rule_id,'actionGroup' => action_group,'name' => name,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRulesList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ ActionRulesList
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
to List operation. will be added to the HTTP request.
809 810 811 812 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 809 def list_by_subscription_next(next_page_link, custom_headers:nil) response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
to List operation. to the HTTP request.
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 842 def list_by_subscription_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 = { 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, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRulesList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
to List operation. will be added to the HTTP request.
826 827 828 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 826 def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_subscription_with_http_info(target_resource_group: nil, target_resource_type: nil, target_resource: nil, severity: nil, monitor_service: nil, impacted_scope: nil, description: nil, alert_rule_id: nil, action_group: nil, name: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get all action rule in a given subscription
List all action rules of the subscription and given input filters
Default value is select all. value is select all. ID) Default value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’ generates the alert instance. Default value is select all. Possible values include: ‘Application Insights’, ‘ActivityLog Administrative’, ‘ActivityLog Security’, ‘ActivityLog Recommendation’, ‘ActivityLog Policy’, ‘ActivityLog Autoscale’, ‘Log Analytics’, ‘Nagios’, ‘Platform’, ‘SCOM’, ‘ServiceHealth’, ‘SmartDetector’, ‘VM Insights’, ‘Zabbix’ separated list for multiple scopes). The value should be an well constructed ARM id of the scope. action rule will be added to the HTTP request.
93 94 95 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 93 def list_by_subscription_with_http_info(target_resource_group:nil, target_resource_type:nil, target_resource:nil, severity:nil, monitor_service:nil, impacted_scope:nil, description:nil, alert_rule_id:nil, action_group:nil, name:nil, custom_headers:nil) list_by_subscription_async(target_resource_group:target_resource_group, target_resource_type:target_resource_type, target_resource:target_resource, severity:severity, monitor_service:monitor_service, impacted_scope:impacted_scope, description:description, alert_rule_id:alert_rule_id, action_group:action_group, name:name, custom_headers:custom_headers).value! end |
#update(resource_group_name, action_rule_name, action_rule_patch, custom_headers: nil) ⇒ ActionRule
Patch action rule
Update enabled flag and/or tags for the given action rule
created. will be added to the HTTP request.
697 698 699 700 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 697 def update(resource_group_name, action_rule_name, action_rule_patch, custom_headers:nil) response = update_async(resource_group_name, action_rule_name, action_rule_patch, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_async(resource_group_name, action_rule_name, action_rule_patch, custom_headers: nil) ⇒ Concurrent::Promise
Patch action rule
Update enabled flag and/or tags for the given action rule
created. to the HTTP request.
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 734 def update_async(resource_group_name, action_rule_name, action_rule_patch, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'action_rule_name is nil' if action_rule_name.nil? fail ArgumentError, 'action_rule_patch is nil' if action_rule_patch.nil? @client.api_version = '2019-05-05-preview' 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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::PatchObject.mapper() request_content = @client.serialize(request_mapper, action_rule_patch) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'actionRuleName' => action_rule_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, ) 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 MsRest::HttpOperationError.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::AlertsManagement::Mgmt::V2019_05_05_preview::Models::ActionRule.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#update_with_http_info(resource_group_name, action_rule_name, action_rule_patch, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Patch action rule
Update enabled flag and/or tags for the given action rule
created. will be added to the HTTP request.
716 717 718 |
# File 'lib/2019-05-05-preview/generated/azure_mgmt_alerts_management/action_rules.rb', line 716 def update_with_http_info(resource_group_name, action_rule_name, action_rule_patch, custom_headers:nil) update_async(resource_group_name, action_rule_name, action_rule_patch, custom_headers:custom_headers).value! end |