azure_mgmt_batch 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-12-01/generated/azure_mgmt_batch/application_operations.rb +39 -37
  3. data/lib/2015-12-01/generated/azure_mgmt_batch/application_package_operations.rb +24 -22
  4. data/lib/2015-12-01/generated/azure_mgmt_batch/batch_account_operations.rb +80 -75
  5. data/lib/2015-12-01/generated/azure_mgmt_batch/batch_management_client.rb +4 -1
  6. data/lib/2015-12-01/generated/azure_mgmt_batch/location.rb +6 -5
  7. data/lib/2017-01-01/generated/azure_mgmt_batch.rb +52 -0
  8. data/lib/2017-01-01/generated/azure_mgmt_batch/application_operations.rb +657 -0
  9. data/lib/2017-01-01/generated/azure_mgmt_batch/application_package_operations.rb +445 -0
  10. data/lib/2017-01-01/generated/azure_mgmt_batch/batch_account_operations.rb +1281 -0
  11. data/lib/2017-01-01/generated/azure_mgmt_batch/batch_management_client.rb +143 -0
  12. data/lib/2017-01-01/generated/azure_mgmt_batch/location.rb +116 -0
  13. data/lib/2017-01-01/generated/azure_mgmt_batch/models/account_key_type.rb +16 -0
  14. data/lib/2017-01-01/generated/azure_mgmt_batch/models/activate_application_package_parameters.rb +47 -0
  15. data/lib/2017-01-01/generated/azure_mgmt_batch/models/add_application_parameters.rb +58 -0
  16. data/lib/2017-01-01/generated/azure_mgmt_batch/models/application.rb +103 -0
  17. data/lib/2017-01-01/generated/azure_mgmt_batch/models/application_package.rb +125 -0
  18. data/lib/2017-01-01/generated/azure_mgmt_batch/models/auto_storage_base_properties.rb +47 -0
  19. data/lib/2017-01-01/generated/azure_mgmt_batch/models/auto_storage_properties.rb +60 -0
  20. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_account.rb +196 -0
  21. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_account_create_parameters.rb +110 -0
  22. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_account_keys.rb +59 -0
  23. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_account_list_result.rb +99 -0
  24. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb +48 -0
  25. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_account_update_parameters.rb +68 -0
  26. data/lib/2017-01-01/generated/azure_mgmt_batch/models/batch_location_quota.rb +48 -0
  27. data/lib/2017-01-01/generated/azure_mgmt_batch/models/key_vault_reference.rb +59 -0
  28. data/lib/2017-01-01/generated/azure_mgmt_batch/models/list_applications_result.rb +98 -0
  29. data/lib/2017-01-01/generated/azure_mgmt_batch/models/package_state.rb +17 -0
  30. data/lib/2017-01-01/generated/azure_mgmt_batch/models/pool_allocation_mode.rb +16 -0
  31. data/lib/2017-01-01/generated/azure_mgmt_batch/models/provisioning_state.rb +20 -0
  32. data/lib/2017-01-01/generated/azure_mgmt_batch/models/resource.rb +103 -0
  33. data/lib/2017-01-01/generated/azure_mgmt_batch/models/update_application_parameters.rb +70 -0
  34. data/lib/2017-01-01/generated/azure_mgmt_batch/module_definition.rb +9 -0
  35. data/lib/2017-05-01/generated/azure_mgmt_batch/application_operations.rb +39 -37
  36. data/lib/2017-05-01/generated/azure_mgmt_batch/application_package_operations.rb +24 -22
  37. data/lib/2017-05-01/generated/azure_mgmt_batch/batch_account_operations.rb +80 -75
  38. data/lib/2017-05-01/generated/azure_mgmt_batch/batch_management_client.rb +4 -1
  39. data/lib/2017-05-01/generated/azure_mgmt_batch/location.rb +12 -12
  40. data/lib/2017-05-01/generated/azure_mgmt_batch/operations.rb +15 -13
  41. data/lib/2017-09-01/generated/azure_mgmt_batch.rb +113 -0
  42. data/lib/2017-09-01/generated/azure_mgmt_batch/application_operations.rb +655 -0
  43. data/lib/2017-09-01/generated/azure_mgmt_batch/application_package_operations.rb +441 -0
  44. data/lib/2017-09-01/generated/azure_mgmt_batch/batch_account_operations.rb +1273 -0
  45. data/lib/2017-09-01/generated/azure_mgmt_batch/batch_management_client.rb +155 -0
  46. data/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb +1009 -0
  47. data/lib/2017-09-01/generated/azure_mgmt_batch/location.rb +221 -0
  48. data/lib/2017-09-01/generated/azure_mgmt_batch/models/account_key_type.rb +16 -0
  49. data/lib/2017-09-01/generated/azure_mgmt_batch/models/activate_application_package_parameters.rb +46 -0
  50. data/lib/2017-09-01/generated/azure_mgmt_batch/models/allocation_state.rb +17 -0
  51. data/lib/2017-09-01/generated/azure_mgmt_batch/models/application.rb +103 -0
  52. data/lib/2017-09-01/generated/azure_mgmt_batch/models/application_create_parameters.rb +58 -0
  53. data/lib/2017-09-01/generated/azure_mgmt_batch/models/application_package.rb +125 -0
  54. data/lib/2017-09-01/generated/azure_mgmt_batch/models/application_package_reference.rb +64 -0
  55. data/lib/2017-09-01/generated/azure_mgmt_batch/models/application_update_parameters.rb +70 -0
  56. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_scale_run.rb +74 -0
  57. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_scale_run_error.rb +80 -0
  58. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_scale_settings.rb +61 -0
  59. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_storage_base_properties.rb +47 -0
  60. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_storage_properties.rb +56 -0
  61. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_user_scope.rb +16 -0
  62. data/lib/2017-09-01/generated/azure_mgmt_batch/models/auto_user_specification.rb +69 -0
  63. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_account.rb +208 -0
  64. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_account_create_parameters.rb +110 -0
  65. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_account_keys.rb +71 -0
  66. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_account_list_result.rb +99 -0
  67. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb +48 -0
  68. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_account_update_parameters.rb +68 -0
  69. data/lib/2017-09-01/generated/azure_mgmt_batch/models/batch_location_quota.rb +48 -0
  70. data/lib/2017-09-01/generated/azure_mgmt_batch/models/caching_type.rb +17 -0
  71. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate.rb +205 -0
  72. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_base_properties.rb +75 -0
  73. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_create_or_update_parameters.rb +135 -0
  74. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_format.rb +16 -0
  75. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_provisioning_state.rb +17 -0
  76. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_reference.rb +120 -0
  77. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_store_location.rb +16 -0
  78. data/lib/2017-09-01/generated/azure_mgmt_batch/models/certificate_visibility.rb +17 -0
  79. data/lib/2017-09-01/generated/azure_mgmt_batch/models/check_name_availability_parameters.rb +61 -0
  80. data/lib/2017-09-01/generated/azure_mgmt_batch/models/check_name_availability_result.rb +78 -0
  81. data/lib/2017-09-01/generated/azure_mgmt_batch/models/cloud_service_configuration.rb +83 -0
  82. data/lib/2017-09-01/generated/azure_mgmt_batch/models/compute_node_deallocation_option.rb +18 -0
  83. data/lib/2017-09-01/generated/azure_mgmt_batch/models/compute_node_fill_type.rb +16 -0
  84. data/lib/2017-09-01/generated/azure_mgmt_batch/models/data_disk.rb +101 -0
  85. data/lib/2017-09-01/generated/azure_mgmt_batch/models/delete_certificate_error.rb +92 -0
  86. data/lib/2017-09-01/generated/azure_mgmt_batch/models/deployment_configuration.rb +66 -0
  87. data/lib/2017-09-01/generated/azure_mgmt_batch/models/elevation_level.rb +16 -0
  88. data/lib/2017-09-01/generated/azure_mgmt_batch/models/environment_setting.rb +58 -0
  89. data/lib/2017-09-01/generated/azure_mgmt_batch/models/fixed_scale_settings.rb +93 -0
  90. data/lib/2017-09-01/generated/azure_mgmt_batch/models/image_reference.rb +108 -0
  91. data/lib/2017-09-01/generated/azure_mgmt_batch/models/inbound_endpoint_protocol.rb +16 -0
  92. data/lib/2017-09-01/generated/azure_mgmt_batch/models/inbound_nat_pool.rb +141 -0
  93. data/lib/2017-09-01/generated/azure_mgmt_batch/models/inter_node_communication_state.rb +16 -0
  94. data/lib/2017-09-01/generated/azure_mgmt_batch/models/key_vault_reference.rb +59 -0
  95. data/lib/2017-09-01/generated/azure_mgmt_batch/models/linux_user_configuration.rb +81 -0
  96. data/lib/2017-09-01/generated/azure_mgmt_batch/models/list_applications_result.rb +98 -0
  97. data/lib/2017-09-01/generated/azure_mgmt_batch/models/list_certificates_result.rb +98 -0
  98. data/lib/2017-09-01/generated/azure_mgmt_batch/models/list_pools_result.rb +98 -0
  99. data/lib/2017-09-01/generated/azure_mgmt_batch/models/metadata_item.rb +60 -0
  100. data/lib/2017-09-01/generated/azure_mgmt_batch/models/name_availability_reason.rb +16 -0
  101. data/lib/2017-09-01/generated/azure_mgmt_batch/models/network_configuration.rb +86 -0
  102. data/lib/2017-09-01/generated/azure_mgmt_batch/models/network_security_group_rule.rb +82 -0
  103. data/lib/2017-09-01/generated/azure_mgmt_batch/models/network_security_group_rule_access.rb +16 -0
  104. data/lib/2017-09-01/generated/azure_mgmt_batch/models/operation.rb +82 -0
  105. data/lib/2017-09-01/generated/azure_mgmt_batch/models/operation_display.rb +81 -0
  106. data/lib/2017-09-01/generated/azure_mgmt_batch/models/operation_list_result.rb +98 -0
  107. data/lib/2017-09-01/generated/azure_mgmt_batch/models/osdisk.rb +52 -0
  108. data/lib/2017-09-01/generated/azure_mgmt_batch/models/package_state.rb +17 -0
  109. data/lib/2017-09-01/generated/azure_mgmt_batch/models/pool.rb +474 -0
  110. data/lib/2017-09-01/generated/azure_mgmt_batch/models/pool_allocation_mode.rb +16 -0
  111. data/lib/2017-09-01/generated/azure_mgmt_batch/models/pool_endpoint_configuration.rb +60 -0
  112. data/lib/2017-09-01/generated/azure_mgmt_batch/models/pool_provisioning_state.rb +16 -0
  113. data/lib/2017-09-01/generated/azure_mgmt_batch/models/provisioning_state.rb +20 -0
  114. data/lib/2017-09-01/generated/azure_mgmt_batch/models/proxy_resource.rb +84 -0
  115. data/lib/2017-09-01/generated/azure_mgmt_batch/models/resize_error.rb +80 -0
  116. data/lib/2017-09-01/generated/azure_mgmt_batch/models/resize_operation_status.rb +127 -0
  117. data/lib/2017-09-01/generated/azure_mgmt_batch/models/resource.rb +103 -0
  118. data/lib/2017-09-01/generated/azure_mgmt_batch/models/resource_file.rb +79 -0
  119. data/lib/2017-09-01/generated/azure_mgmt_batch/models/scale_settings.rb +69 -0
  120. data/lib/2017-09-01/generated/azure_mgmt_batch/models/start_task.rb +151 -0
  121. data/lib/2017-09-01/generated/azure_mgmt_batch/models/storage_account_type.rb +16 -0
  122. data/lib/2017-09-01/generated/azure_mgmt_batch/models/task_scheduling_policy.rb +49 -0
  123. data/lib/2017-09-01/generated/azure_mgmt_batch/models/user_account.rb +89 -0
  124. data/lib/2017-09-01/generated/azure_mgmt_batch/models/user_identity.rb +64 -0
  125. data/lib/2017-09-01/generated/azure_mgmt_batch/models/virtual_machine_configuration.rb +138 -0
  126. data/lib/2017-09-01/generated/azure_mgmt_batch/models/windows_configuration.rb +48 -0
  127. data/lib/2017-09-01/generated/azure_mgmt_batch/module_definition.rb +9 -0
  128. data/lib/2017-09-01/generated/azure_mgmt_batch/operations.rb +215 -0
  129. data/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb +1132 -0
  130. data/lib/azure_mgmt_batch.rb +2 -0
  131. data/lib/profiles/latest/batch_latest_profile_client.rb +28 -9
  132. data/lib/profiles/latest/batch_module_definition.rb +0 -1
  133. data/lib/profiles/latest/modules/batch_profile_module.rb +357 -126
  134. data/lib/version.rb +1 -1
  135. metadata +119 -2
