azure_mgmt_security 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-08-01-preview/generated/azure_mgmt_security.rb +48 -0
  4. data/lib/2017-08-01-preview/generated/azure_mgmt_security/auto_provisioning_settings.rb +407 -0
  5. data/lib/2017-08-01-preview/generated/azure_mgmt_security/compliances.rb +325 -0
  6. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/alert_notifications.rb +16 -0
  7. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/alerts_to_admins.rb +16 -0
  8. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting.rb +75 -0
  9. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting_list.rb +100 -0
  10. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/compliance.rb +111 -0
  11. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/compliance_list.rb +99 -0
  12. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/compliance_segment.rb +60 -0
  13. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/pricing.rb +74 -0
  14. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/pricing_list.rb +99 -0
  15. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/pricing_tier.rb +16 -0
  16. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/provisioning_setting.rb +16 -0
  17. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/resource.rb +71 -0
  18. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/security_contact.rb +109 -0
  19. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/security_contact_list.rb +100 -0
  20. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting.rb +86 -0
  21. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting_list.rb +99 -0
  22. data/lib/2017-08-01-preview/generated/azure_mgmt_security/module_definition.rb +9 -0
  23. data/lib/2017-08-01-preview/generated/azure_mgmt_security/pricings.rb +822 -0
  24. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_contacts.rb +585 -0
  25. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_management_client.rb +146 -0
  26. data/lib/2017-08-01-preview/generated/azure_mgmt_security/workspace_settings.rb +588 -0
  27. data/lib/azure_mgmt_security.rb +6 -0
  28. data/lib/module_definition.rb +7 -0
  29. data/lib/profiles/latest/modules/security_profile_module.rb +133 -0
  30. data/lib/profiles/latest/security_latest_profile_client.rb +40 -0
  31. data/lib/profiles/latest/security_module_definition.rb +8 -0
  32. data/lib/version.rb +7 -0
  33. metadata +150 -0
