Class: Azure::ARM::Scheduler::JobCollections

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_scheduler/job_collections.rb

Overview

JobCollections

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ JobCollections

Creates and initializes a new instance of the JobCollections class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientSchedulerManagementClient (readonly)

Returns reference to the SchedulerManagementClient.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 23

def client
  @client
end

Instance Method Details

#begin_delete(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Object

Deletes a job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that



633
634
635
636
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 633

def begin_delete(resource_group_name, job_collection_name, custom_headers = nil)
  response = begin_delete_async(resource_group_name, job_collection_name, custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes a job collection.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 662

def begin_delete_async(resource_group_name, job_collection_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'job_collection_name is nil' if job_collection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # 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.Scheduler/jobCollections/{jobCollectionName}'

  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,'jobCollectionName' => job_collection_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      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
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, job_collection_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



648
649
650
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 648

def begin_delete_with_http_info(resource_group_name, job_collection_name, custom_headers = nil)
  begin_delete_async(resource_group_name, job_collection_name, custom_headers).value!
end

#begin_disable(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Object

Disables all of the jobs in the job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that



793
794
795
796
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 793

def begin_disable(resource_group_name, job_collection_name, custom_headers = nil)
  response = begin_disable_async(resource_group_name, job_collection_name, custom_headers).value!
  nil
end

#begin_disable_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

Disables all of the jobs in the job collection.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 822

def begin_disable_async(resource_group_name, job_collection_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'job_collection_name is nil' if job_collection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # 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.Scheduler/jobCollections/{jobCollectionName}/disable'

  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,'jobCollectionName' => job_collection_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      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
  end

  promise.execute
end

#begin_disable_with_http_info(resource_group_name, job_collection_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Disables all of the jobs in the job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



808
809
810
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 808

def begin_disable_with_http_info(resource_group_name, job_collection_name, custom_headers = nil)
  begin_disable_async(resource_group_name, job_collection_name, custom_headers).value!
end

#begin_enable(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Object

Enables all of the jobs in the job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that



713
714
715
716
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 713

def begin_enable(resource_group_name, job_collection_name, custom_headers = nil)
  response = begin_enable_async(resource_group_name, job_collection_name, custom_headers).value!
  nil
end

#begin_enable_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

Enables all of the jobs in the job collection.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 742

def begin_enable_async(resource_group_name, job_collection_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'job_collection_name is nil' if job_collection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # 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.Scheduler/jobCollections/{jobCollectionName}/enable'

  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,'jobCollectionName' => job_collection_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      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
  end

  promise.execute
end

#begin_enable_with_http_info(resource_group_name, job_collection_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Enables all of the jobs in the job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



728
729
730
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 728

def begin_enable_with_http_info(resource_group_name, job_collection_name, custom_headers = nil)
  begin_enable_async(resource_group_name, job_collection_name, custom_headers).value!
end

#create_or_update(resource_group_name, job_collection_name, job_collection, custom_headers = nil) ⇒ JobCollectionDefinition

Provisions a new job collection or updates an existing job collection.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • job_collection (JobCollectionDefinition)

    The job collection

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

    A hash of custom headers that

Returns:



298
299
300
301
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 298

def create_or_update(resource_group_name, job_collection_name, job_collection, custom_headers = nil)
  response = create_or_update_async(resource_group_name, job_collection_name, job_collection, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, job_collection_name, job_collection, custom_headers = nil) ⇒ Concurrent::Promise

Provisions a new job collection or updates an existing job collection.

definition. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • job_collection (JobCollectionDefinition)

    The job collection

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
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
396
397
398
399
400
401
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 331

def create_or_update_async(resource_group_name, job_collection_name, job_collection, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'job_collection_name is nil' if job_collection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'job_collection is nil' if job_collection.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = JobCollectionDefinition.mapper()
  request_content = @client.serialize(request_mapper,  job_collection, 'job_collection')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}'

  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,'jobCollectionName' => job_collection_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionDefinition.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionDefinition.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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

#create_or_update_with_http_info(resource_group_name, job_collection_name, job_collection, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Provisions a new job collection or updates an existing job collection.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • job_collection (JobCollectionDefinition)

    The job collection

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



315
316
317
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 315

def create_or_update_with_http_info(resource_group_name, job_collection_name, job_collection, custom_headers = nil)
  create_or_update_async(resource_group_name, job_collection_name, job_collection, custom_headers).value!
end

#delete(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Object

Deletes a job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that



518
519
520
521
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 518

def delete(resource_group_name, job_collection_name, custom_headers = nil)
  response = delete_async(resource_group_name, job_collection_name, custom_headers).value!
  nil
end

#delete_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 532

def delete_async(resource_group_name, job_collection_name, custom_headers = nil)
  # Send request
  promise = begin_delete_async(resource_group_name, job_collection_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#disable(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Object

Disables all of the jobs in the job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that



594
595
596
597
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 594

def disable(resource_group_name, job_collection_name, custom_headers = nil)
  response = disable_async(resource_group_name, job_collection_name, custom_headers).value!
  nil
end

#disable_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 608

def disable_async(resource_group_name, job_collection_name, custom_headers = nil)
  # Send request
  promise = begin_disable_async(resource_group_name, job_collection_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#enable(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Object

Enables all of the jobs in the job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that



556
557
558
559
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 556

def enable(resource_group_name, job_collection_name, custom_headers = nil)
  response = enable_async(resource_group_name, job_collection_name, custom_headers).value!
  nil
end

#enable_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 570

def enable_async(resource_group_name, job_collection_name, custom_headers = nil)
  # Send request
  promise = begin_enable_async(resource_group_name, job_collection_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get(resource_group_name, job_collection_name, custom_headers = nil) ⇒ JobCollectionDefinition

Gets a job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:



205
206
207
208
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 205

def get(resource_group_name, job_collection_name, custom_headers = nil)
  response = get_async(resource_group_name, job_collection_name, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, job_collection_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a job collection.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
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
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 234

def get_async(resource_group_name, job_collection_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'job_collection_name is nil' if job_collection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # 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.Scheduler/jobCollections/{jobCollectionName}'

  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,'jobCollectionName' => job_collection_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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionDefinition.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_with_http_info(resource_group_name, job_collection_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a job collection.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



220
221
222
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 220

def get_with_http_info(resource_group_name, job_collection_name, custom_headers = nil)
  get_async(resource_group_name, job_collection_name, custom_headers).value!
end

#list_by_resource_group(resource_group_name, custom_headers = nil) ⇒ Array<JobCollectionDefinition>

Gets all job collections under specified resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

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

    A hash of custom headers that

Returns:



117
118
119
120
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 117

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

#list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) ⇒ JobCollectionListResult

Gets all job collections under specified resource group.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name.

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

    A hash of custom headers that

Returns:



1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 1068

def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
  response = list_by_resource_group_async(resource_group_name, 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)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets all job collections under specified resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 144

def list_by_resource_group_async(resource_group_name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # 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.Scheduler/jobCollections'

  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},
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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) ⇒ JobCollectionListResult

Gets all job collections under specified resource group.

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:



961
962
963
964
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 961

def list_by_resource_group_next(next_page_link, custom_headers = nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all job collections under specified resource group.

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.



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 990

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 = {}

  # 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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

Gets all job collections under specified resource group.

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.



976
977
978
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 976

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).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all job collections under specified resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



131
132
133
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 131

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

#list_by_subscription(custom_headers = nil) ⇒ Array<JobCollectionDefinition>

Gets all job collections under specified subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:



33
34
35
36
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 33

def list_by_subscription(custom_headers = nil)
  first_page = list_by_subscription_as_lazy(custom_headers)
  first_page.get_all_items
end

#list_by_subscription_as_lazy(custom_headers = nil) ⇒ JobCollectionListResult

Gets all job collections under specified subscription.

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 1047

def list_by_subscription_as_lazy(custom_headers = nil)
  response = list_by_subscription_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_subscription_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_by_subscription_async(custom_headers = nil) ⇒ Concurrent::Promise

Gets all job collections under specified subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



58
59
60
61
62
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
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 58

def list_by_subscription_async(custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # 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.Scheduler/jobCollections'

  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},
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_subscription_next(next_page_link, custom_headers = nil) ⇒ JobCollectionListResult

Gets all job collections under specified subscription.

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:



874
875
876
877
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 874

def list_by_subscription_next(next_page_link, custom_headers = nil)
  response = list_by_subscription_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all job collections under specified subscription.

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.



903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 903

def list_by_subscription_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_subscription_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all job collections under specified subscription.

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.



889
890
891
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 889

def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_subscription_next_async(next_page_link, custom_headers).value!
end

#list_by_subscription_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all job collections under specified subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



46
47
48
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 46

def list_by_subscription_with_http_info(custom_headers = nil)
  list_by_subscription_async(custom_headers).value!
end

#patch(resource_group_name, job_collection_name, job_collection, custom_headers = nil) ⇒ JobCollectionDefinition

Patches an existing job collection.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • job_collection (JobCollectionDefinition)

    The job collection

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

    A hash of custom headers that

Returns:



415
416
417
418
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 415

def patch(resource_group_name, job_collection_name, job_collection, custom_headers = nil)
  response = patch_async(resource_group_name, job_collection_name, job_collection, custom_headers).value!
  response.body unless response.nil?
end

#patch_async(resource_group_name, job_collection_name, job_collection, custom_headers = nil) ⇒ Concurrent::Promise

Patches an existing job collection.

definition. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • job_collection (JobCollectionDefinition)

    The job collection

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
500
501
502
503
504
505
506
507
508
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 448

def patch_async(resource_group_name, job_collection_name, job_collection, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'job_collection_name is nil' if job_collection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'job_collection is nil' if job_collection.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = JobCollectionDefinition.mapper()
  request_content = @client.serialize(request_mapper,  job_collection, 'job_collection')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}'

  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,'jobCollectionName' => job_collection_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = JobCollectionDefinition.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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

#patch_with_http_info(resource_group_name, job_collection_name, job_collection, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Patches an existing job collection.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • job_collection_name (String)

    The job collection name.

  • job_collection (JobCollectionDefinition)

    The job collection

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



432
433
434
# File 'lib/generated/azure_mgmt_scheduler/job_collections.rb', line 432

def patch_with_http_info(resource_group_name, job_collection_name, job_collection, custom_headers = nil)
  patch_async(resource_group_name, job_collection_name, job_collection, custom_headers).value!
end