@@ -0,0 +1,445 @@
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::Batch::Mgmt::V2017_01_01
7
+ #
8
+ # ApplicationPackageOperations
9
+ #
10
+ class ApplicationPackageOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ApplicationPackageOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [BatchManagementClient] reference to the BatchManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Activates the specified application package.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group that
28
+ # contains the Batch account.
29
+ # @param account_name [String] The name of the Batch account.
30
+ # @param application_id [String] The ID of the application.
31
+ # @param version [String] The version of the application to activate.
32
+ # @param parameters [ActivateApplicationPackageParameters] The parameters for
33
+ # the request.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ #
38
+ def activate(resource_group_name, account_name, application_id, version, parameters, custom_headers:nil)
39
+ response = activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers:custom_headers).value!
40
+ nil
41
+ end
42
+
43
+ #
44
+ # Activates the specified application package.
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group that
47
+ # contains the Batch account.
48
+ # @param account_name [String] The name of the Batch account.
49
+ # @param application_id [String] The ID of the application.
50
+ # @param version [String] The version of the application to activate.
51
+ # @param parameters [ActivateApplicationPackageParameters] The parameters for
52
+ # the request.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
+ #
58
+ def activate_with_http_info(resource_group_name, account_name, application_id, version, parameters, custom_headers:nil)
59
+ activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers:custom_headers).value!
60
+ end
61
+
62
+ #
63
+ # Activates the specified application package.
64
+ #
65
+ # @param resource_group_name [String] The name of the resource group that
66
+ # contains the Batch account.
67
+ # @param account_name [String] The name of the Batch account.
68
+ # @param application_id [String] The ID of the application.
69
+ # @param version [String] The version of the application to activate.
70
+ # @param parameters [ActivateApplicationPackageParameters] The parameters for
71
+ # the request.
72
+ # @param [Hash{String => String}] A hash of custom headers that will be added
73
+ # to the HTTP request.
74
+ #
75
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
76
+ #
77
+ def activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers:nil)
78
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
80
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
81
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
82
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
83
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
84
+ fail ArgumentError, 'application_id is nil' if application_id.nil?
85
+ fail ArgumentError, 'version is nil' if version.nil?
86
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
87
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+
90
+
91
+ request_headers = {}
92
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
93
+
94
+ # Set Headers
95
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
96
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
97
+
98
+ # Serialize Request
99
+ request_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::ActivateApplicationPackageParameters.mapper()
100
+ request_content = @client.serialize(request_mapper, parameters)
101
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
102
+
103
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}/activate'
104
+
105
+ request_url = @base_url || @client.base_url
106
+
107
+ options = {
108
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
109
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
110
+ query_params: {'api-version' => @client.api_version},
111
+ body: request_content,
112
+ headers: request_headers.merge(custom_headers || {}),
113
+ base_url: request_url
114
+ }
115
+ promise = @client.make_request_async(:post, path_template, options)
116
+
117
+ promise = promise.then do |result|
118
+ http_response = result.response
119
+ status_code = http_response.status
120
+ response_content = http_response.body
121
+ unless status_code == 204
122
+ error_model = JSON.load(response_content)
123
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
124
+ end
125
+
126
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
127
+
128
+ result
129
+ end
130
+
131
+ promise.execute
132
+ end
133
+
134
+ #
135
+ # Creates an application package record.
136
+ #
137
+ # @param resource_group_name [String] The name of the resource group that
138
+ # contains the Batch account.
139
+ # @param account_name [String] The name of the Batch account.
140
+ # @param application_id [String] The ID of the application.
141
+ # @param version [String] The version of the application.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [ApplicationPackage] operation results.
146
+ #
147
+ def create(resource_group_name, account_name, application_id, version, custom_headers:nil)
148
+ response = create_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
149
+ response.body unless response.nil?
150
+ end
151
+
152
+ #
153
+ # Creates an application package record.
154
+ #
155
+ # @param resource_group_name [String] The name of the resource group that
156
+ # contains the Batch account.
157
+ # @param account_name [String] The name of the Batch account.
158
+ # @param application_id [String] The ID of the application.
159
+ # @param version [String] The version of the application.
160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
161
+ # will be added to the HTTP request.
162
+ #
163
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
164
+ #
165
+ def create_with_http_info(resource_group_name, account_name, application_id, version, custom_headers:nil)
166
+ create_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
167
+ end
168
+
169
+ #
170
+ # Creates an application package record.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group that
173
+ # contains the Batch account.
174
+ # @param account_name [String] The name of the Batch account.
175
+ # @param application_id [String] The ID of the application.
176
+ # @param version [String] The version of the application.
177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
178
+ # to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
181
+ #
182
+ def create_async(resource_group_name, account_name, application_id, version, custom_headers:nil)
183
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
184
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
185
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
186
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
187
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
188
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
189
+ fail ArgumentError, 'application_id is nil' if application_id.nil?
190
+ fail ArgumentError, 'version is nil' if version.nil?
191
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
192
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
193
+
194
+
195
+ request_headers = {}
196
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
197
+
198
+ # Set Headers
199
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
200
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
201
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
202
+
203
+ request_url = @base_url || @client.base_url
204
+
205
+ options = {
206
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
207
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
208
+ query_params: {'api-version' => @client.api_version},
209
+ headers: request_headers.merge(custom_headers || {}),
210
+ base_url: request_url
211
+ }
212
+ promise = @client.make_request_async(:put, path_template, options)
213
+
214
+ promise = promise.then do |result|
215
+ http_response = result.response
216
+ status_code = http_response.status
217
+ response_content = http_response.body
218
+ unless status_code == 201
219
+ error_model = JSON.load(response_content)
220
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
221
+ end
222
+
223
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
224
+ # Deserialize Response
225
+ if status_code == 201
226
+ begin
227
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
228
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::ApplicationPackage.mapper()
229
+ result.body = @client.deserialize(result_mapper, parsed_response)
230
+ rescue Exception => e
231
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
232
+ end
233
+ end
234
+
235
+ result
236
+ end
237
+
238
+ promise.execute
239
+ end
240
+
241
+ #
242
+ # Deletes an application package record and its associated binary file.
243
+ #
244
+ # @param resource_group_name [String] The name of the resource group that
245
+ # contains the Batch account.
246
+ # @param account_name [String] The name of the Batch account.
247
+ # @param application_id [String] The ID of the application.
248
+ # @param version [String] The version of the application to delete.
249
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
250
+ # will be added to the HTTP request.
251
+ #
252
+ #
253
+ def delete(resource_group_name, account_name, application_id, version, custom_headers:nil)
254
+ response = delete_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
255
+ nil
256
+ end
257
+
258
+ #
259
+ # Deletes an application package record and its associated binary file.
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group that
262
+ # contains the Batch account.
263
+ # @param account_name [String] The name of the Batch account.
264
+ # @param application_id [String] The ID of the application.
265
+ # @param version [String] The version of the application to delete.
266
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
+ # will be added to the HTTP request.
268
+ #
269
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
270
+ #
271
+ def delete_with_http_info(resource_group_name, account_name, application_id, version, custom_headers:nil)
272
+ delete_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
273
+ end
274
+
275
+ #
276
+ # Deletes an application package record and its associated binary file.
277
+ #
278
+ # @param resource_group_name [String] The name of the resource group that
279
+ # contains the Batch account.
280
+ # @param account_name [String] The name of the Batch account.
281
+ # @param application_id [String] The ID of the application.
282
+ # @param version [String] The version of the application to delete.
283
+ # @param [Hash{String => String}] A hash of custom headers that will be added
284
+ # to the HTTP request.
285
+ #
286
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
287
+ #
288
+ def delete_async(resource_group_name, account_name, application_id, version, custom_headers:nil)
289
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
290
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
291
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
292
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
293
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
294
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
295
+ fail ArgumentError, 'application_id is nil' if application_id.nil?
296
+ fail ArgumentError, 'version is nil' if version.nil?
297
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
298
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
299
+
300
+
301
+ request_headers = {}
302
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
303
+
304
+ # Set Headers
305
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
306
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
307
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
308
+
309
+ request_url = @base_url || @client.base_url
310
+
311
+ options = {
312
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
313
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
314
+ query_params: {'api-version' => @client.api_version},
315
+ headers: request_headers.merge(custom_headers || {}),
316
+ base_url: request_url
317
+ }
318
+ promise = @client.make_request_async(:delete, path_template, options)
319
+
320
+ promise = promise.then do |result|
321
+ http_response = result.response
322
+ status_code = http_response.status
323
+ response_content = http_response.body
324
+ unless status_code == 204
325
+ error_model = JSON.load(response_content)
326
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
327
+ end
328
+
329
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
330
+
331
+ result
332
+ end
333
+
334
+ promise.execute
335
+ end
336
+
337
+ #
338
+ # Gets information about the specified application package.
339
+ #
340
+ # @param resource_group_name [String] The name of the resource group that
341
+ # contains the Batch account.
342
+ # @param account_name [String] The name of the Batch account.
343
+ # @param application_id [String] The ID of the application.
344
+ # @param version [String] The version of the application.
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [ApplicationPackage] operation results.
349
+ #
350
+ def get(resource_group_name, account_name, application_id, version, custom_headers:nil)
351
+ response = get_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
352
+ response.body unless response.nil?
353
+ end
354
+
355
+ #
356
+ # Gets information about the specified application package.
357
+ #
358
+ # @param resource_group_name [String] The name of the resource group that
359
+ # contains the Batch account.
360
+ # @param account_name [String] The name of the Batch account.
361
+ # @param application_id [String] The ID of the application.
362
+ # @param version [String] The version of the application.
363
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
364
+ # will be added to the HTTP request.
365
+ #
366
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
367
+ #
368
+ def get_with_http_info(resource_group_name, account_name, application_id, version, custom_headers:nil)
369
+ get_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
370
+ end
371
+
372
+ #
373
+ # Gets information about the specified application package.
374
+ #
375
+ # @param resource_group_name [String] The name of the resource group that
376
+ # contains the Batch account.
377
+ # @param account_name [String] The name of the Batch account.
378
+ # @param application_id [String] The ID of the application.
379
+ # @param version [String] The version of the application.
380
+ # @param [Hash{String => String}] A hash of custom headers that will be added
381
+ # to the HTTP request.
382
+ #
383
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
384
+ #
385
+ def get_async(resource_group_name, account_name, application_id, version, custom_headers:nil)
386
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
387
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
388
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
389
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
390
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
391
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
392
+ fail ArgumentError, 'application_id is nil' if application_id.nil?
393
+ fail ArgumentError, 'version is nil' if version.nil?
394
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
395
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
396
+
397
+
398
+ request_headers = {}
399
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
400
+
401
+ # Set Headers
402
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
403
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
404
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
405
+
406
+ request_url = @base_url || @client.base_url
407
+
408
+ options = {
409
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
410
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
411
+ query_params: {'api-version' => @client.api_version},
412
+ headers: request_headers.merge(custom_headers || {}),
413
+ base_url: request_url
414
+ }
415
+ promise = @client.make_request_async(:get, path_template, options)
416
+
417
+ promise = promise.then do |result|
418
+ http_response = result.response
419
+ status_code = http_response.status
420
+ response_content = http_response.body
421
+ unless status_code == 200
422
+ error_model = JSON.load(response_content)
423
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
424
+ end
425
+
426
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
427
+ # Deserialize Response
428
+ if status_code == 200
429
+ begin
430
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
431
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::ApplicationPackage.mapper()
432
+ result.body = @client.deserialize(result_mapper, parsed_response)
433
+ rescue Exception => e
434
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
435
+ end
436
+ end
437
+
438
+ result
439
+ end
440
+
441
+ promise.execute
442
+ end
443
+
444
+ end
445
+ end
@@ -0,0 +1,1281 @@
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::Batch::Mgmt::V2017_01_01
7
+ #
8
+ # BatchAccountOperations
9
+ #
10
+ class BatchAccountOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BatchAccountOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [BatchManagementClient] reference to the BatchManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates a new Batch account with the specified parameters. Existing accounts
26
+ # cannot be updated with this API and should instead be updated with the Update
27
+ # Batch Account API.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group that
30
+ # contains the new Batch account.
31
+ # @param account_name [String] A name for the Batch account which must be
32
+ # unique within the region. Batch account names must be between 3 and 24
33
+ # characters in length and must use only numbers and lowercase letters. This
34
+ # name is used as part of the DNS name that is used to access the Batch service
35
+ # in the region in which the account is created. For example:
36
+ # http://accountname.region.batch.azure.com/.
37
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
38
+ # account creation.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ # @return [BatchAccount] operation results.
43
+ #
44
+ def create(resource_group_name, account_name, parameters, custom_headers:nil)
45
+ response = create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
46
+ response.body unless response.nil?
47
+ end
48
+
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group that
51
+ # contains the new Batch account.
52
+ # @param account_name [String] A name for the Batch account which must be
53
+ # unique within the region. Batch account names must be between 3 and 24
54
+ # characters in length and must use only numbers and lowercase letters. This
55
+ # name is used as part of the DNS name that is used to access the Batch service
56
+ # in the region in which the account is created. For example:
57
+ # http://accountname.region.batch.azure.com/.
58
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
59
+ # account creation.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [Concurrent::Promise] promise which provides async access to http
64
+ # response.
65
+ #
66
+ def create_async(resource_group_name, account_name, parameters, custom_headers:nil)
67
+ # Send request
68
+ promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers)
69
+
70
+ promise = promise.then do |response|
71
+ # Defining deserialization method.
72
+ deserialize_method = lambda do |parsed_response|
73
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccount.mapper()
74
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
75
+ end
76
+
77
+ # Waiting for response.
78
+ @client.get_long_running_operation_result(response, deserialize_method)
79
+ end
80
+
81
+ promise
82
+ end
83
+
84
+ #
85
+ # Updates the properties of an existing Batch account.
86
+ #
87
+ # @param resource_group_name [String] The name of the resource group that
88
+ # contains the Batch account.
89
+ # @param account_name [String] The name of the account.
90
+ # @param parameters [BatchAccountUpdateParameters] Additional parameters for
91
+ # account update.
92
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
93
+ # will be added to the HTTP request.
94
+ #
95
+ # @return [BatchAccount] operation results.
96
+ #
97
+ def update(resource_group_name, account_name, parameters, custom_headers:nil)
98
+ response = update_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
99
+ response.body unless response.nil?
100
+ end
101
+
102
+ #
103
+ # Updates the properties of an existing Batch account.
104
+ #
105
+ # @param resource_group_name [String] The name of the resource group that
106
+ # contains the Batch account.
107
+ # @param account_name [String] The name of the account.
108
+ # @param parameters [BatchAccountUpdateParameters] Additional parameters for
109
+ # account update.
110
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
111
+ # will be added to the HTTP request.
112
+ #
113
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
114
+ #
115
+ def update_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
116
+ update_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
117
+ end
118
+
119
+ #
120
+ # Updates the properties of an existing Batch account.
121
+ #
122
+ # @param resource_group_name [String] The name of the resource group that
123
+ # contains the Batch account.
124
+ # @param account_name [String] The name of the account.
125
+ # @param parameters [BatchAccountUpdateParameters] Additional parameters for
126
+ # account update.
127
+ # @param [Hash{String => String}] A hash of custom headers that will be added
128
+ # to the HTTP request.
129
+ #
130
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
131
+ #
132
+ def update_async(resource_group_name, account_name, parameters, custom_headers:nil)
133
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
134
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
135
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
136
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
137
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
138
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
139
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
140
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
141
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
142
+
143
+
144
+ request_headers = {}
145
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
146
+
147
+ # Set Headers
148
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
149
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
150
+
151
+ # Serialize Request
152
+ request_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountUpdateParameters.mapper()
153
+ request_content = @client.serialize(request_mapper, parameters)
154
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
155
+
156
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
157
+
158
+ request_url = @base_url || @client.base_url
159
+
160
+ options = {
161
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
162
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
163
+ query_params: {'api-version' => @client.api_version},
164
+ body: request_content,
165
+ headers: request_headers.merge(custom_headers || {}),
166
+ base_url: request_url
167
+ }
168
+ promise = @client.make_request_async(:patch, path_template, options)
169
+
170
+ promise = promise.then do |result|
171
+ http_response = result.response
172
+ status_code = http_response.status
173
+ response_content = http_response.body
174
+ unless status_code == 200
175
+ error_model = JSON.load(response_content)
176
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
177
+ end
178
+
179
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
180
+ # Deserialize Response
181
+ if status_code == 200
182
+ begin
183
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
184
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccount.mapper()
185
+ result.body = @client.deserialize(result_mapper, parsed_response)
186
+ rescue Exception => e
187
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
188
+ end
189
+ end
190
+
191
+ result
192
+ end
193
+
194
+ promise.execute
195
+ end
196
+
197
+ #
198
+ # Deletes the specified Batch account.
199
+ #
200
+ # @param resource_group_name [String] The name of the resource group that
201
+ # contains the Batch account to be deleted.
202
+ # @param account_name [String] The name of the account to be deleted.
203
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
204
+ # will be added to the HTTP request.
205
+ #
206
+ def delete(resource_group_name, account_name, custom_headers:nil)
207
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
208
+ nil
209
+ end
210
+
211
+ #
212
+ # @param resource_group_name [String] The name of the resource group that
213
+ # contains the Batch account to be deleted.
214
+ # @param account_name [String] The name of the account to be deleted.
215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
+ # will be added to the HTTP request.
217
+ #
218
+ # @return [Concurrent::Promise] promise which provides async access to http
219
+ # response.
220
+ #
221
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
222
+ # Send request
223
+ promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers)
224
+
225
+ promise = promise.then do |response|
226
+ # Defining deserialization method.
227
+ deserialize_method = lambda do |parsed_response|
228
+ end
229
+
230
+ # Waiting for response.
231
+ @client.get_long_running_operation_result(response, deserialize_method)
232
+ end
233
+
234
+ promise
235
+ end
236
+
237
+ #
238
+ # Gets information about the specified Batch account.
239
+ #
240
+ # @param resource_group_name [String] The name of the resource group that
241
+ # contains the Batch account.
242
+ # @param account_name [String] The name of the account.
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [BatchAccount] operation results.
247
+ #
248
+ def get(resource_group_name, account_name, custom_headers:nil)
249
+ response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
250
+ response.body unless response.nil?
251
+ end
252
+
253
+ #
254
+ # Gets information about the specified Batch account.
255
+ #
256
+ # @param resource_group_name [String] The name of the resource group that
257
+ # contains the Batch account.
258
+ # @param account_name [String] The name of the account.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
263
+ #
264
+ def get_with_http_info(resource_group_name, account_name, custom_headers:nil)
265
+ get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
266
+ end
267
+
268
+ #
269
+ # Gets information about the specified Batch account.
270
+ #
271
+ # @param resource_group_name [String] The name of the resource group that
272
+ # contains the Batch account.
273
+ # @param account_name [String] The name of the account.
274
+ # @param [Hash{String => String}] A hash of custom headers that will be added
275
+ # to the HTTP request.
276
+ #
277
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
278
+ #
279
+ def get_async(resource_group_name, account_name, custom_headers:nil)
280
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
281
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
282
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
283
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
284
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
285
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
286
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
287
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
288
+
289
+
290
+ request_headers = {}
291
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
+
293
+ # Set Headers
294
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
297
+
298
+ request_url = @base_url || @client.base_url
299
+
300
+ options = {
301
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
302
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
303
+ query_params: {'api-version' => @client.api_version},
304
+ headers: request_headers.merge(custom_headers || {}),
305
+ base_url: request_url
306
+ }
307
+ promise = @client.make_request_async(:get, path_template, options)
308
+
309
+ promise = promise.then do |result|
310
+ http_response = result.response
311
+ status_code = http_response.status
312
+ response_content = http_response.body
313
+ unless status_code == 200
314
+ error_model = JSON.load(response_content)
315
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
316
+ end
317
+
318
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
319
+ # Deserialize Response
320
+ if status_code == 200
321
+ begin
322
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
323
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccount.mapper()
324
+ result.body = @client.deserialize(result_mapper, parsed_response)
325
+ rescue Exception => e
326
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
327
+ end
328
+ end
329
+
330
+ result
331
+ end
332
+
333
+ promise.execute
334
+ end
335
+
336
+ #
337
+ # Gets information about the Batch accounts associated with the subscription.
338
+ #
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [Array<BatchAccount>] operation results.
343
+ #
344
+ def list(custom_headers:nil)
345
+ first_page = list_as_lazy(custom_headers:custom_headers)
346
+ first_page.get_all_items
347
+ end
348
+
349
+ #
350
+ # Gets information about the Batch accounts associated with the subscription.
351
+ #
352
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
353
+ # will be added to the HTTP request.
354
+ #
355
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
356
+ #
357
+ def list_with_http_info(custom_headers:nil)
358
+ list_async(custom_headers:custom_headers).value!
359
+ end
360
+
361
+ #
362
+ # Gets information about the Batch accounts associated with the subscription.
363
+ #
364
+ # @param [Hash{String => String}] A hash of custom headers that will be added
365
+ # to the HTTP request.
366
+ #
367
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
368
+ #
369
+ def list_async(custom_headers:nil)
370
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
371
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
372
+
373
+
374
+ request_headers = {}
375
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
376
+
377
+ # Set Headers
378
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
379
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
380
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts'
381
+
382
+ request_url = @base_url || @client.base_url
383
+
384
+ options = {
385
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
386
+ path_params: {'subscriptionId' => @client.subscription_id},
387
+ query_params: {'api-version' => @client.api_version},
388
+ headers: request_headers.merge(custom_headers || {}),
389
+ base_url: request_url
390
+ }
391
+ promise = @client.make_request_async(:get, path_template, options)
392
+
393
+ promise = promise.then do |result|
394
+ http_response = result.response
395
+ status_code = http_response.status
396
+ response_content = http_response.body
397
+ unless status_code == 200
398
+ error_model = JSON.load(response_content)
399
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
400
+ end
401
+
402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
403
+ # Deserialize Response
404
+ if status_code == 200
405
+ begin
406
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
407
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountListResult.mapper()
408
+ result.body = @client.deserialize(result_mapper, parsed_response)
409
+ rescue Exception => e
410
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
411
+ end
412
+ end
413
+
414
+ result
415
+ end
416
+
417
+ promise.execute
418
+ end
419
+
420
+ #
421
+ # Gets information about the Batch accounts associated within the specified
422
+ # resource group.
423
+ #
424
+ # @param resource_group_name [String] The name of the resource group whose
425
+ # Batch accounts to list.
426
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
427
+ # will be added to the HTTP request.
428
+ #
429
+ # @return [Array<BatchAccount>] operation results.
430
+ #
431
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
432
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
433
+ first_page.get_all_items
434
+ end
435
+
436
+ #
437
+ # Gets information about the Batch accounts associated within the specified
438
+ # resource group.
439
+ #
440
+ # @param resource_group_name [String] The name of the resource group whose
441
+ # Batch accounts to list.
442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
443
+ # will be added to the HTTP request.
444
+ #
445
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
446
+ #
447
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
448
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
449
+ end
450
+
451
+ #
452
+ # Gets information about the Batch accounts associated within the specified
453
+ # resource group.
454
+ #
455
+ # @param resource_group_name [String] The name of the resource group whose
456
+ # Batch accounts to list.
457
+ # @param [Hash{String => String}] A hash of custom headers that will be added
458
+ # to the HTTP request.
459
+ #
460
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
461
+ #
462
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
463
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
464
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
465
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
466
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
467
+
468
+
469
+ request_headers = {}
470
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
471
+
472
+ # Set Headers
473
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
474
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
475
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts'
476
+
477
+ request_url = @base_url || @client.base_url
478
+
479
+ options = {
480
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
481
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
482
+ query_params: {'api-version' => @client.api_version},
483
+ headers: request_headers.merge(custom_headers || {}),
484
+ base_url: request_url
485
+ }
486
+ promise = @client.make_request_async(:get, path_template, options)
487
+
488
+ promise = promise.then do |result|
489
+ http_response = result.response
490
+ status_code = http_response.status
491
+ response_content = http_response.body
492
+ unless status_code == 200
493
+ error_model = JSON.load(response_content)
494
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
495
+ end
496
+
497
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
498
+ # Deserialize Response
499
+ if status_code == 200
500
+ begin
501
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
502
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountListResult.mapper()
503
+ result.body = @client.deserialize(result_mapper, parsed_response)
504
+ rescue Exception => e
505
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
506
+ end
507
+ end
508
+
509
+ result
510
+ end
511
+
512
+ promise.execute
513
+ end
514
+
515
+ #
516
+ # Synchronizes access keys for the auto storage account configured for the
517
+ # specified Batch account.
518
+ #
519
+ # @param resource_group_name [String] The name of the resource group that
520
+ # contains the Batch account.
521
+ # @param account_name [String] The name of the Batch account.
522
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
523
+ # will be added to the HTTP request.
524
+ #
525
+ #
526
+ def synchronize_auto_storage_keys(resource_group_name, account_name, custom_headers:nil)
527
+ response = synchronize_auto_storage_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
528
+ nil
529
+ end
530
+
531
+ #
532
+ # Synchronizes access keys for the auto storage account configured for the
533
+ # specified Batch account.
534
+ #
535
+ # @param resource_group_name [String] The name of the resource group that
536
+ # contains the Batch account.
537
+ # @param account_name [String] The name of the Batch account.
538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
539
+ # will be added to the HTTP request.
540
+ #
541
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
542
+ #
543
+ def synchronize_auto_storage_keys_with_http_info(resource_group_name, account_name, custom_headers:nil)
544
+ synchronize_auto_storage_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
545
+ end
546
+
547
+ #
548
+ # Synchronizes access keys for the auto storage account configured for the
549
+ # specified Batch account.
550
+ #
551
+ # @param resource_group_name [String] The name of the resource group that
552
+ # contains the Batch account.
553
+ # @param account_name [String] The name of the Batch account.
554
+ # @param [Hash{String => String}] A hash of custom headers that will be added
555
+ # to the HTTP request.
556
+ #
557
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
558
+ #
559
+ def synchronize_auto_storage_keys_async(resource_group_name, account_name, custom_headers:nil)
560
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
561
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
562
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
563
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
564
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
565
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
566
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
567
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
568
+
569
+
570
+ request_headers = {}
571
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
572
+
573
+ # Set Headers
574
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
575
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
576
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys'
577
+
578
+ request_url = @base_url || @client.base_url
579
+
580
+ options = {
581
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
582
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
583
+ query_params: {'api-version' => @client.api_version},
584
+ headers: request_headers.merge(custom_headers || {}),
585
+ base_url: request_url
586
+ }
587
+ promise = @client.make_request_async(:post, path_template, options)
588
+
589
+ promise = promise.then do |result|
590
+ http_response = result.response
591
+ status_code = http_response.status
592
+ response_content = http_response.body
593
+ unless status_code == 204
594
+ error_model = JSON.load(response_content)
595
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
596
+ end
597
+
598
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
599
+
600
+ result
601
+ end
602
+
603
+ promise.execute
604
+ end
605
+
606
+ #
607
+ # Regenerates the specified account key for the Batch account.
608
+ #
609
+ # @param resource_group_name [String] The name of the resource group that
610
+ # contains the Batch account.
611
+ # @param account_name [String] The name of the account.
612
+ # @param parameters [BatchAccountRegenerateKeyParameters] The type of key to
613
+ # regenerate.
614
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
615
+ # will be added to the HTTP request.
616
+ #
617
+ # @return [BatchAccountKeys] operation results.
618
+ #
619
+ def regenerate_key(resource_group_name, account_name, parameters, custom_headers:nil)
620
+ response = regenerate_key_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
621
+ response.body unless response.nil?
622
+ end
623
+
624
+ #
625
+ # Regenerates the specified account key for the Batch account.
626
+ #
627
+ # @param resource_group_name [String] The name of the resource group that
628
+ # contains the Batch account.
629
+ # @param account_name [String] The name of the account.
630
+ # @param parameters [BatchAccountRegenerateKeyParameters] The type of key to
631
+ # regenerate.
632
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
633
+ # will be added to the HTTP request.
634
+ #
635
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
636
+ #
637
+ def regenerate_key_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
638
+ regenerate_key_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
639
+ end
640
+
641
+ #
642
+ # Regenerates the specified account key for the Batch account.
643
+ #
644
+ # @param resource_group_name [String] The name of the resource group that
645
+ # contains the Batch account.
646
+ # @param account_name [String] The name of the account.
647
+ # @param parameters [BatchAccountRegenerateKeyParameters] The type of key to
648
+ # regenerate.
649
+ # @param [Hash{String => String}] A hash of custom headers that will be added
650
+ # to the HTTP request.
651
+ #
652
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
653
+ #
654
+ def regenerate_key_async(resource_group_name, account_name, parameters, custom_headers:nil)
655
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
656
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
657
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
658
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
659
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
660
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
661
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
662
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
663
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
664
+
665
+
666
+ request_headers = {}
667
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
668
+
669
+ # Set Headers
670
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
671
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
672
+
673
+ # Serialize Request
674
+ request_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountRegenerateKeyParameters.mapper()
675
+ request_content = @client.serialize(request_mapper, parameters)
676
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
677
+
678
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys'
679
+
680
+ request_url = @base_url || @client.base_url
681
+
682
+ options = {
683
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
684
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
685
+ query_params: {'api-version' => @client.api_version},
686
+ body: request_content,
687
+ headers: request_headers.merge(custom_headers || {}),
688
+ base_url: request_url
689
+ }
690
+ promise = @client.make_request_async(:post, path_template, options)
691
+
692
+ promise = promise.then do |result|
693
+ http_response = result.response
694
+ status_code = http_response.status
695
+ response_content = http_response.body
696
+ unless status_code == 200
697
+ error_model = JSON.load(response_content)
698
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
699
+ end
700
+
701
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
702
+ # Deserialize Response
703
+ if status_code == 200
704
+ begin
705
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
706
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountKeys.mapper()
707
+ result.body = @client.deserialize(result_mapper, parsed_response)
708
+ rescue Exception => e
709
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
710
+ end
711
+ end
712
+
713
+ result
714
+ end
715
+
716
+ promise.execute
717
+ end
718
+
719
+ #
720
+ # Gets the account keys for the specified Batch account.
721
+ #
722
+ # This operation applies only to Batch accounts created with a
723
+ # poolAllocationMode of 'BatchService'. If the Batch account was created with a
724
+ # poolAllocationMode of 'UserSubscription', clients cannot use access to keys
725
+ # to authenticate, and must use Azure Active Directory instead. In this case,
726
+ # getting the keys will fail.
727
+ #
728
+ # @param resource_group_name [String] The name of the resource group that
729
+ # contains the Batch account.
730
+ # @param account_name [String] The name of the account.
731
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
732
+ # will be added to the HTTP request.
733
+ #
734
+ # @return [BatchAccountKeys] operation results.
735
+ #
736
+ def get_keys(resource_group_name, account_name, custom_headers:nil)
737
+ response = get_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
738
+ response.body unless response.nil?
739
+ end
740
+
741
+ #
742
+ # Gets the account keys for the specified Batch account.
743
+ #
744
+ # This operation applies only to Batch accounts created with a
745
+ # poolAllocationMode of 'BatchService'. If the Batch account was created with a
746
+ # poolAllocationMode of 'UserSubscription', clients cannot use access to keys
747
+ # to authenticate, and must use Azure Active Directory instead. In this case,
748
+ # getting the keys will fail.
749
+ #
750
+ # @param resource_group_name [String] The name of the resource group that
751
+ # contains the Batch account.
752
+ # @param account_name [String] The name of the account.
753
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
754
+ # will be added to the HTTP request.
755
+ #
756
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
757
+ #
758
+ def get_keys_with_http_info(resource_group_name, account_name, custom_headers:nil)
759
+ get_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
760
+ end
761
+
762
+ #
763
+ # Gets the account keys for the specified Batch account.
764
+ #
765
+ # This operation applies only to Batch accounts created with a
766
+ # poolAllocationMode of 'BatchService'. If the Batch account was created with a
767
+ # poolAllocationMode of 'UserSubscription', clients cannot use access to keys
768
+ # to authenticate, and must use Azure Active Directory instead. In this case,
769
+ # getting the keys will fail.
770
+ #
771
+ # @param resource_group_name [String] The name of the resource group that
772
+ # contains the Batch account.
773
+ # @param account_name [String] The name of the account.
774
+ # @param [Hash{String => String}] A hash of custom headers that will be added
775
+ # to the HTTP request.
776
+ #
777
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
778
+ #
779
+ def get_keys_async(resource_group_name, account_name, custom_headers:nil)
780
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
781
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
782
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
783
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
784
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
785
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
786
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
787
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
788
+
789
+
790
+ request_headers = {}
791
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
792
+
793
+ # Set Headers
794
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
795
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
796
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys'
797
+
798
+ request_url = @base_url || @client.base_url
799
+
800
+ options = {
801
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
802
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
803
+ query_params: {'api-version' => @client.api_version},
804
+ headers: request_headers.merge(custom_headers || {}),
805
+ base_url: request_url
806
+ }
807
+ promise = @client.make_request_async(:post, path_template, options)
808
+
809
+ promise = promise.then do |result|
810
+ http_response = result.response
811
+ status_code = http_response.status
812
+ response_content = http_response.body
813
+ unless status_code == 200
814
+ error_model = JSON.load(response_content)
815
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
816
+ end
817
+
818
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
819
+ # Deserialize Response
820
+ if status_code == 200
821
+ begin
822
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
823
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountKeys.mapper()
824
+ result.body = @client.deserialize(result_mapper, parsed_response)
825
+ rescue Exception => e
826
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
827
+ end
828
+ end
829
+
830
+ result
831
+ end
832
+
833
+ promise.execute
834
+ end
835
+
836
+ #
837
+ # Creates a new Batch account with the specified parameters. Existing accounts
838
+ # cannot be updated with this API and should instead be updated with the Update
839
+ # Batch Account API.
840
+ #
841
+ # @param resource_group_name [String] The name of the resource group that
842
+ # contains the new Batch account.
843
+ # @param account_name [String] A name for the Batch account which must be
844
+ # unique within the region. Batch account names must be between 3 and 24
845
+ # characters in length and must use only numbers and lowercase letters. This
846
+ # name is used as part of the DNS name that is used to access the Batch service
847
+ # in the region in which the account is created. For example:
848
+ # http://accountname.region.batch.azure.com/.
849
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
850
+ # account creation.
851
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
852
+ # will be added to the HTTP request.
853
+ #
854
+ # @return [BatchAccount] operation results.
855
+ #
856
+ def begin_create(resource_group_name, account_name, parameters, custom_headers:nil)
857
+ response = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
858
+ response.body unless response.nil?
859
+ end
860
+
861
+ #
862
+ # Creates a new Batch account with the specified parameters. Existing accounts
863
+ # cannot be updated with this API and should instead be updated with the Update
864
+ # Batch Account API.
865
+ #
866
+ # @param resource_group_name [String] The name of the resource group that
867
+ # contains the new Batch account.
868
+ # @param account_name [String] A name for the Batch account which must be
869
+ # unique within the region. Batch account names must be between 3 and 24
870
+ # characters in length and must use only numbers and lowercase letters. This
871
+ # name is used as part of the DNS name that is used to access the Batch service
872
+ # in the region in which the account is created. For example:
873
+ # http://accountname.region.batch.azure.com/.
874
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
875
+ # account creation.
876
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
877
+ # will be added to the HTTP request.
878
+ #
879
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
880
+ #
881
+ def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
882
+ begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
883
+ end
884
+
885
+ #
886
+ # Creates a new Batch account with the specified parameters. Existing accounts
887
+ # cannot be updated with this API and should instead be updated with the Update
888
+ # Batch Account API.
889
+ #
890
+ # @param resource_group_name [String] The name of the resource group that
891
+ # contains the new Batch account.
892
+ # @param account_name [String] A name for the Batch account which must be
893
+ # unique within the region. Batch account names must be between 3 and 24
894
+ # characters in length and must use only numbers and lowercase letters. This
895
+ # name is used as part of the DNS name that is used to access the Batch service
896
+ # in the region in which the account is created. For example:
897
+ # http://accountname.region.batch.azure.com/.
898
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
899
+ # account creation.
900
+ # @param [Hash{String => String}] A hash of custom headers that will be added
901
+ # to the HTTP request.
902
+ #
903
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
904
+ #
905
+ def begin_create_async(resource_group_name, account_name, parameters, custom_headers:nil)
906
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
907
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
908
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
909
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
910
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
911
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
912
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
913
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
914
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
915
+
916
+
917
+ request_headers = {}
918
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
919
+
920
+ # Set Headers
921
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
922
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
923
+
924
+ # Serialize Request
925
+ request_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountCreateParameters.mapper()
926
+ request_content = @client.serialize(request_mapper, parameters)
927
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
928
+
929
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
930
+
931
+ request_url = @base_url || @client.base_url
932
+
933
+ options = {
934
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
935
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
936
+ query_params: {'api-version' => @client.api_version},
937
+ body: request_content,
938
+ headers: request_headers.merge(custom_headers || {}),
939
+ base_url: request_url
940
+ }
941
+ promise = @client.make_request_async(:put, path_template, options)
942
+
943
+ promise = promise.then do |result|
944
+ http_response = result.response
945
+ status_code = http_response.status
946
+ response_content = http_response.body
947
+ unless status_code == 200 || status_code == 202
948
+ error_model = JSON.load(response_content)
949
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
950
+ end
951
+
952
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
953
+ # Deserialize Response
954
+ if status_code == 200
955
+ begin
956
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
957
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccount.mapper()
958
+ result.body = @client.deserialize(result_mapper, parsed_response)
959
+ rescue Exception => e
960
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
961
+ end
962
+ end
963
+
964
+ result
965
+ end
966
+
967
+ promise.execute
968
+ end
969
+
970
+ #
971
+ # Deletes the specified Batch account.
972
+ #
973
+ # @param resource_group_name [String] The name of the resource group that
974
+ # contains the Batch account to be deleted.
975
+ # @param account_name [String] The name of the account to be deleted.
976
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
977
+ # will be added to the HTTP request.
978
+ #
979
+ #
980
+ def begin_delete(resource_group_name, account_name, custom_headers:nil)
981
+ response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
982
+ nil
983
+ end
984
+
985
+ #
986
+ # Deletes the specified Batch account.
987
+ #
988
+ # @param resource_group_name [String] The name of the resource group that
989
+ # contains the Batch account to be deleted.
990
+ # @param account_name [String] The name of the account to be deleted.
991
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
992
+ # will be added to the HTTP request.
993
+ #
994
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
995
+ #
996
+ def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
997
+ begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
998
+ end
999
+
1000
+ #
1001
+ # Deletes the specified Batch account.
1002
+ #
1003
+ # @param resource_group_name [String] The name of the resource group that
1004
+ # contains the Batch account to be deleted.
1005
+ # @param account_name [String] The name of the account to be deleted.
1006
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1007
+ # to the HTTP request.
1008
+ #
1009
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1010
+ #
1011
+ def begin_delete_async(resource_group_name, account_name, custom_headers:nil)
1012
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1013
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
1014
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1015
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1016
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1017
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
1018
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1019
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1020
+
1021
+
1022
+ request_headers = {}
1023
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1024
+
1025
+ # Set Headers
1026
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1027
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1028
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
1029
+
1030
+ request_url = @base_url || @client.base_url
1031
+
1032
+ options = {
1033
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1034
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1035
+ query_params: {'api-version' => @client.api_version},
1036
+ headers: request_headers.merge(custom_headers || {}),
1037
+ base_url: request_url
1038
+ }
1039
+ promise = @client.make_request_async(:delete, path_template, options)
1040
+
1041
+ promise = promise.then do |result|
1042
+ http_response = result.response
1043
+ status_code = http_response.status
1044
+ response_content = http_response.body
1045
+ unless status_code == 200 || status_code == 202
1046
+ error_model = JSON.load(response_content)
1047
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1048
+ end
1049
+
1050
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1051
+
1052
+ result
1053
+ end
1054
+
1055
+ promise.execute
1056
+ end
1057
+
1058
+ #
1059
+ # Gets information about the Batch accounts associated with the subscription.
1060
+ #
1061
+ # @param next_page_link [String] The NextLink from the previous successful call
1062
+ # to List operation.
1063
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1064
+ # will be added to the HTTP request.
1065
+ #
1066
+ # @return [BatchAccountListResult] operation results.
1067
+ #
1068
+ def list_next(next_page_link, custom_headers:nil)
1069
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1070
+ response.body unless response.nil?
1071
+ end
1072
+
1073
+ #
1074
+ # Gets information about the Batch accounts associated with the subscription.
1075
+ #
1076
+ # @param next_page_link [String] The NextLink from the previous successful call
1077
+ # to List operation.
1078
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1079
+ # will be added to the HTTP request.
1080
+ #
1081
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1082
+ #
1083
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1084
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1085
+ end
1086
+
1087
+ #
1088
+ # Gets information about the Batch accounts associated with the subscription.
1089
+ #
1090
+ # @param next_page_link [String] The NextLink from the previous successful call
1091
+ # to List operation.
1092
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1093
+ # to the HTTP request.
1094
+ #
1095
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1096
+ #
1097
+ def list_next_async(next_page_link, custom_headers:nil)
1098
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1099
+
1100
+
1101
+ request_headers = {}
1102
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1103
+
1104
+ # Set Headers
1105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1106
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1107
+ path_template = '{nextLink}'
1108
+
1109
+ request_url = @base_url || @client.base_url
1110
+
1111
+ options = {
1112
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1113
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1114
+ headers: request_headers.merge(custom_headers || {}),
1115
+ base_url: request_url
1116
+ }
1117
+ promise = @client.make_request_async(:get, path_template, options)
1118
+
1119
+ promise = promise.then do |result|
1120
+ http_response = result.response
1121
+ status_code = http_response.status
1122
+ response_content = http_response.body
1123
+ unless status_code == 200
1124
+ error_model = JSON.load(response_content)
1125
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1126
+ end
1127
+
1128
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1129
+ # Deserialize Response
1130
+ if status_code == 200
1131
+ begin
1132
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1133
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountListResult.mapper()
1134
+ result.body = @client.deserialize(result_mapper, parsed_response)
1135
+ rescue Exception => e
1136
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1137
+ end
1138
+ end
1139
+
1140
+ result
1141
+ end
1142
+
1143
+ promise.execute
1144
+ end
1145
+
1146
+ #
1147
+ # Gets information about the Batch accounts associated within the specified
1148
+ # resource group.
1149
+ #
1150
+ # @param next_page_link [String] The NextLink from the previous successful call
1151
+ # to List operation.
1152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1153
+ # will be added to the HTTP request.
1154
+ #
1155
+ # @return [BatchAccountListResult] operation results.
1156
+ #
1157
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1158
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1159
+ response.body unless response.nil?
1160
+ end
1161
+
1162
+ #
1163
+ # Gets information about the Batch accounts associated within the specified
1164
+ # resource group.
1165
+ #
1166
+ # @param next_page_link [String] The NextLink from the previous successful call
1167
+ # to List operation.
1168
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1169
+ # will be added to the HTTP request.
1170
+ #
1171
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1172
+ #
1173
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1174
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1175
+ end
1176
+
1177
+ #
1178
+ # Gets information about the Batch accounts associated within the specified
1179
+ # resource group.
1180
+ #
1181
+ # @param next_page_link [String] The NextLink from the previous successful call
1182
+ # to List operation.
1183
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1184
+ # to the HTTP request.
1185
+ #
1186
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1187
+ #
1188
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1189
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1190
+
1191
+
1192
+ request_headers = {}
1193
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1194
+
1195
+ # Set Headers
1196
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1197
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1198
+ path_template = '{nextLink}'
1199
+
1200
+ request_url = @base_url || @client.base_url
1201
+
1202
+ options = {
1203
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1204
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1205
+ headers: request_headers.merge(custom_headers || {}),
1206
+ base_url: request_url
1207
+ }
1208
+ promise = @client.make_request_async(:get, path_template, options)
1209
+
1210
+ promise = promise.then do |result|
1211
+ http_response = result.response
1212
+ status_code = http_response.status
1213
+ response_content = http_response.body
1214
+ unless status_code == 200
1215
+ error_model = JSON.load(response_content)
1216
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1217
+ end
1218
+
1219
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1220
+ # Deserialize Response
1221
+ if status_code == 200
1222
+ begin
1223
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1224
+ result_mapper = Azure::Batch::Mgmt::V2017_01_01::Models::BatchAccountListResult.mapper()
1225
+ result.body = @client.deserialize(result_mapper, parsed_response)
1226
+ rescue Exception => e
1227
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1228
+ end
1229
+ end
1230
+
1231
+ result
1232
+ end
1233
+
1234
+ promise.execute
1235
+ end
1236
+
1237
+ #
1238
+ # Gets information about the Batch accounts associated with the subscription.
1239
+ #
1240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1241
+ # will be added to the HTTP request.
1242
+ #
1243
+ # @return [BatchAccountListResult] which provide lazy access to pages of the
1244
+ # response.
1245
+ #
1246
+ def list_as_lazy(custom_headers:nil)
1247
+ response = list_async(custom_headers:custom_headers).value!
1248
+ unless response.nil?
1249
+ page = response.body
1250
+ page.next_method = Proc.new do |next_page_link|
1251
+ list_next_async(next_page_link, custom_headers:custom_headers)
1252
+ end
1253
+ page
1254
+ end
1255
+ end
1256
+
1257
+ #
1258
+ # Gets information about the Batch accounts associated within the specified
1259
+ # resource group.
1260
+ #
1261
+ # @param resource_group_name [String] The name of the resource group whose
1262
+ # Batch accounts to list.
1263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1264
+ # will be added to the HTTP request.
1265
+ #
1266
+ # @return [BatchAccountListResult] which provide lazy access to pages of the
1267
+ # response.
1268
+ #
1269
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1270
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1271
+ unless response.nil?
1272
+ page = response.body
1273
+ page.next_method = Proc.new do |next_page_link|
1274
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1275
+ end
1276
+ page
1277
+ end
1278
+ end
1279
+
1280
+ end
1281
+ end