azure_mgmt_monitor 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2015-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2015-05-01/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
- data/lib/2016-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
- data/lib/2017-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
- data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2018-01-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2018-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2018-04-16/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
- data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2018-06-17-preview/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
- data/lib/2018-09-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2019-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2019-06-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
- data/lib/2020-10-01/generated/azure_mgmt_monitor.rb +38 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/activity_log_alerts.rb +884 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/action_group.rb +68 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/action_list.rb +55 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/activity_log_alert_resource.rb +160 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/alert_rule_all_of_condition.rb +57 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/alert_rule_any_of_or_leaf_condition.rb +101 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/alert_rule_leaf_condition.rb +86 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/alert_rule_list.rb +100 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/alert_rule_patch_object.rb +68 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/azure_resource.rb +104 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/models/error_response.rb +59 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
- data/lib/2020-10-01/generated/azure_mgmt_monitor/monitor_management_client.rb +131 -0
- data/lib/azure_mgmt_monitor.rb +1 -0
- data/lib/profiles/latest/modules/monitor_profile_module.rb +72 -64
- data/lib/version.rb +1 -1
- metadata +16 -2
@@ -0,0 +1,100 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Monitor::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# A list of Activity Log Alert rules.
|
10
|
+
#
|
11
|
+
class AlertRuleList
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
include MsRest::JSONable
|
16
|
+
# @return [Array<ActivityLogAlertResource>] The list of Activity Log
|
17
|
+
# Alert rules.
|
18
|
+
attr_accessor :value
|
19
|
+
|
20
|
+
# @return [String] Provides the link to retrieve the next set of
|
21
|
+
# elements.
|
22
|
+
attr_accessor :next_link
|
23
|
+
|
24
|
+
# return [Proc] with next page method call.
|
25
|
+
attr_accessor :next_method
|
26
|
+
|
27
|
+
#
|
28
|
+
# Gets the rest of the items for the request, enabling auto-pagination.
|
29
|
+
#
|
30
|
+
# @return [Array<ActivityLogAlertResource>] operation results.
|
31
|
+
#
|
32
|
+
def get_all_items
|
33
|
+
items = @value
|
34
|
+
page = self
|
35
|
+
while page.next_link != nil && !page.next_link.strip.empty? do
|
36
|
+
page = page.get_next_page
|
37
|
+
items.concat(page.value)
|
38
|
+
end
|
39
|
+
items
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Gets the next page of results.
|
44
|
+
#
|
45
|
+
# @return [AlertRuleList] with next page content.
|
46
|
+
#
|
47
|
+
def get_next_page
|
48
|
+
response = @next_method.call(@next_link).value! unless @next_method.nil?
|
49
|
+
unless response.nil?
|
50
|
+
@next_link = response.body.next_link
|
51
|
+
@value = response.body.value
|
52
|
+
self
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Mapper for AlertRuleList class as Ruby Hash.
|
58
|
+
# This will be used for serialization/deserialization.
|
59
|
+
#
|
60
|
+
def self.mapper()
|
61
|
+
{
|
62
|
+
client_side_validation: true,
|
63
|
+
required: false,
|
64
|
+
serialized_name: 'AlertRuleList',
|
65
|
+
type: {
|
66
|
+
name: 'Composite',
|
67
|
+
class_name: 'AlertRuleList',
|
68
|
+
model_properties: {
|
69
|
+
value: {
|
70
|
+
client_side_validation: true,
|
71
|
+
required: false,
|
72
|
+
serialized_name: 'value',
|
73
|
+
type: {
|
74
|
+
name: 'Sequence',
|
75
|
+
element: {
|
76
|
+
client_side_validation: true,
|
77
|
+
required: false,
|
78
|
+
serialized_name: 'ActivityLogAlertResourceElementType',
|
79
|
+
type: {
|
80
|
+
name: 'Composite',
|
81
|
+
class_name: 'ActivityLogAlertResource'
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
},
|
86
|
+
next_link: {
|
87
|
+
client_side_validation: true,
|
88
|
+
required: false,
|
89
|
+
serialized_name: 'nextLink',
|
90
|
+
type: {
|
91
|
+
name: 'String'
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Monitor::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# An Activity Log Alert rule object for the body of patch operations.
|
10
|
+
#
|
11
|
+
class AlertRulePatchObject
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [Hash{String => String}] The resource tags
|
16
|
+
attr_accessor :tags
|
17
|
+
|
18
|
+
# @return [Boolean] Indicates whether this Activity Log Alert rule is
|
19
|
+
# enabled. If an Activity Log Alert rule is not enabled, then none of its
|
20
|
+
# actions will be activated. Default value: true .
|
21
|
+
attr_accessor :enabled
|
22
|
+
|
23
|
+
|
24
|
+
#
|
25
|
+
# Mapper for AlertRulePatchObject class as Ruby Hash.
|
26
|
+
# This will be used for serialization/deserialization.
|
27
|
+
#
|
28
|
+
def self.mapper()
|
29
|
+
{
|
30
|
+
client_side_validation: true,
|
31
|
+
required: false,
|
32
|
+
serialized_name: 'AlertRulePatchObject',
|
33
|
+
type: {
|
34
|
+
name: 'Composite',
|
35
|
+
class_name: 'AlertRulePatchObject',
|
36
|
+
model_properties: {
|
37
|
+
tags: {
|
38
|
+
client_side_validation: true,
|
39
|
+
required: false,
|
40
|
+
serialized_name: 'tags',
|
41
|
+
type: {
|
42
|
+
name: 'Dictionary',
|
43
|
+
value: {
|
44
|
+
client_side_validation: true,
|
45
|
+
required: false,
|
46
|
+
serialized_name: 'StringElementType',
|
47
|
+
type: {
|
48
|
+
name: 'String'
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
},
|
53
|
+
enabled: {
|
54
|
+
client_side_validation: true,
|
55
|
+
required: false,
|
56
|
+
serialized_name: 'properties.enabled',
|
57
|
+
default_value: true,
|
58
|
+
type: {
|
59
|
+
name: 'Boolean'
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Monitor::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# An Azure resource object.
|
10
|
+
#
|
11
|
+
class AzureResource
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The resource Id.
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# @return [String] The name of the resource.
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# @return [String] The type of the resource.
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
# @return [String] The location of the resource. Since Azure Activity Log
|
25
|
+
# Alerts is a global service, the location of the rules should always be
|
26
|
+
# 'global'. Default value: 'global' .
|
27
|
+
attr_accessor :location
|
28
|
+
|
29
|
+
# @return [Hash{String => String}] The tags of the resource.
|
30
|
+
attr_accessor :tags
|
31
|
+
|
32
|
+
|
33
|
+
#
|
34
|
+
# Mapper for AzureResource class as Ruby Hash.
|
35
|
+
# This will be used for serialization/deserialization.
|
36
|
+
#
|
37
|
+
def self.mapper()
|
38
|
+
{
|
39
|
+
client_side_validation: true,
|
40
|
+
required: false,
|
41
|
+
serialized_name: 'AzureResource',
|
42
|
+
type: {
|
43
|
+
name: 'Composite',
|
44
|
+
class_name: 'AzureResource',
|
45
|
+
model_properties: {
|
46
|
+
id: {
|
47
|
+
client_side_validation: true,
|
48
|
+
required: false,
|
49
|
+
read_only: true,
|
50
|
+
serialized_name: 'id',
|
51
|
+
type: {
|
52
|
+
name: 'String'
|
53
|
+
}
|
54
|
+
},
|
55
|
+
name: {
|
56
|
+
client_side_validation: true,
|
57
|
+
required: false,
|
58
|
+
read_only: true,
|
59
|
+
serialized_name: 'name',
|
60
|
+
type: {
|
61
|
+
name: 'String'
|
62
|
+
}
|
63
|
+
},
|
64
|
+
type: {
|
65
|
+
client_side_validation: true,
|
66
|
+
required: false,
|
67
|
+
read_only: true,
|
68
|
+
serialized_name: 'type',
|
69
|
+
type: {
|
70
|
+
name: 'String'
|
71
|
+
}
|
72
|
+
},
|
73
|
+
location: {
|
74
|
+
client_side_validation: true,
|
75
|
+
required: false,
|
76
|
+
serialized_name: 'location',
|
77
|
+
default_value: 'global',
|
78
|
+
type: {
|
79
|
+
name: 'String'
|
80
|
+
}
|
81
|
+
},
|
82
|
+
tags: {
|
83
|
+
client_side_validation: true,
|
84
|
+
required: false,
|
85
|
+
serialized_name: 'tags',
|
86
|
+
type: {
|
87
|
+
name: 'Dictionary',
|
88
|
+
value: {
|
89
|
+
client_side_validation: true,
|
90
|
+
required: false,
|
91
|
+
serialized_name: 'StringElementType',
|
92
|
+
type: {
|
93
|
+
name: 'String'
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Monitor::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# The error response.
|
10
|
+
#
|
11
|
+
class ErrorResponse
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The error code.
|
16
|
+
attr_accessor :code
|
17
|
+
|
18
|
+
# @return [String] The error message indicating why the operation failed.
|
19
|
+
attr_accessor :message
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Mapper for ErrorResponse class as Ruby Hash.
|
24
|
+
# This will be used for serialization/deserialization.
|
25
|
+
#
|
26
|
+
def self.mapper()
|
27
|
+
{
|
28
|
+
client_side_validation: true,
|
29
|
+
required: false,
|
30
|
+
serialized_name: 'ErrorResponse',
|
31
|
+
type: {
|
32
|
+
name: 'Composite',
|
33
|
+
class_name: 'ErrorResponse',
|
34
|
+
model_properties: {
|
35
|
+
code: {
|
36
|
+
client_side_validation: true,
|
37
|
+
required: false,
|
38
|
+
read_only: true,
|
39
|
+
serialized_name: 'code',
|
40
|
+
type: {
|
41
|
+
name: 'String'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
message: {
|
45
|
+
client_side_validation: true,
|
46
|
+
required: false,
|
47
|
+
read_only: true,
|
48
|
+
serialized_name: 'message',
|
49
|
+
type: {
|
50
|
+
name: 'String'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure end
|
7
|
+
module Azure::Monitor end
|
8
|
+
module Azure::Monitor::Mgmt end
|
9
|
+
module Azure::Monitor::Mgmt::V2020_10_01 end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Monitor::Mgmt::V2020_10_01
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class MonitorManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] The API version to use for this operation.
|
21
|
+
attr_reader :api_version
|
22
|
+
|
23
|
+
# @return [String] The ID of the target subscription.
|
24
|
+
attr_accessor :subscription_id
|
25
|
+
|
26
|
+
# @return [String] The preferred language for the response.
|
27
|
+
attr_accessor :accept_language
|
28
|
+
|
29
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
30
|
+
# Operations. Default value is 30.
|
31
|
+
attr_accessor :long_running_operation_retry_timeout
|
32
|
+
|
33
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
34
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
35
|
+
# generated and included in each request. Default is true.
|
36
|
+
attr_accessor :generate_client_request_id
|
37
|
+
|
38
|
+
# @return [ActivityLogAlerts] activity_log_alerts
|
39
|
+
attr_reader :activity_log_alerts
|
40
|
+
|
41
|
+
#
|
42
|
+
# Creates initializes a new instance of the MonitorManagementClient class.
|
43
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
44
|
+
# @param base_url [String] the base URI of the service.
|
45
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
46
|
+
#
|
47
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
48
|
+
super(credentials, options)
|
49
|
+
@base_url = base_url || 'https://management.azure.com'
|
50
|
+
|
51
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
52
|
+
@credentials = credentials
|
53
|
+
|
54
|
+
@activity_log_alerts = ActivityLogAlerts.new(self)
|
55
|
+
@api_version = '2020-10-01'
|
56
|
+
@accept_language = 'en-US'
|
57
|
+
@long_running_operation_retry_timeout = 30
|
58
|
+
@generate_client_request_id = true
|
59
|
+
add_telemetry
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Makes a request and returns the body of the response.
|
64
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
65
|
+
# @param path [String] the path, relative to {base_url}.
|
66
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
67
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
68
|
+
# Example:
|
69
|
+
#
|
70
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
71
|
+
# path = "/path"
|
72
|
+
# options = {
|
73
|
+
# body: request_content,
|
74
|
+
# query_params: {'api-version' => '2016-02-01'}
|
75
|
+
# }
|
76
|
+
# result = @client.make_request(:put, path, options)
|
77
|
+
#
|
78
|
+
def make_request(method, path, options = {})
|
79
|
+
result = make_request_with_http_info(method, path, options)
|
80
|
+
result.body unless result.nil?
|
81
|
+
end
|
82
|
+
|
83
|
+
#
|
84
|
+
# Makes a request and returns the operation response.
|
85
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
86
|
+
# @param path [String] the path, relative to {base_url}.
|
87
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
88
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
89
|
+
#
|
90
|
+
def make_request_with_http_info(method, path, options = {})
|
91
|
+
result = make_request_async(method, path, options).value!
|
92
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
93
|
+
result
|
94
|
+
end
|
95
|
+
|
96
|
+
#
|
97
|
+
# Makes a request asynchronously.
|
98
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
99
|
+
# @param path [String] the path, relative to {base_url}.
|
100
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
101
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
102
|
+
#
|
103
|
+
def make_request_async(method, path, options = {})
|
104
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
105
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
106
|
+
|
107
|
+
request_url = options[:base_url] || @base_url
|
108
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
109
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
110
|
+
end
|
111
|
+
|
112
|
+
request_headers = @request_headers
|
113
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
114
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
115
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
116
|
+
|
117
|
+
super(request_url, method, path, options)
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
private
|
122
|
+
#
|
123
|
+
# Adds telemetry information.
|
124
|
+
#
|
125
|
+
def add_telemetry
|
126
|
+
sdk_information = 'azure_mgmt_monitor'
|
127
|
+
sdk_information = "#{sdk_information}/0.19.0"
|
128
|
+
add_user_agent_information(sdk_information)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|