azure_mgmt_container_registry 0.18.4 → 0.18.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-06-27-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  3. data/lib/2017-03-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  4. data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  5. data/lib/2017-10-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  6. data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  7. data/lib/2018-09-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  8. data/lib/2019-04-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  9. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry.rb +11 -7
  10. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  11. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/active_directory_object.rb +62 -0
  12. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/created_by_type.rb +18 -0
  13. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/generate_credentials_parameters.rb +2 -4
  14. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/last_modified_by_type.rb +18 -0
  15. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +14 -0
  16. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/scope_map.rb +12 -2
  17. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/system_data.rb +105 -0
  18. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token.rb +12 -14
  19. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_credentials_properties.rb +12 -0
  20. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_password.rb +2 -2
  21. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/{status.rb → token_status.rb} +2 -2
  22. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_update_parameters.rb +2 -2
  23. data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/scope_maps.rb +4 -4
  24. data/lib/2019-05-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
  25. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_service_specification_definition.rb +1 -1
  26. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/quarantine_policy.rb +3 -1
  27. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/retention_policy.rb +6 -3
  28. data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/trust_policy.rb +5 -2
  29. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry.rb +37 -22
  30. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/agent_pools.rb +958 -0
  31. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +9 -1
  32. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool.rb +157 -0
  33. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_list_result.rb +99 -0
  34. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_queue_status.rb +46 -0
  35. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_update_parameters.rb +65 -0
  36. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/created_by_type.rb +18 -0
  37. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_request.rb +16 -0
  38. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/encoded_task_run_request.rb +16 -0
  39. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/error_response.rb +48 -0
  40. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/error_response_body.rb +81 -0
  41. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_run_request.rb +16 -0
  42. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/inner_error_description.rb +68 -0
  43. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/last_modified_by_type.rb +18 -0
  44. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +14 -0
  45. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/resource.rb +14 -0
  46. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run.rb +34 -0
  47. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_filter.rb +12 -0
  48. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_get_log_result.rb +12 -0
  49. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_request.rb +23 -0
  50. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/system_data.rb +105 -0
  51. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task.rb +48 -2
  52. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run.rb +149 -0
  53. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_list_result.rb +99 -0
  54. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_request.rb +16 -0
  55. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_update_parameters.rb +103 -0
  56. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_update_parameters.rb +23 -0
  57. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/registries.rb +2 -2
  58. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/runs.rb +6 -6
  59. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/task_runs.rb +953 -0
  60. data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/tasks.rb +7 -7
  61. data/lib/azure_mgmt_container_registry.rb +5 -5
  62. data/lib/profiles/latest/modules/containerregistry_profile_module.rb +211 -83
  63. data/lib/version.rb +1 -1
  64. metadata +23 -4
@@ -13,6 +13,9 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
13
13
 
14
14
  include MsRestAzure
15
15
 
16
+ # @return [ActiveDirectoryObject]
17
+ attr_accessor :active_directory_object
18
+
16
19
  # @return [Array<TokenCertificate>]
17
20
  attr_accessor :certificates
18
21
 
@@ -33,6 +36,15 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
33
36
  name: 'Composite',
34
37
  class_name: 'TokenCredentialsProperties',
35
38
  model_properties: {
39
+ active_directory_object: {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'activeDirectoryObject',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'ActiveDirectoryObject'
46
+ }
47
+ },
36
48
  certificates: {
37
49
  client_side_validation: true,
38
50
  required: false,
@@ -13,13 +13,13 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
13
13
 
14
14
  include MsRestAzure
15
15
 
16
- # @return [DateTime] The password created datetime of the password.
16
+ # @return [DateTime] The creation datetime of the password.
17
17
  attr_accessor :creation_time
18
18
 
19
19
  # @return [DateTime] The expiry datetime of the password.
20
20
  attr_accessor :expiry
21
21
 
22
- # @return [TokenPasswordName] The password name "password" or
22
+ # @return [TokenPasswordName] The password name "password1" or
23
23
  # "password2". Possible values include: 'password1', 'password2'
24
24
  attr_accessor :name
25
25
 
@@ -6,9 +6,9 @@
6
6
  module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
7
7
  module Models
8
8
  #
9
- # Defines values for Status
9
+ # Defines values for TokenStatus
10
10
  #
11
- module Status
11
+ module TokenStatus
12
12
  Enabled = "enabled"
13
13
  Disabled = "disabled"
14
14
  end
@@ -16,8 +16,8 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
16
16
  # will be associated with.
17
17
  attr_accessor :scope_map_id
18
18
 
19
- # @return [Status] The status of the token example enabled or disabled.
20
- # Possible values include: 'enabled', 'disabled'
19
+ # @return [TokenStatus] The status of the token example enabled or
20
+ # disabled. Possible values include: 'enabled', 'disabled'
21
21
  attr_accessor :status
22
22
 
23
23
  # @return [TokenCredentialsProperties] The credentials that can be used
@@ -78,7 +78,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
78
78
  fail ArgumentError, 'scope_map_name is nil' if scope_map_name.nil?
79
79
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MaxLength': '50'" if !scope_map_name.nil? && scope_map_name.length > 50
80
80
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MinLength': '5'" if !scope_map_name.nil? && scope_map_name.length < 5
81
- fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
81
+ fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-_]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-_]*$$')).nil?
82
82
 
83
83
 
84
84
  request_headers = {}
@@ -435,7 +435,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
435
435
  fail ArgumentError, 'scope_map_name is nil' if scope_map_name.nil?