@@ -0,0 +1,325 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ #
8
+ # API spec for Microsoft.Security (Azure Security Center) resource provider
9
+ #
10
+ class Compliances
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Compliances class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SecurityManagementClient] reference to the SecurityManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # The Compliance scores of the specific management group.
26
+ #
27
+ # @param scope [String] Scope of the query, can be subscription
28
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
29
+ # (/providers/Microsoft.Management/managementGroups/mgName).
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<Compliance>] operation results.
34
+ #
35
+ def list(scope, custom_headers:nil)
36
+ first_page = list_as_lazy(scope, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # The Compliance scores of the specific management group.
42
+ #
43
+ # @param scope [String] Scope of the query, can be subscription
44
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
45
+ # (/providers/Microsoft.Management/managementGroups/mgName).
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(scope, custom_headers:nil)
52
+ list_async(scope, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # The Compliance scores of the specific management group.
57
+ #
58
+ # @param scope [String] Scope of the query, can be subscription
59
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
60
+ # (/providers/Microsoft.Management/managementGroups/mgName).
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(scope, custom_headers:nil)
67
+ @client.api_version = '2017-08-01-preview'
68
+ fail ArgumentError, 'scope is nil' if scope.nil?
69
+
70
+
71
+ request_headers = {}
72
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
73
+
74
+ # Set Headers
75
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
+ path_template = '{scope}/providers/Microsoft.Security/compliances'
78
+
79
+ request_url = @base_url || @client.base_url
80
+
81
+ options = {
82
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
83
+ path_params: {'scope' => scope},
84
+ query_params: {'api-version' => @client.api_version},
85
+ headers: request_headers.merge(custom_headers || {}),
86
+ base_url: request_url
87
+ }
88
+ promise = @client.make_request_async(:get, path_template, options)
89
+
90
+ promise = promise.then do |result|
91
+ http_response = result.response
92
+ status_code = http_response.status
93
+ response_content = http_response.body
94
+ unless status_code == 200
95
+ error_model = JSON.load(response_content)
96
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
97
+ end
98
+
99
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::ComplianceList.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Details of a specific Compliance.
119
+ #
120
+ # @param scope [String] Scope of the query, can be subscription
121
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
122
+ # (/providers/Microsoft.Management/managementGroups/mgName).
123
+ # @param compliance_name [String] name of the Compliance
124
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
125
+ # will be added to the HTTP request.
126
+ #
127
+ # @return [Compliance] operation results.
128
+ #
129
+ def get(scope, compliance_name, custom_headers:nil)
130
+ response = get_async(scope, compliance_name, custom_headers:custom_headers).value!
131
+ response.body unless response.nil?
132
+ end
133
+
134
+ #
135
+ # Details of a specific Compliance.
136
+ #
137
+ # @param scope [String] Scope of the query, can be subscription
138
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
139
+ # (/providers/Microsoft.Management/managementGroups/mgName).
140
+ # @param compliance_name [String] name of the Compliance
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
145
+ #
146
+ def get_with_http_info(scope, compliance_name, custom_headers:nil)
147
+ get_async(scope, compliance_name, custom_headers:custom_headers).value!
148
+ end
149
+
150
+ #
151
+ # Details of a specific Compliance.
152
+ #
153
+ # @param scope [String] Scope of the query, can be subscription
154
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
155
+ # (/providers/Microsoft.Management/managementGroups/mgName).
156
+ # @param compliance_name [String] name of the Compliance
157
+ # @param [Hash{String => String}] A hash of custom headers that will be added
158
+ # to the HTTP request.
159
+ #
160
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
+ #
162
+ def get_async(scope, compliance_name, custom_headers:nil)
163
+ @client.api_version = '2017-08-01-preview'
164
+ fail ArgumentError, 'scope is nil' if scope.nil?
165
+ fail ArgumentError, 'compliance_name is nil' if compliance_name.nil?
166
+
167
+
168
+ request_headers = {}
169
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
170
+
171
+ # Set Headers
172
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
173
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
174
+ path_template = '{scope}/providers/Microsoft.Security/compliances/{complianceName}'
175
+
176
+ request_url = @base_url || @client.base_url
177
+
178
+ options = {
179
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
180
+ path_params: {'scope' => scope,'complianceName' => compliance_name},
181
+ query_params: {'api-version' => @client.api_version},
182
+ headers: request_headers.merge(custom_headers || {}),
183
+ base_url: request_url
184
+ }
185
+ promise = @client.make_request_async(:get, path_template, options)
186
+
187
+ promise = promise.then do |result|
188
+ http_response = result.response
189
+ status_code = http_response.status
190
+ response_content = http_response.body
191
+ unless status_code == 200
192
+ error_model = JSON.load(response_content)
193
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
194
+ end
195
+
196
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
197
+ # Deserialize Response
198
+ if status_code == 200
199
+ begin
200
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
201
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::Compliance.mapper()
202
+ result.body = @client.deserialize(result_mapper, parsed_response)
203
+ rescue Exception => e
204
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
205
+ end
206
+ end
207
+
208
+ result
209
+ end
210
+
211
+ promise.execute
212
+ end
213
+
214
+ #
215
+ # The Compliance scores of the specific management group.
216
+ #
217
+ # @param next_page_link [String] The NextLink from the previous successful call
218
+ # to List operation.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [ComplianceList] operation results.
223
+ #
224
+ def list_next(next_page_link, custom_headers:nil)
225
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
226
+ response.body unless response.nil?
227
+ end
228
+
229
+ #
230
+ # The Compliance scores of the specific management group.
231
+ #
232
+ # @param next_page_link [String] The NextLink from the previous successful call
233
+ # to List operation.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
238
+ #
239
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
240
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
241
+ end
242
+
243
+ #
244
+ # The Compliance scores of the specific management group.
245
+ #
246
+ # @param next_page_link [String] The NextLink from the previous successful call
247
+ # to List operation.
248
+ # @param [Hash{String => String}] A hash of custom headers that will be added
249
+ # to the HTTP request.
250
+ #
251
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
252
+ #
253
+ def list_next_async(next_page_link, custom_headers:nil)
254
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
255
+
256
+
257
+ request_headers = {}
258
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
259
+
260
+ # Set Headers
261
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
262
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
263
+ path_template = '{nextLink}'
264
+
265
+ request_url = @base_url || @client.base_url
266
+
267
+ options = {
268
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
269
+ skip_encoding_path_params: {'nextLink' => next_page_link},
270
+ headers: request_headers.merge(custom_headers || {}),
271
+ base_url: request_url
272
+ }
273
+ promise = @client.make_request_async(:get, path_template, options)
274
+
275
+ promise = promise.then do |result|
276
+ http_response = result.response
277
+ status_code = http_response.status
278
+ response_content = http_response.body
279
+ unless status_code == 200
280
+ error_model = JSON.load(response_content)
281
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
282
+ end
283
+
284
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
285
+ # Deserialize Response
286
+ if status_code == 200
287
+ begin
288
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
289
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::ComplianceList.mapper()
290
+ result.body = @client.deserialize(result_mapper, parsed_response)
291
+ rescue Exception => e
292
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
293
+ end
294
+ end
295
+
296
+ result
297
+ end
298
+
299
+ promise.execute
300
+ end
301
+
302
+ #
303
+ # The Compliance scores of the specific management group.
304
+ #
305
+ # @param scope [String] Scope of the query, can be subscription
306
+ # (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
307
+ # (/providers/Microsoft.Management/managementGroups/mgName).
308
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
309
+ # will be added to the HTTP request.
310
+ #
311
+ # @return [ComplianceList] which provide lazy access to pages of the response.
312
+ #
313
+ def list_as_lazy(scope, custom_headers:nil)
314
+ response = list_async(scope, custom_headers:custom_headers).value!
315
+ unless response.nil?
316
+ page = response.body
317
+ page.next_method = Proc.new do |next_page_link|
318
+ list_next_async(next_page_link, custom_headers:custom_headers)
319
+ end
320
+ page
321
+ end
322
+ end
323
+
324
+ end
325
+ end
@@ -0,0 +1,16 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ module Models
8
+ #
9
+ # Defines values for AlertNotifications
10
+ #
11
+ module AlertNotifications
12
+ On = "On"
13
+ Off = "Off"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ module Models
8
+ #
9
+ # Defines values for AlertsToAdmins
10
+ #
11
+ module AlertsToAdmins
12
+ On = "On"
13
+ Off = "Off"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,75 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ module Models
8
+ #
9
+ # Auto provisioning setting
10
+ #
11
+ class AutoProvisioningSetting < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [ProvisioningSetting] Describes what kind of security agent
16
+ # provisioning action to take. Possible values include: 'Automatic',
17
+ # 'Off'
18
+ attr_accessor :provisioning_setting
19
+
20
+
21
+ #
22
+ # Mapper for AutoProvisioningSetting class as Ruby Hash.
23
+ # This will be used for serialization/deserialization.
24
+ #
25
+ def self.mapper()
26
+ {
27
+ client_side_validation: true,
28
+ required: false,
29
+ serialized_name: 'AutoProvisioningSetting',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'AutoProvisioningSetting',
33
+ model_properties: {
34
+ id: {
35
+ client_side_validation: true,
36
+ required: false,
37
+ read_only: true,
38
+ serialized_name: 'id',
39
+ type: {
40
+ name: 'String'
41
+ }
42
+ },
43
+ name: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ read_only: true,
47
+ serialized_name: 'name',
48
+ type: {
49
+ name: 'String'
50
+ }
51
+ },
52
+ type: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ read_only: true,
56
+ serialized_name: 'type',
57
+ type: {
58
+ name: 'String'
59
+ }
60
+ },
61
+ provisioning_setting: {
62
+ client_side_validation: true,
63
+ required: true,
64
+ serialized_name: 'properties.provisioningSetting',
65
+ type: {
66
+ name: 'String'
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ end
73
+ end
74
+ end
75
+ end
@@ -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::Security::Mgmt::V2017_08_01_preview
7
+ module Models
8
+ #
9
+ # List of all the auto provisioning settings response
10
+ #
11
+ class AutoProvisioningSettingList
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<AutoProvisioningSetting>] List of all the auto
17
+ # provisioning settings
18
+ attr_accessor :value
19
+
20
+ # @return [String] The URI to fetch the next page.
21
+ attr_accessor :next_link
22
+
23
+ # return [Proc] with next page method call.
24
+ attr_accessor :next_method
25
+
26
+ #
27
+ # Gets the rest of the items for the request, enabling auto-pagination.
28
+ #
29
+ # @return [Array<AutoProvisioningSetting>] operation results.
30
+ #
31
+ def get_all_items
32
+ items = @value
33
+ page = self
34
+ while page.next_link != nil do
35
+ page = page.get_next_page
36
+ items.concat(page.value)
37
+ end
38
+ items
39
+ end
40
+
41
+ #
42
+ # Gets the next page of results.
43
+ #
44
+ # @return [AutoProvisioningSettingList] with next page content.
45
+ #
46
+ def get_next_page
47
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
48
+ unless response.nil?
49
+ @next_link = response.body.next_link
50
+ @value = response.body.value
51
+ self
52
+ end
53
+ end
54
+
55
+ #
56
+ # Mapper for AutoProvisioningSettingList class as Ruby Hash.
57
+ # This will be used for serialization/deserialization.
58
+ #
59
+ def self.mapper()
60
+ {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'AutoProvisioningSettingList',
64
+ type: {
65
+ name: 'Composite',
66
+ class_name: 'AutoProvisioningSettingList',
67
+ model_properties: {
68
+ value: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'value',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'AutoProvisioningSettingElementType',
78
+ type: {
79
+ name: 'Composite',
80
+ class_name: 'AutoProvisioningSetting'
81
+ }
82
+ }
83
+ }
84
+ },
85
+ next_link: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ read_only: true,
89
+ serialized_name: 'nextLink',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end