Class: Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Builds

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb

Overview

Builds

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Builds

Creates and initializes a new instance of the Builds class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientContainerRegistryManagementClient (readonly)

Returns reference to the ContainerRegistryManagementClient.

Returns:



22
23
24
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 22

def client
  @client
end

Instance Method Details

#begin_cancel(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ Object

Cancel an existing build.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that



578
579
580
581
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 578

def begin_cancel(resource_group_name, registry_name, build_id, custom_headers:nil)
  response = begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
  nil
end

#begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ Concurrent::Promise

Cancel an existing build.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 611

def begin_cancel_async(resource_group_name, registry_name, build_id, 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, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'build_id is nil' if build_id.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.ContainerRegistry/registries/{registryName}/builds/{buildId}/cancel'

  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,'registryName' => registry_name,'buildId' => build_id},
      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.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

#begin_cancel_with_http_info(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Cancel an existing build.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



595
596
597
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 595

def begin_cancel_with_http_info(resource_group_name, registry_name, build_id, custom_headers:nil)
  begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers: nil) ⇒ Build

Patch the build properties.

the container registry belongs. properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • build_update_parameters (BuildUpdateParameters)

    The build update

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

    A hash of custom headers that

Returns:

  • (Build)

    operation results.



453
454
455
456
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 453

def begin_update(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
  response = begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Patch the build properties.

the container registry belongs. properties. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • build_update_parameters (BuildUpdateParameters)

    The build update

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 490

def begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, 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, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'build_id is nil' if build_id.nil?
  fail ArgumentError, 'build_update_parameters is nil' if build_update_parameters.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?

  # Serialize Request
  request_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  build_update_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}'

  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,'registryName' => registry_name,'buildId' => build_id},
      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 || 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?
    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::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.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
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.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

#begin_update_with_http_info(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Patch the build properties.

the container registry belongs. properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • build_update_parameters (BuildUpdateParameters)

    The build update

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



472
473
474
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 472

def begin_update_with_http_info(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
  begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
end

#cancel(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ Object

Cancel an existing build.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that



407
408
409
410
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 407

def cancel(resource_group_name, registry_name, build_id, custom_headers:nil)
  response = cancel_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
  nil
end

#cancel_async(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ Concurrent::Promise

the container registry belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 423

def cancel_async(resource_group_name, registry_name, build_id, custom_headers:nil)
  # Send request
  promise = begin_cancel_async(resource_group_name, registry_name, build_id, custom_headers: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, registry_name, build_id, custom_headers: nil) ⇒ Build

Gets the detailed information for a given build.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that

Returns:

  • (Build)

    operation results.



151
152
153
154
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 151

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

#get_async(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ Concurrent::Promise

Gets the detailed information for a given build.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 184

def get_async(resource_group_name, registry_name, build_id, 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, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'build_id is nil' if build_id.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.ContainerRegistry/registries/{registryName}/builds/{buildId}'

  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,'registryName' => registry_name,'buildId' => build_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?
    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::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.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

Gets a link to download the build logs.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that

Returns:

  • (BuildGetLogResult)

    operation results.



305
306
307
308
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 305

def get_log_link(resource_group_name, registry_name, build_id, custom_headers:nil)
  response = get_log_link_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

Gets a link to download the build logs.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 338

def get_log_link_async(resource_group_name, registry_name, build_id, 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, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'build_id is nil' if build_id.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.ContainerRegistry/registries/{registryName}/builds/{buildId}/getLogLink'

  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,'registryName' => registry_name,'buildId' => build_id},
      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
      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::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildGetLogResult.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

Gets a link to download the build logs.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



322
323
324
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 322

def get_log_link_with_http_info(resource_group_name, registry_name, build_id, custom_headers:nil)
  get_log_link_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, registry_name, build_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the detailed information for a given build.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



168
169
170
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 168

def get_with_http_info(resource_group_name, registry_name, build_id, custom_headers:nil)
  get_async(resource_group_name, registry_name, build_id, custom_headers:custom_headers).value!
end

#list(resource_group_name, registry_name, filter: nil, top: nil, skip_token: nil, custom_headers: nil) ⇒ Array<Build>

Gets all the builds for a registry.

the container registry belongs. the maximum number of builds to return. which provides the next page in the list of builds. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • filter (String) (defaults to: nil)

    The builds filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    $top is supported for get list of builds, which limits

  • skip_token (String) (defaults to: nil)

    $skipToken is supported on get list of builds,

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

    A hash of custom headers that

Returns:

  • (Array<Build>)

    operation results.



40
41
42
43
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 40

def list(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
  first_page = list_as_lazy(resource_group_name, registry_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(resource_group_name, registry_name, filter: nil, top: nil, skip_token: nil, custom_headers: nil) ⇒ BuildListResult

Gets all the builds for a registry.

the container registry belongs. the maximum number of builds to return. which provides the next page in the list of builds. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • filter (String) (defaults to: nil)

    The builds filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    $top is supported for get list of builds, which limits

  • skip_token (String) (defaults to: nil)

    $skipToken is supported on get list of builds,

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

    A hash of custom headers that

Returns:

  • (BuildListResult)

    which provide lazy access to pages of the response.



766
767
768
769
770
771
772
773
774
775
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 766

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

Gets all the builds for a registry.

the container registry belongs. the maximum number of builds to return. which provides the next page in the list of builds. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • filter (String) (defaults to: nil)

    The builds filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    $top is supported for get list of builds, which limits

  • skip_token (String) (defaults to: nil)

    $skipToken is supported on get list of builds,

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 81

def list_async(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.ContainerRegistry/registries/{registryName}/builds'

  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,'registryName' => registry_name},
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
      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::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildListResult.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(next_page_link, custom_headers: nil) ⇒ BuildListResult

Gets all the builds for a registry.

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:

  • (BuildListResult)

    operation results.



670
671
672
673
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 670

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

Gets all the builds for a registry.

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.



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 699

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::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildListResult.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

Gets all the builds for a registry.

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.



685
686
687
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 685

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(resource_group_name, registry_name, filter: nil, top: nil, skip_token: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all the builds for a registry.

the container registry belongs. the maximum number of builds to return. which provides the next page in the list of builds. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • filter (String) (defaults to: nil)

    The builds filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    $top is supported for get list of builds, which limits

  • skip_token (String) (defaults to: nil)

    $skipToken is supported on get list of builds,

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



61
62
63
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 61

def list_with_http_info(resource_group_name, registry_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
  list_async(resource_group_name, registry_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
end

#update(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers: nil) ⇒ Build

Patch the build properties.

the container registry belongs. properties. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • build_update_parameters (BuildUpdateParameters)

    The build update

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

    A hash of custom headers that

Returns:

  • (Build)

    operation results.



257
258
259
260
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 257

def update(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
  response = update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers: nil) ⇒ Concurrent::Promise

the container registry belongs. properties. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • build_id (String)

    The build ID.

  • build_update_parameters (BuildUpdateParameters)

    The build update

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb', line 275

def update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::Build.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end