436
436
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MaxLength': '50'" if !scope_map_name.nil? && scope_map_name.length > 50
437
437
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MinLength': '5'" if !scope_map_name.nil? && scope_map_name.length < 5
438
- fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
438
+ fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-_]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-_]*$$')).nil?
439
439
  fail ArgumentError, 'scope_map_create_parameters is nil' if scope_map_create_parameters.nil?
440
440
 
441
441
 
@@ -560,7 +560,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
560
560
  fail ArgumentError, 'scope_map_name is nil' if scope_map_name.nil?
561
561
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MaxLength': '50'" if !scope_map_name.nil? && scope_map_name.length > 50
562
562
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MinLength': '5'" if !scope_map_name.nil? && scope_map_name.length < 5
563
- fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
563
+ fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-_]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-_]*$$')).nil?
564
564
 
565
565
 
566
566
  request_headers = {}
@@ -664,7 +664,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01_preview
664
664
  fail ArgumentError, 'scope_map_name is nil' if scope_map_name.nil?
665
665
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MaxLength': '50'" if !scope_map_name.nil? && scope_map_name.length > 50
666
666
  fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'MinLength': '5'" if !scope_map_name.nil? && scope_map_name.length < 5
667
- fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
667
+ fail ArgumentError, "'scope_map_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-_]*$'" if !scope_map_name.nil? && scope_map_name.match(Regexp.new('^^[a-zA-Z0-9-_]*$$')).nil?
668
668
  fail ArgumentError, 'scope_map_update_parameters is nil' if scope_map_update_parameters.nil?
669
669
 
670
670
 
@@ -136,7 +136,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
136
136
  #
137
137
  def add_telemetry
138
138
  sdk_information = 'azure_mgmt_container_registry'
139
- sdk_information = "#{sdk_information}/0.18.4"
139
+ sdk_information = "#{sdk_information}/0.18.5"
140
140
  add_user_agent_information(sdk_information)
141
141
  end
142
142
  end
@@ -6,7 +6,7 @@
6
6
  module Azure::ContainerRegistry::Mgmt::V2019_05_01
7
7
  module Models
8
8
  #
9
- # The definition of Azure Monitoring metrics list.
9
+ # The definition of Azure Monitoring list.
10
10
  #
11
11
  class OperationServiceSpecificationDefinition
12
12
 
@@ -13,7 +13,8 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
13
13
  include MsRestAzure
14
14
 
15
15
  # @return [PolicyStatus] The value that indicates whether the policy is
16
- # enabled or not. Possible values include: 'enabled', 'disabled'
16
+ # enabled or not. Possible values include: 'enabled', 'disabled'. Default
17
+ # value: 'disabled' .
17
18
  attr_accessor :status
18
19
 
19
20
 
@@ -34,6 +35,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
34
35
  client_side_validation: true,
35
36
  required: false,
36
37
  serialized_name: 'status',
38
+ default_value: 'disabled',
37
39
  type: {
38
40
  name: 'String'
39
41
  }
@@ -12,15 +12,16 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [Integer] The number of days to retain manifest before it
16
- # expires.
15
+ # @return [Integer] The number of days to retain an untagged manifest
16
+ # after which it gets purged. Default value: 7 .
17
17
  attr_accessor :days
18
18
 
19
19
  # @return [DateTime] The timestamp when the policy was last updated.
20
20
  attr_accessor :last_updated_time
21
21
 
22
22
  # @return [PolicyStatus] The value that indicates whether the policy is
23
- # enabled or not. Possible values include: 'enabled', 'disabled'
23
+ # enabled or not. Possible values include: 'enabled', 'disabled'. Default
24
+ # value: 'disabled' .
24
25
  attr_accessor :status
25
26
 
26
27
 
@@ -41,6 +42,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
41
42
  client_side_validation: true,
42
43
  required: false,
43
44
  serialized_name: 'days',
45
+ default_value: 7,
44
46
  type: {
45
47
  name: 'Number'
46
48
  }
@@ -58,6 +60,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
58
60
  client_side_validation: true,
59
61
  required: false,
60
62
  serialized_name: 'status',
63
+ default_value: 'disabled',
61
64
  type: {
62
65
  name: 'String'
63
66
  }
@@ -13,11 +13,12 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
13
13
  include MsRestAzure
14
14
 
15
15
  # @return [TrustPolicyType] The type of trust policy. Possible values
16
- # include: 'Notary'
16
+ # include: 'Notary'. Default value: 'Notary' .
17
17
  attr_accessor :type
18
18
 
19
19
  # @return [PolicyStatus] The value that indicates whether the policy is
20
- # enabled or not. Possible values include: 'enabled', 'disabled'
20
+ # enabled or not. Possible values include: 'enabled', 'disabled'. Default
21
+ # value: 'disabled' .
21
22
  attr_accessor :status
22
23
 
23
24
 
@@ -38,6 +39,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
38
39
  client_side_validation: true,
39
40
  required: false,
40
41
  serialized_name: 'type',
42
+ default_value: 'Notary',
41
43
  type: {
42
44
  name: 'String'
43
45
  }
@@ -46,6 +48,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_05_01
46
48
  client_side_validation: true,
47
49
  required: false,
48
50
  serialized_name: 'status',
51
+ default_value: 'disabled',
49
52
  type: {
50
53
  name: 'String'
51
54
  }
@@ -20,54 +20,67 @@ require '2019-06-01-preview/generated/azure_mgmt_container_registry/module_defin
20
20
  require 'ms_rest_azure'
21
21
 
22
22
  module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
23
+ autoload :AgentPools, '2019-06-01-preview/generated/azure_mgmt_container_registry/agent_pools.rb'
23
24
  autoload :Registries, '2019-06-01-preview/generated/azure_mgmt_container_registry/registries.rb'
