Class: Azure::Security::Mgmt::V2015_06_01_preview::Tasks

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb

Overview

API spec for Microsoft.Security (Azure Security Center) resource provider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Tasks

Creates and initializes a new instance of the Tasks class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientSecurityCenter (readonly)

Returns reference to the SecurityCenter.

Returns:



22
23
24
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 22

def client
  @client
end

Instance Method Details

#get_resource_group_level_task(resource_group_name, task_name, custom_headers: nil) ⇒ SecurityTask

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • task_name (String)

    Name of the task object, will be a GUID

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

    A hash of custom headers that

Returns:

  • (SecurityTask)

    operation results.



513
514
515
516
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 513

def get_resource_group_level_task(resource_group_name, task_name, custom_headers:nil)
  response = get_resource_group_level_task_async(resource_group_name, task_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_resource_group_level_task_async(resource_group_name, task_name, custom_headers: nil) ⇒ Concurrent::Promise

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • task_name (String)

    Name of the task object, will be a GUID

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 546

def get_resource_group_level_task_async(resource_group_name, task_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil?
  fail ArgumentError, 'task_name is nil' if task_name.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'taskName' => task_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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTask.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_resource_group_level_task_with_http_info(resource_group_name, task_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • task_name (String)

    Name of the task object, will be a GUID

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



530
531
532
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 530

def get_resource_group_level_task_with_http_info(resource_group_name, task_name, custom_headers:nil)
  get_resource_group_level_task_async(resource_group_name, task_name, custom_headers:custom_headers).value!
end

#get_subscription_level_task(task_name, custom_headers: nil) ⇒ SecurityTask

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

Parameters:

  • task_name (String)

    Name of the task object, will be a GUID

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

    A hash of custom headers that

Returns:

  • (SecurityTask)

    operation results.



221
222
223
224
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 221

def get_subscription_level_task(task_name, custom_headers:nil)
  response = get_subscription_level_task_async(task_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_subscription_level_task_async(task_name, custom_headers: nil) ⇒ Concurrent::Promise

Recommended tasks that will help improve the security of the subscription proactively

to the HTTP request.

Parameters:

  • task_name (String)

    Name of the task object, will be a GUID

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 250

def get_subscription_level_task_async(task_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
  fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil?
  fail ArgumentError, 'task_name is nil' if task_name.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 = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location,'taskName' => task_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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTask.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_subscription_level_task_with_http_info(task_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

Parameters:

  • task_name (String)

    Name of the task object, will be a GUID

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



236
237
238
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 236

def get_subscription_level_task_with_http_info(task_name, custom_headers:nil)
  get_subscription_level_task_async(task_name, custom_headers:custom_headers).value!
end

#list(filter: nil, custom_headers: nil) ⇒ Array<SecurityTask>

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (Array<SecurityTask>)

    operation results.



34
35
36
37
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 34

def list(filter:nil, custom_headers:nil)
  first_page = list_as_lazy(filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(filter: nil, custom_headers: nil) ⇒ SecurityTaskList

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

response.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (SecurityTaskList)

    which provide lazy access to pages of the



997
998
999
1000
1001
1002
1003
1004
1005
1006
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 997

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

Recommended tasks that will help improve the security of the subscription proactively

to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 63

def list_async(filter:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).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 = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version,'$filter' => filter},
      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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList.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_by_home_region(filter: nil, custom_headers: nil) ⇒ Array<SecurityTask>

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (Array<SecurityTask>)

    operation results.



127
128
129
130
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 127

def list_by_home_region(filter:nil, custom_headers:nil)
  first_page = list_by_home_region_as_lazy(filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_home_region_as_lazy(filter: nil, custom_headers: nil) ⇒ SecurityTaskList

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

response.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (SecurityTaskList)

    which provide lazy access to pages of the



1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 1019

def list_by_home_region_as_lazy(filter:nil, custom_headers:nil)
  response = list_by_home_region_async(filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_home_region_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_home_region_async(filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Recommended tasks that will help improve the security of the subscription proactively

to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
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
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 156

def list_by_home_region_async(filter:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
  fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.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 = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location},
      query_params: {'api-version' => @client.api_version,'$filter' => filter},
      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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList.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_by_home_region_next(next_page_link, custom_headers: nil) ⇒ SecurityTaskList

Recommended tasks that will help improve the security of the subscription proactively

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:

  • (SecurityTaskList)

    operation results.



811
812
813
814
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 811

def list_by_home_region_next(next_page_link, custom_headers:nil)
  response = list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_home_region_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Recommended tasks that will help improve the security of the subscription proactively

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.



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/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 842

def list_by_home_region_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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList.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_by_home_region_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

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.



827
828
829
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 827

def list_by_home_region_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_home_region_with_http_info(filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



142
143
144
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 142

def list_by_home_region_with_http_info(filter:nil, custom_headers:nil)
  list_by_home_region_async(filter:filter, custom_headers:custom_headers).value!
end

#list_by_resource_group(resource_group_name, filter: nil, custom_headers: nil) ⇒ Array<SecurityTask>

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (Array<SecurityTask>)

    operation results.



409
410
411
412
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 409

def list_by_resource_group(resource_group_name, filter:nil, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, filter: nil, custom_headers: nil) ⇒ SecurityTaskList

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (SecurityTaskList)

    which provide lazy access to pages of the



1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 1043

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

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • filter (String) (defaults to: nil)

    OData filter. Optional.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 442

def list_by_resource_group_async(resource_group_name, filter:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location},
      query_params: {'api-version' => @client.api_version,'$filter' => filter},
      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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList.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_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ SecurityTaskList

Recommended tasks that will help improve the security of the subscription proactively

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:

  • (SecurityTaskList)

    operation results.



904
905
906
907
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 904

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

Recommended tasks that will help improve the security of the subscription proactively

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.



935
936
937
938
939
940
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
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 935

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

  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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList.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_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

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.



920
921
922
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 920

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

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



426
427
428
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 426

def list_by_resource_group_with_http_info(resource_group_name, filter:nil, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, filter:filter, custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ SecurityTaskList

Recommended tasks that will help improve the security of the subscription proactively

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:

  • (SecurityTaskList)

    operation results.



718
719
720
721
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 718

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

Recommended tasks that will help improve the security of the subscription proactively

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.



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
796
797
798
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 749

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::Security::Mgmt::V2015_06_01_preview::Models::SecurityTaskList.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

Recommended tasks that will help improve the security of the subscription proactively

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.



734
735
736
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 734

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

Recommended tasks that will help improve the security of the subscription proactively

will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    OData filter. Optional.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



49
50
51
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 49

def list_with_http_info(filter:nil, custom_headers:nil)
  list_async(filter:filter, custom_headers:custom_headers).value!
end

#update_resource_group_level_task_state(resource_group_name, task_name, task_update_action_type, custom_headers: nil) ⇒ Object

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. Possible values include: ‘Activate’, ‘Dismiss’, ‘Start’, ‘Resolve’, ‘Close’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • task_name (String)

    Name of the task object, will be a GUID

  • task_update_action_type (Enum)

    Type of the action to do on the task.

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

    A hash of custom headers that



619
620
621
622
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 619

def update_resource_group_level_task_state(resource_group_name, task_name, task_update_action_type, custom_headers:nil)
  response = update_resource_group_level_task_state_async(resource_group_name, task_name, task_update_action_type, custom_headers:custom_headers).value!
  nil
end

#update_resource_group_level_task_state_async(resource_group_name, task_name, task_update_action_type, custom_headers: nil) ⇒ Concurrent::Promise

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. Possible values include: ‘Activate’, ‘Dismiss’, ‘Start’, ‘Resolve’, ‘Close’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • task_name (String)

    Name of the task object, will be a GUID

  • task_update_action_type (Enum)

    Type of the action to do on the task.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 656

def update_resource_group_level_task_state_async(resource_group_name, task_name, task_update_action_type, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil?
  fail ArgumentError, 'task_name is nil' if task_name.nil?
  fail ArgumentError, 'task_update_action_type is nil' if task_update_action_type.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'taskName' => task_name,'taskUpdateActionType' => task_update_action_type},
      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 == 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

#update_resource_group_level_task_state_with_http_info(resource_group_name, task_name, task_update_action_type, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

user’s subscription. The name is case insensitive. Possible values include: ‘Activate’, ‘Dismiss’, ‘Start’, ‘Resolve’, ‘Close’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • task_name (String)

    Name of the task object, will be a GUID

  • task_update_action_type (Enum)

    Type of the action to do on the task.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



638
639
640
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 638

def update_resource_group_level_task_state_with_http_info(resource_group_name, task_name, task_update_action_type, custom_headers:nil)
  update_resource_group_level_task_state_async(resource_group_name, task_name, task_update_action_type, custom_headers:custom_headers).value!
end

#update_subscription_level_task_state(task_name, task_update_action_type, custom_headers: nil) ⇒ Object

Recommended tasks that will help improve the security of the subscription proactively

Possible values include: ‘Activate’, ‘Dismiss’, ‘Start’, ‘Resolve’, ‘Close’ will be added to the HTTP request.

Parameters:

  • task_name (String)

    Name of the task object, will be a GUID

  • task_update_action_type (Enum)

    Type of the action to do on the task.

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

    A hash of custom headers that



317
318
319
320
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 317

def update_subscription_level_task_state(task_name, task_update_action_type, custom_headers:nil)
  response = update_subscription_level_task_state_async(task_name, task_update_action_type, custom_headers:custom_headers).value!
  nil
end

#update_subscription_level_task_state_async(task_name, task_update_action_type, custom_headers: nil) ⇒ Concurrent::Promise

Recommended tasks that will help improve the security of the subscription proactively

Possible values include: ‘Activate’, ‘Dismiss’, ‘Start’, ‘Resolve’, ‘Close’ to the HTTP request.

Parameters:

  • task_name (String)

    Name of the task object, will be a GUID

  • task_update_action_type (Enum)

    Type of the action to do on the task.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 350

def update_subscription_level_task_state_async(task_name, task_update_action_type, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
  fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil?
  fail ArgumentError, 'task_name is nil' if task_name.nil?
  fail ArgumentError, 'task_update_action_type is nil' if task_update_action_type.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 = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location,'taskName' => task_name,'taskUpdateActionType' => task_update_action_type},
      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 == 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

#update_subscription_level_task_state_with_http_info(task_name, task_update_action_type, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recommended tasks that will help improve the security of the subscription proactively

Possible values include: ‘Activate’, ‘Dismiss’, ‘Start’, ‘Resolve’, ‘Close’ will be added to the HTTP request.

Parameters:

  • task_name (String)

    Name of the task object, will be a GUID

  • task_update_action_type (Enum)

    Type of the action to do on the task.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



334
335
336
# File 'lib/2015-06-01-preview/generated/azure_mgmt_security/tasks.rb', line 334

def update_subscription_level_task_state_with_http_info(task_name, task_update_action_type, custom_headers:nil)
  update_subscription_level_task_state_async(task_name, task_update_action_type, custom_headers:custom_headers).value!
end