24
25
  autoload :Runs, '2019-06-01-preview/generated/azure_mgmt_container_registry/runs.rb'
26
+ autoload :TaskRuns, '2019-06-01-preview/generated/azure_mgmt_container_registry/task_runs.rb'
25
27
  autoload :Tasks, '2019-06-01-preview/generated/azure_mgmt_container_registry/tasks.rb'
26
28
  autoload :ContainerRegistryManagementClient, '2019-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb'
27
29
 
28
30
  module Models
29
- autoload :Credentials, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/credentials.rb'
31
+ autoload :CustomRegistryCredentials, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/custom_registry_credentials.rb'
32
+ autoload :AuthInfo, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/auth_info.rb'
33
+ autoload :SourceProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_properties.rb'
34
+ autoload :AgentPoolListResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_list_result.rb'
35
+ autoload :SourceTrigger, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger.rb'
36
+ autoload :RunRequest, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_request.rb'
30
37
  autoload :BaseImageTrigger, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger.rb'
31
- autoload :TriggerProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/trigger_properties.rb'
32
38
  autoload :ImageUpdateTrigger, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/image_update_trigger.rb'
33
- autoload :SourceRegistryCredentials, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_registry_credentials.rb'
39
+ autoload :TriggerProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/trigger_properties.rb'
34
40
  autoload :TimerTriggerDescriptor, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger_descriptor.rb'
35
- autoload :SecretObject, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/secret_object.rb'
41
+ autoload :SourceRegistryCredentials, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_registry_credentials.rb'
36
42
  autoload :AgentProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_properties.rb'
37
- autoload :CustomRegistryCredentials, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/custom_registry_credentials.rb'
43
+ autoload :SecretObject, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/secret_object.rb'
38
44
  autoload :SourceUploadDefinition, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_upload_definition.rb'
39
- autoload :RunRequest, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_request.rb'
45
+ autoload :SetValue, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/set_value.rb'
40
46
  autoload :RunFilter, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_filter.rb'
47
+ autoload :Credentials, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/credentials.rb'
41
48
  autoload :RunGetLogResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_get_log_result.rb'
42
- autoload :TaskListResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_list_result.rb'
49
+ autoload :Argument, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/argument.rb'
43
50
  autoload :IdentityProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/identity_properties.rb'
51
+ autoload :TaskListResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_list_result.rb'
52
+ autoload :TaskRunUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_update_parameters.rb'
44
53
  autoload :PlatformUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/platform_update_parameters.rb'
45
- autoload :TaskStepProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_step_properties.rb'
54
+ autoload :BaseImageDependency, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency.rb'
46
55
  autoload :TaskStepUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_step_update_parameters.rb'
47
- autoload :AuthInfo, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/auth_info.rb'
56
+ autoload :TimerTrigger, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger.rb'
48
57
  autoload :TimerTriggerUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger_update_parameters.rb'
49
- autoload :SourceTrigger, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger.rb'
58
+ autoload :AgentPoolQueueStatus, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_queue_status.rb'
50
59
  autoload :AuthInfoUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/auth_info_update_parameters.rb'
51
60
  autoload :SourceTriggerDescriptor, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger_descriptor.rb'
52
61
  autoload :SourceUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_update_parameters.rb'
53
- autoload :SetValue, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/set_value.rb'
54
- autoload :RunListResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_list_result.rb'
55
62
  autoload :SourceTriggerUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger_update_parameters.rb'
56
- autoload :UserIdentityProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/user_identity_properties.rb'
63
+ autoload :RunUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_update_parameters.rb'
57
64
  autoload :BaseImageTriggerUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger_update_parameters.rb'
58
- autoload :TimerTrigger, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger.rb'
65
+ autoload :OverrideTaskStepProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/override_task_step_properties.rb'
59
66
  autoload :TriggerUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/trigger_update_parameters.rb'
60
- autoload :ImageDescriptor, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/image_descriptor.rb'
67
+ autoload :TaskStepProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_step_properties.rb'
61
68
  autoload :TaskUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_update_parameters.rb'
62
- autoload :RunUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_update_parameters.rb'
69
+ autoload :ImageDescriptor, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/image_descriptor.rb'
70
+ autoload :SystemData, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/system_data.rb'
71
+ autoload :RunListResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_list_result.rb'
63
72
  autoload :Resource, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/resource.rb'
64
- autoload :SourceProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_properties.rb'
73
+ autoload :TaskRunListResult, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_list_result.rb'
65
74
  autoload :ProxyResource, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb'
66
- autoload :BaseImageDependency, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency.rb'
67
- autoload :Argument, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/argument.rb'
68
75
  autoload :PlatformProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/platform_properties.rb'
69
- autoload :OverrideTaskStepProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/override_task_step_properties.rb'
76
+ autoload :InnerErrorDescription, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/inner_error_description.rb'
77
+ autoload :AgentPoolUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool_update_parameters.rb'
78
+ autoload :ErrorResponseBody, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/error_response_body.rb'
79
+ autoload :UserIdentityProperties, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/user_identity_properties.rb'
80
+ autoload :ErrorResponse, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/error_response.rb'
81
+ autoload :AgentPool, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_pool.rb'
70
82
  autoload :Run, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run.rb'
83
+ autoload :TaskRun, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run.rb'
71
84
  autoload :Task, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task.rb'
72
85
  autoload :DockerBuildRequest, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_request.rb'
73
86
  autoload :FileTaskRunRequest, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_run_request.rb'
@@ -79,12 +92,12 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
79
92
  autoload :DockerBuildStepUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step_update_parameters.rb'
80
93
  autoload :FileTaskStepUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_step_update_parameters.rb'
81
94
  autoload :EncodedTaskStepUpdateParameters, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/encoded_task_step_update_parameters.rb'
95
+ autoload :OS, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/os.rb'
96
+ autoload :ProvisioningState, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/provisioning_state.rb'
82
97
  autoload :RunStatus, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_status.rb'
83
98
  autoload :RunType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_type.rb'
84
- autoload :OS, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/os.rb'
85
99
  autoload :Architecture, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/architecture.rb'
86
100
  autoload :Variant, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/variant.rb'
87
- autoload :ProvisioningState, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/provisioning_state.rb'
88
101
  autoload :ResourceIdentityType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/resource_identity_type.rb'
89
102
  autoload :TaskStatus, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_status.rb'
90
103
  autoload :BaseImageDependencyType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency_type.rb'
@@ -96,5 +109,7 @@ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
96
109
  autoload :UpdateTriggerPayloadType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/update_trigger_payload_type.rb'
97
110
  autoload :SourceRegistryLoginMode, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_registry_login_mode.rb'
98
111
  autoload :SecretObjectType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/secret_object_type.rb'
112
+ autoload :CreatedByType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/created_by_type.rb'
113
+ autoload :LastModifiedByType, '2019-06-01-preview/generated/azure_mgmt_container_registry/models/last_modified_by_type.rb'
99
114
  end
100
115
  end
@@ -0,0 +1,958 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ContainerRegistry::Mgmt::V2019_06_01_preview
7
+ #
8
+ # AgentPools
9
+ #
10
+ class AgentPools
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AgentPools class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the detailed information for a given agent pool.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group to which
28
+ # the container registry belongs.
29
+ # @param registry_name [String] The name of the container registry.
30
+ # @param agent_pool_name [String] The name of the agent pool.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [AgentPool] operation results.
35
+ #
36
+ def get(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
37
+ response = get_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Gets the detailed information for a given agent pool.
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group to which
45
+ # the container registry belongs.
46
+ # @param registry_name [String] The name of the container registry.
47
+ # @param agent_pool_name [String] The name of the agent pool.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def get_with_http_info(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
54
+ get_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets the detailed information for a given agent pool.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group to which
61
+ # the container registry belongs.
62
+ # @param registry_name [String] The name of the container registry.
63
+ # @param agent_pool_name [String] The name of the agent pool.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def get_async(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
73
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
74
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
75
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
76
+ 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?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+ fail ArgumentError, 'agent_pool_name is nil' if agent_pool_name.nil?
79
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MaxLength': '20'" if !agent_pool_name.nil? && agent_pool_name.length > 20
80
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MinLength': '3'" if !agent_pool_name.nil? && agent_pool_name.length < 3
81
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !agent_pool_name.nil? && agent_pool_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
82
+
83
+
84
+ request_headers = {}
85
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
86
+
87
+ # Set Headers
88
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
89
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
90
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'agentPoolName' => agent_pool_name},
97
+ query_params: {'api-version' => @client.api_version},
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:get, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
114
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Creates an agent pool for a container registry with the specified parameters.
134
+ #
135
+ # @param resource_group_name [String] The name of the resource group to which
136
+ # the container registry belongs.
137
+ # @param registry_name [String] The name of the container registry.
138
+ # @param agent_pool_name [String] The name of the agent pool.
139
+ # @param agent_pool [AgentPool] The parameters of an agent pool that needs to
140
+ # scheduled.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [AgentPool] operation results.
145
+ #
146
+ def create(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:nil)
147
+ response = create_async(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:custom_headers).value!
148
+ response.body unless response.nil?
149
+ end
150
+
151
+ #
152
+ # @param resource_group_name [String] The name of the resource group to which
153
+ # the container registry belongs.
154
+ # @param registry_name [String] The name of the container registry.
155
+ # @param agent_pool_name [String] The name of the agent pool.
156
+ # @param agent_pool [AgentPool] The parameters of an agent pool that needs to
157
+ # scheduled.
158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
+ # will be added to the HTTP request.
160
+ #
161
+ # @return [Concurrent::Promise] promise which provides async access to http
162
+ # response.
163
+ #
164
+ def create_async(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:nil)
165
+ # Send request
166
+ promise = begin_create_async(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:custom_headers)
167
+
168
+ promise = promise.then do |response|
169
+ # Defining deserialization method.
170
+ deserialize_method = lambda do |parsed_response|
171
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
172
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
173
+ end
174
+
175
+ # Waiting for response.
176
+ @client.get_long_running_operation_result(response, deserialize_method)
177
+ end
178
+
179
+ promise
180
+ end
181
+
182
+ #
183
+ # Deletes a specified agent pool resource.
184
+ #
185
+ # @param resource_group_name [String] The name of the resource group to which
186
+ # the container registry belongs.
187
+ # @param registry_name [String] The name of the container registry.
188
+ # @param agent_pool_name [String] The name of the agent pool.
189
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
190
+ # will be added to the HTTP request.
191
+ #
192
+ def delete(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
193
+ response = delete_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
194
+ nil
195
+ end
196
+
197
+ #
198
+ # @param resource_group_name [String] The name of the resource group to which
199
+ # the container registry belongs.
200
+ # @param registry_name [String] The name of the container registry.
201
+ # @param agent_pool_name [String] The name of the agent pool.
202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
203
+ # will be added to the HTTP request.
204
+ #
205
+ # @return [Concurrent::Promise] promise which provides async access to http
206
+ # response.
207
+ #
208
+ def delete_async(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
209
+ # Send request
210
+ promise = begin_delete_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers)
211
+
212
+ promise = promise.then do |response|
213
+ # Defining deserialization method.
214
+ deserialize_method = lambda do |parsed_response|
215
+ end
216
+
217
+ # Waiting for response.
218
+ @client.get_long_running_operation_result(response, deserialize_method)
219
+ end
220
+
221
+ promise
222
+ end
223
+
224
+ #
225
+ # Updates an agent pool with the specified parameters.
226
+ #
227
+ # @param resource_group_name [String] The name of the resource group to which
228
+ # the container registry belongs.
229
+ # @param registry_name [String] The name of the container registry.
230
+ # @param agent_pool_name [String] The name of the agent pool.
231
+ # @param update_parameters [AgentPoolUpdateParameters] The parameters for
232
+ # updating an agent pool.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [AgentPool] operation results.
237
+ #
238
+ def update(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:nil)
239
+ response = update_async(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:custom_headers).value!
240
+ response.body unless response.nil?
241
+ end
242
+
243
+ #
244
+ # @param resource_group_name [String] The name of the resource group to which
245
+ # the container registry belongs.
246
+ # @param registry_name [String] The name of the container registry.
247
+ # @param agent_pool_name [String] The name of the agent pool.
248
+ # @param update_parameters [AgentPoolUpdateParameters] The parameters for
249
+ # updating an agent pool.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] promise which provides async access to http
254
+ # response.
255
+ #
256
+ def update_async(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:nil)
257
+ # Send request
258
+ promise = begin_update_async(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:custom_headers)
259
+
260
+ promise = promise.then do |response|
261
+ # Defining deserialization method.
262
+ deserialize_method = lambda do |parsed_response|
263
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
264
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
265
+ end
266
+
267
+ # Waiting for response.
268
+ @client.get_long_running_operation_result(response, deserialize_method)
269
+ end
270
+
271
+ promise
272
+ end
273
+
274
+ #
275
+ # Lists all the agent pools for a specified container registry.
276
+ #
277
+ # @param resource_group_name [String] The name of the resource group to which
278
+ # the container registry belongs.
279
+ # @param registry_name [String] The name of the container registry.
280
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
281
+ # will be added to the HTTP request.
282
+ #
283
+ # @return [Array<AgentPool>] operation results.
284
+ #
285
+ def list(resource_group_name, registry_name, custom_headers:nil)
286
+ first_page = list_as_lazy(resource_group_name, registry_name, custom_headers:custom_headers)
287
+ first_page.get_all_items
288
+ end
289
+
290
+ #
291
+ # Lists all the agent pools for a specified container registry.
292
+ #
293
+ # @param resource_group_name [String] The name of the resource group to which
294
+ # the container registry belongs.
295
+ # @param registry_name [String] The name of the container registry.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
300
+ #
301
+ def list_with_http_info(resource_group_name, registry_name, custom_headers:nil)
302
+ list_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Lists all the agent pools for a specified container registry.
307
+ #
308
+ # @param resource_group_name [String] The name of the resource group to which
309
+ # the container registry belongs.
310
+ # @param registry_name [String] The name of the container registry.
311
+ # @param [Hash{String => String}] A hash of custom headers that will be added
312
+ # to the HTTP request.
313
+ #
314
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
315
+ #
316
+ def list_async(resource_group_name, registry_name, custom_headers:nil)
317
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
318
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
319
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
320
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
321
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
322
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
323
+ 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?
324
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
325
+
326
+
327
+ request_headers = {}
328
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
329
+
330
+ # Set Headers
331
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
332
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
333
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools'
334
+
335
+ request_url = @base_url || @client.base_url
336
+
337
+ options = {
338
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
339
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
340
+ query_params: {'api-version' => @client.api_version},
341
+ headers: request_headers.merge(custom_headers || {}),
342
+ base_url: request_url
343
+ }
344
+ promise = @client.make_request_async(:get, path_template, options)
345
+
346
+ promise = promise.then do |result|
347
+ http_response = result.response
348
+ status_code = http_response.status
349
+ response_content = http_response.body
350
+ unless status_code == 200
351
+ error_model = JSON.load(response_content)
352
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
353
+ end
354
+
355
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
356
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
357
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
358
+ # Deserialize Response
359
+ if status_code == 200
360
+ begin
361
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
362
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPoolListResult.mapper()
363
+ result.body = @client.deserialize(result_mapper, parsed_response)
364
+ rescue Exception => e
365
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
366
+ end
367
+ end
368
+
369
+ result
370
+ end
371
+
372
+ promise.execute
373
+ end
374
+
375
+ #
376
+ # Gets the count of queued runs for a given agent pool.
377
+ #
378
+ # @param resource_group_name [String] The name of the resource group to which
379
+ # the container registry belongs.
380
+ # @param registry_name [String] The name of the container registry.
381
+ # @param agent_pool_name [String] The name of the agent pool.
382
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
383
+ # will be added to the HTTP request.
384
+ #
385
+ # @return [AgentPoolQueueStatus] operation results.
386
+ #
387
+ def get_queue_status(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
388
+ response = get_queue_status_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
389
+ response.body unless response.nil?
390
+ end
391
+
392
+ #
393
+ # Gets the count of queued runs for a given agent pool.
394
+ #
395
+ # @param resource_group_name [String] The name of the resource group to which
396
+ # the container registry belongs.
397
+ # @param registry_name [String] The name of the container registry.
398
+ # @param agent_pool_name [String] The name of the agent pool.
399
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
400
+ # will be added to the HTTP request.
401
+ #
402
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
403
+ #
404
+ def get_queue_status_with_http_info(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
405
+ get_queue_status_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
406
+ end
407
+
408
+ #
409
+ # Gets the count of queued runs for a given agent pool.
410
+ #
411
+ # @param resource_group_name [String] The name of the resource group to which
412
+ # the container registry belongs.
413
+ # @param registry_name [String] The name of the container registry.
414
+ # @param agent_pool_name [String] The name of the agent pool.
415
+ # @param [Hash{String => String}] A hash of custom headers that will be added
416
+ # to the HTTP request.
417
+ #
418
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
419
+ #
420
+ def get_queue_status_async(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
421
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
422
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
423
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
424
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
425
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
426
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
427
+ 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?
428
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
429
+ fail ArgumentError, 'agent_pool_name is nil' if agent_pool_name.nil?
430
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MaxLength': '20'" if !agent_pool_name.nil? && agent_pool_name.length > 20
431
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MinLength': '3'" if !agent_pool_name.nil? && agent_pool_name.length < 3
432
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !agent_pool_name.nil? && agent_pool_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
433
+
434
+
435
+ request_headers = {}
436
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
437
+
438
+ # Set Headers
439
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
440
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
441
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus'
442
+
443
+ request_url = @base_url || @client.base_url
444
+
445
+ options = {
446
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
447
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'agentPoolName' => agent_pool_name},
448
+ query_params: {'api-version' => @client.api_version},
449
+ headers: request_headers.merge(custom_headers || {}),
450
+ base_url: request_url
451
+ }
452
+ promise = @client.make_request_async(:post, path_template, options)
453
+
454
+ promise = promise.then do |result|
455
+ http_response = result.response
456
+ status_code = http_response.status
457
+ response_content = http_response.body
458
+ unless status_code == 200
459
+ error_model = JSON.load(response_content)
460
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
461
+ end
462
+
463
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
464
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
465
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
466
+ # Deserialize Response
467
+ if status_code == 200
468
+ begin
469
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
470
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPoolQueueStatus.mapper()
471
+ result.body = @client.deserialize(result_mapper, parsed_response)
472
+ rescue Exception => e
473
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
474
+ end
475
+ end
476
+
477
+ result
478
+ end
479
+
480
+ promise.execute
481
+ end
482
+
483
+ #
484
+ # Creates an agent pool for a container registry with the specified parameters.
485
+ #
486
+ # @param resource_group_name [String] The name of the resource group to which
487
+ # the container registry belongs.
488
+ # @param registry_name [String] The name of the container registry.
489
+ # @param agent_pool_name [String] The name of the agent pool.
490
+ # @param agent_pool [AgentPool] The parameters of an agent pool that needs to
491
+ # scheduled.
492
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
493
+ # will be added to the HTTP request.
494
+ #
495
+ # @return [AgentPool] operation results.
496
+ #
497
+ def begin_create(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:nil)
498
+ response = begin_create_async(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:custom_headers).value!
499
+ response.body unless response.nil?
500
+ end
501
+
502
+ #
503
+ # Creates an agent pool for a container registry with the specified parameters.
504
+ #
505
+ # @param resource_group_name [String] The name of the resource group to which
506
+ # the container registry belongs.
507
+ # @param registry_name [String] The name of the container registry.
508
+ # @param agent_pool_name [String] The name of the agent pool.
509
+ # @param agent_pool [AgentPool] The parameters of an agent pool that needs to
510
+ # scheduled.
511
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
512
+ # will be added to the HTTP request.
513
+ #
514
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
515
+ #
516
+ def begin_create_with_http_info(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:nil)
517
+ begin_create_async(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:custom_headers).value!
518
+ end
519
+
520
+ #
521
+ # Creates an agent pool for a container registry with the specified parameters.
522
+ #
523
+ # @param resource_group_name [String] The name of the resource group to which
524
+ # the container registry belongs.
525
+ # @param registry_name [String] The name of the container registry.
526
+ # @param agent_pool_name [String] The name of the agent pool.
527
+ # @param agent_pool [AgentPool] The parameters of an agent pool that needs to
528
+ # scheduled.
529
+ # @param [Hash{String => String}] A hash of custom headers that will be added
530
+ # to the HTTP request.
531
+ #
532
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
533
+ #
534
+ def begin_create_async(resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers:nil)
535
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
536
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
537
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
538
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
539
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
540
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
541
+ 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?
542
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
543
+ fail ArgumentError, 'agent_pool_name is nil' if agent_pool_name.nil?
544
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MaxLength': '20'" if !agent_pool_name.nil? && agent_pool_name.length > 20
545
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MinLength': '3'" if !agent_pool_name.nil? && agent_pool_name.length < 3
546
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !agent_pool_name.nil? && agent_pool_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
547
+ fail ArgumentError, 'agent_pool is nil' if agent_pool.nil?
548
+
549
+
550
+ request_headers = {}
551
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
552
+
553
+ # Set Headers
554
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
555
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
556
+
557
+ # Serialize Request
558
+ request_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
559
+ request_content = @client.serialize(request_mapper, agent_pool)
560
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
561
+
562
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'
563
+
564
+ request_url = @base_url || @client.base_url
565
+
566
+ options = {
567
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
568
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'agentPoolName' => agent_pool_name},
569
+ query_params: {'api-version' => @client.api_version},
570
+ body: request_content,
571
+ headers: request_headers.merge(custom_headers || {}),
572
+ base_url: request_url
573
+ }
574
+ promise = @client.make_request_async(:put, path_template, options)
575
+
576
+ promise = promise.then do |result|
577
+ http_response = result.response
578
+ status_code = http_response.status
579
+ response_content = http_response.body
580
+ unless status_code == 200 || status_code == 201
581
+ error_model = JSON.load(response_content)
582
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
583
+ end
584
+
585
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
586
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
587
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
588
+ # Deserialize Response
589
+ if status_code == 200
590
+ begin
591
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
592
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
593
+ result.body = @client.deserialize(result_mapper, parsed_response)
594
+ rescue Exception => e
595
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
596
+ end
597
+ end
598
+ # Deserialize Response
599
+ if status_code == 201
600
+ begin
601
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
602
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
603
+ result.body = @client.deserialize(result_mapper, parsed_response)
604
+ rescue Exception => e
605
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
606
+ end
607
+ end
608
+
609
+ result
610
+ end
611
+
612
+ promise.execute
613
+ end
614
+
615
+ #
616
+ # Deletes a specified agent pool resource.
617
+ #
618
+ # @param resource_group_name [String] The name of the resource group to which
619
+ # the container registry belongs.
620
+ # @param registry_name [String] The name of the container registry.
621
+ # @param agent_pool_name [String] The name of the agent pool.
622
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
623
+ # will be added to the HTTP request.
624
+ #
625
+ #
626
+ def begin_delete(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
627
+ response = begin_delete_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
628
+ nil
629
+ end
630
+
631
+ #
632
+ # Deletes a specified agent pool resource.
633
+ #
634
+ # @param resource_group_name [String] The name of the resource group to which
635
+ # the container registry belongs.
636
+ # @param registry_name [String] The name of the container registry.
637
+ # @param agent_pool_name [String] The name of the agent pool.
638
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
639
+ # will be added to the HTTP request.
640
+ #
641
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
642
+ #
643
+ def begin_delete_with_http_info(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
644
+ begin_delete_async(resource_group_name, registry_name, agent_pool_name, custom_headers:custom_headers).value!
645
+ end
646
+
647
+ #
648
+ # Deletes a specified agent pool resource.
649
+ #
650
+ # @param resource_group_name [String] The name of the resource group to which
651
+ # the container registry belongs.
652
+ # @param registry_name [String] The name of the container registry.
653
+ # @param agent_pool_name [String] The name of the agent pool.
654
+ # @param [Hash{String => String}] A hash of custom headers that will be added
655
+ # to the HTTP request.
656
+ #
657
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
658
+ #
659
+ def begin_delete_async(resource_group_name, registry_name, agent_pool_name, custom_headers:nil)
660
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
661
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
662
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
663
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
664
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
665
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
666
+ 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?
667
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
668
+ fail ArgumentError, 'agent_pool_name is nil' if agent_pool_name.nil?
669
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MaxLength': '20'" if !agent_pool_name.nil? && agent_pool_name.length > 20
670
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MinLength': '3'" if !agent_pool_name.nil? && agent_pool_name.length < 3
671
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !agent_pool_name.nil? && agent_pool_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
672
+
673
+
674
+ request_headers = {}
675
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
676
+
677
+ # Set Headers
678
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
679
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
680
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'
681
+
682
+ request_url = @base_url || @client.base_url
683
+
684
+ options = {
685
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
686
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'agentPoolName' => agent_pool_name},
687
+ query_params: {'api-version' => @client.api_version},
688
+ headers: request_headers.merge(custom_headers || {}),
689
+ base_url: request_url
690
+ }
691
+ promise = @client.make_request_async(:delete, path_template, options)
692
+
693
+ promise = promise.then do |result|
694
+ http_response = result.response
695
+ status_code = http_response.status
696
+ response_content = http_response.body
697
+ unless status_code == 200 || status_code == 202 || status_code == 204
698
+ error_model = JSON.load(response_content)
699
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
700
+ end
701
+
702
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
703
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
704
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
705
+
706
+ result
707
+ end
708
+
709
+ promise.execute
710
+ end
711
+
712
+ #
713
+ # Updates an agent pool with the specified parameters.
714
+ #
715
+ # @param resource_group_name [String] The name of the resource group to which
716
+ # the container registry belongs.
717
+ # @param registry_name [String] The name of the container registry.
718
+ # @param agent_pool_name [String] The name of the agent pool.
719
+ # @param update_parameters [AgentPoolUpdateParameters] The parameters for
720
+ # updating an agent pool.
721
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
722
+ # will be added to the HTTP request.
723
+ #
724
+ # @return [AgentPool] operation results.
725
+ #
726
+ def begin_update(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:nil)
727
+ response = begin_update_async(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:custom_headers).value!
728
+ response.body unless response.nil?
729
+ end
730
+
731
+ #
732
+ # Updates an agent pool with the specified parameters.
733
+ #
734
+ # @param resource_group_name [String] The name of the resource group to which
735
+ # the container registry belongs.
736
+ # @param registry_name [String] The name of the container registry.
737
+ # @param agent_pool_name [String] The name of the agent pool.
738
+ # @param update_parameters [AgentPoolUpdateParameters] The parameters for
739
+ # updating an agent pool.
740
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
741
+ # will be added to the HTTP request.
742
+ #
743
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
744
+ #
745
+ def begin_update_with_http_info(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:nil)
746
+ begin_update_async(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:custom_headers).value!
747
+ end
748
+
749
+ #
750
+ # Updates an agent pool with the specified parameters.
751
+ #
752
+ # @param resource_group_name [String] The name of the resource group to which
753
+ # the container registry belongs.
754
+ # @param registry_name [String] The name of the container registry.
755
+ # @param agent_pool_name [String] The name of the agent pool.
756
+ # @param update_parameters [AgentPoolUpdateParameters] The parameters for
757
+ # updating an agent pool.
758
+ # @param [Hash{String => String}] A hash of custom headers that will be added
759
+ # to the HTTP request.
760
+ #
761
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
762
+ #
763
+ def begin_update_async(resource_group_name, registry_name, agent_pool_name, update_parameters, custom_headers:nil)
764
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
765
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
766
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
767
+ fail ArgumentError, 'registry_name is nil' if registry_name.nil?
768
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
769
+ fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
770
+ 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?
771
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
772
+ fail ArgumentError, 'agent_pool_name is nil' if agent_pool_name.nil?
773
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MaxLength': '20'" if !agent_pool_name.nil? && agent_pool_name.length > 20
774
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'MinLength': '3'" if !agent_pool_name.nil? && agent_pool_name.length < 3
775
+ fail ArgumentError, "'agent_pool_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]*$'" if !agent_pool_name.nil? && agent_pool_name.match(Regexp.new('^^[a-zA-Z0-9-]*$$')).nil?
776
+ fail ArgumentError, 'update_parameters is nil' if update_parameters.nil?
777
+
778
+
779
+ request_headers = {}
780
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
781
+
782
+ # Set Headers
783
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
784
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
785
+
786
+ # Serialize Request
787
+ request_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPoolUpdateParameters.mapper()
788
+ request_content = @client.serialize(request_mapper, update_parameters)
789
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
790
+
791
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'
792
+
793
+ request_url = @base_url || @client.base_url
794
+
795
+ options = {
796
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
797
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'agentPoolName' => agent_pool_name},
798
+ query_params: {'api-version' => @client.api_version},
799
+ body: request_content,
800
+ headers: request_headers.merge(custom_headers || {}),
801
+ base_url: request_url
802
+ }
803
+ promise = @client.make_request_async(:patch, path_template, options)
804
+
805
+ promise = promise.then do |result|
806
+ http_response = result.response
807
+ status_code = http_response.status
808
+ response_content = http_response.body
809
+ unless status_code == 200 || status_code == 201
810
+ error_model = JSON.load(response_content)
811
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
812
+ end
813
+
814
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
815
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
816
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
817
+ # Deserialize Response
818
+ if status_code == 200
819
+ begin
820
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
821
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
822
+ result.body = @client.deserialize(result_mapper, parsed_response)
823
+ rescue Exception => e
824
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
825
+ end
826
+ end
827
+ # Deserialize Response
828
+ if status_code == 201
829
+ begin
830
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
831
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPool.mapper()
832
+ result.body = @client.deserialize(result_mapper, parsed_response)
833
+ rescue Exception => e
834
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
835
+ end
836
+ end
837
+
838
+ result
839
+ end
840
+
841
+ promise.execute
842
+ end
843
+
844
+ #
845
+ # Lists all the agent pools for a specified container registry.
846
+ #
847
+ # @param next_page_link [String] The NextLink from the previous successful call
848
+ # to List operation.
849
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
850
+ # will be added to the HTTP request.
851
+ #
852
+ # @return [AgentPoolListResult] operation results.
853
+ #
854
+ def list_next(next_page_link, custom_headers:nil)
855
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
856
+ response.body unless response.nil?
857
+ end
858
+
859
+ #
860
+ # Lists all the agent pools for a specified container registry.
861
+ #
862
+ # @param next_page_link [String] The NextLink from the previous successful call
863
+ # to List operation.
864
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
865
+ # will be added to the HTTP request.
866
+ #
867
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
868
+ #
869
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
870
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
871
+ end
872
+
873
+ #
874
+ # Lists all the agent pools for a specified container registry.
875
+ #
876
+ # @param next_page_link [String] The NextLink from the previous successful call
877
+ # to List operation.
878
+ # @param [Hash{String => String}] A hash of custom headers that will be added
879
+ # to the HTTP request.
880
+ #
881
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
882
+ #
883
+ def list_next_async(next_page_link, custom_headers:nil)
884
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
885
+
886
+
887
+ request_headers = {}
888
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
889
+
890
+ # Set Headers
891
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
892
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
893
+ path_template = '{nextLink}'
894
+
895
+ request_url = @base_url || @client.base_url
896
+
897
+ options = {
898
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
899
+ skip_encoding_path_params: {'nextLink' => next_page_link},
900
+ headers: request_headers.merge(custom_headers || {}),
901
+ base_url: request_url
902
+ }
903
+ promise = @client.make_request_async(:get, path_template, options)
904
+
905
+ promise = promise.then do |result|
906
+ http_response = result.response
907
+ status_code = http_response.status
908
+ response_content = http_response.body
909
+ unless status_code == 200
910
+ error_model = JSON.load(response_content)
911
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
912
+ end
913
+
914
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
915
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
916
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
917
+ # Deserialize Response
918
+ if status_code == 200
919
+ begin
920
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
921
+ result_mapper = Azure::ContainerRegistry::Mgmt::V2019_06_01_preview::Models::AgentPoolListResult.mapper()
922
+ result.body = @client.deserialize(result_mapper, parsed_response)
923
+ rescue Exception => e
924
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
925
+ end
926
+ end
927
+
928
+ result
929
+ end
930
+
931
+ promise.execute
932
+ end
933
+
934
+ #
935
+ # Lists all the agent pools for a specified container registry.
936
+ #
937
+ # @param resource_group_name [String] The name of the resource group to which
938
+ # the container registry belongs.
939
+ # @param registry_name [String] The name of the container registry.
940
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
941
+ # will be added to the HTTP request.
942
+ #
943
+ # @return [AgentPoolListResult] which provide lazy access to pages of the
944
+ # response.
945
+ #
946
+ def list_as_lazy(resource_group_name, registry_name, custom_headers:nil)
947
+ response = list_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
948
+ unless response.nil?
949
+ page = response.body
950
+ page.next_method = Proc.new do |next_page_link|
951
+ list_next_async(next_page_link, custom_headers:custom_headers)
952
+ end
953
+ page
954
+ end
955
+ end
956
+
957
+ end
958
+ end