azure_mgmt_container_service 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-03-30/generated/azure_mgmt_container_service/container_service_client.rb +7 -6
  3. data/lib/2016-09-30/generated/azure_mgmt_container_service/container_service_client.rb +7 -6
  4. data/lib/2016-09-30/generated/azure_mgmt_container_service/container_services.rb +1 -1
  5. data/lib/2017-01-31/generated/azure_mgmt_container_service/container_service_client.rb +7 -6
  6. data/lib/2017-01-31/generated/azure_mgmt_container_service/container_services.rb +1 -1
  7. data/lib/2017-07-01/generated/azure_mgmt_container_service.rb +47 -0
  8. data/lib/2017-07-01/generated/azure_mgmt_container_service/container_service_client.rb +133 -0
  9. data/lib/2017-07-01/generated/azure_mgmt_container_service/container_services.rb +924 -0
  10. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service.rb +213 -0
  11. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb +226 -0
  12. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_custom_profile.rb +46 -0
  13. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
  14. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
  15. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_list_result.rb +100 -0
  16. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
  17. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_orchestrator_profile.rb +62 -0
  18. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_orchestrator_types.rb +19 -0
  19. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_service_principal_profile.rb +73 -0
  20. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
  21. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
  22. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
  23. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
  24. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
  25. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb +63 -0
  26. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/key_vault_secret_ref.rb +68 -0
  27. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
  28. data/lib/2017-07-01/generated/azure_mgmt_container_service/models/resource.rb +101 -0
  29. data/lib/2017-07-01/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  30. data/lib/2017-08-31/generated/azure_mgmt_container_service.rb +48 -0
  31. data/lib/2017-08-31/generated/azure_mgmt_container_service/container_service_client.rb +133 -0
  32. data/lib/2017-08-31/generated/azure_mgmt_container_service/managed_clusters.rb +1172 -0
  33. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb +226 -0
  34. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
  35. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
  36. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
  37. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_service_principal_profile.rb +73 -0
  38. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
  39. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
  40. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
  41. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
  42. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
  43. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb +63 -0
  44. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/key_vault_secret_ref.rb +68 -0
  45. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/managed_cluster.rb +183 -0
  46. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
  47. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
  48. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +91 -0
  49. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
  50. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/orchestrator_profile.rb +57 -0
  51. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
  52. data/lib/2017-08-31/generated/azure_mgmt_container_service/models/resource.rb +101 -0
  53. data/lib/2017-08-31/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  54. data/lib/2017-09-30/generated/azure_mgmt_container_service.rb +31 -0
  55. data/lib/2017-09-30/generated/azure_mgmt_container_service/container_service_client.rb +133 -0
  56. data/lib/2017-09-30/generated/azure_mgmt_container_service/container_services.rb +131 -0
  57. data/lib/2017-09-30/generated/azure_mgmt_container_service/models/orchestrator_profile.rb +57 -0
  58. data/lib/2017-09-30/generated/azure_mgmt_container_service/models/orchestrator_version_profile.rb +89 -0
  59. data/lib/2017-09-30/generated/azure_mgmt_container_service/models/orchestrator_version_profile_list_result.rb +92 -0
  60. data/lib/2017-09-30/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  61. data/lib/2018-03-31/generated/azure_mgmt_container_service.rb +57 -0
  62. data/lib/2018-03-31/generated/azure_mgmt_container_service/container_service_client.rb +137 -0
  63. data/lib/2018-03-31/generated/azure_mgmt_container_service/managed_clusters.rb +1227 -0
  64. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
  65. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
  66. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
  67. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_network_profile.rb +128 -0
  68. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_service_principal_profile.rb +73 -0
  69. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
  70. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
  71. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
  72. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
  73. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
  74. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb +63 -0
  75. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/key_vault_secret_ref.rb +68 -0
  76. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster.rb +255 -0
  77. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_aadprofile.rb +80 -0
  78. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
  79. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile.rb +66 -0
  80. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile.rb +237 -0
  81. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
  82. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +91 -0
  83. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
  84. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/network_plugin.rb +16 -0
  85. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/network_policy.rb +15 -0
  86. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/operation_list_result.rb +56 -0
  87. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/operation_value.rb +108 -0
  88. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/orchestrator_profile.rb +57 -0
  89. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
  90. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/resource.rb +101 -0
  91. data/lib/2018-03-31/generated/azure_mgmt_container_service/models/tags_object.rb +54 -0
  92. data/lib/2018-03-31/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  93. data/lib/2018-03-31/generated/azure_mgmt_container_service/operations.rb +107 -0
  94. data/lib/azure_mgmt_container_service.rb +5 -1
  95. data/lib/profiles/latest/modules/containerservice_profile_module.rb +149 -49
  96. data/lib/version.rb +1 -1
  97. metadata +91 -4
@@ -0,0 +1,1227 @@
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::ContainerService::Mgmt::V2018_03_31
7
+ #
8
+ # The Container Service Client.
9
+ #
10
+ class ManagedClusters
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ManagedClusters class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ContainerServiceClient] reference to the ContainerServiceClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a list of managed clusters in the specified subscription.
26
+ #
27
+ # Gets a list of managed clusters in the specified subscription. The operation
28
+ # returns properties of each managed cluster.
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<ManagedCluster>] operation results.
34
+ #
35
+ def list(custom_headers:nil)
36
+ first_page = list_as_lazy(custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets a list of managed clusters in the specified subscription.
42
+ #
43
+ # Gets a list of managed clusters in the specified subscription. The operation
44
+ # returns properties of each managed cluster.
45
+ #
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(custom_headers:nil)
52
+ list_async(custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets a list of managed clusters in the specified subscription.
57
+ #
58
+ # Gets a list of managed clusters in the specified subscription. The operation
59
+ # returns properties of each managed cluster.
60
+ #
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(custom_headers:nil)
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+
70
+
71
+ request_headers = {}
72
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
73
+
74
+ # Set Headers
75
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'
78
+
79
+ request_url = @base_url || @client.base_url
80
+
81
+ options = {
82
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
83
+ path_params: {'subscriptionId' => @client.subscription_id},
84
+ query_params: {'api-version' => @client.api_version},
85
+ headers: request_headers.merge(custom_headers || {}),
86
+ base_url: request_url
87
+ }
88
+ promise = @client.make_request_async(:get, path_template, options)
89
+
90
+ promise = promise.then do |result|
91
+ http_response = result.response
92
+ status_code = http_response.status
93
+ response_content = http_response.body
94
+ unless status_code == 200
95
+ error_model = JSON.load(response_content)
96
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
97
+ end
98
+
99
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedClusterListResult.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Lists managed clusters in the specified subscription and resource group.
119
+ #
120
+ # Lists managed clusters in the specified subscription and resource group. The
121
+ # operation returns properties of each managed cluster.
122
+ #
123
+ # @param resource_group_name [String] The name of the resource group.
124
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
125
+ # will be added to the HTTP request.
126
+ #
127
+ # @return [Array<ManagedCluster>] operation results.
128
+ #
129
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
130
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
131
+ first_page.get_all_items
132
+ end
133
+
134
+ #
135
+ # Lists managed clusters in the specified subscription and resource group.
136
+ #
137
+ # Lists managed clusters in the specified subscription and resource group. The
138
+ # operation returns properties of each managed cluster.
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
145
+ #
146
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
147
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
148
+ end
149
+
150
+ #
151
+ # Lists managed clusters in the specified subscription and resource group.
152
+ #
153
+ # Lists managed clusters in the specified subscription and resource group. The
154
+ # operation returns properties of each managed cluster.
155
+ #
156
+ # @param resource_group_name [String] The name of the resource group.
157
+ # @param [Hash{String => String}] A hash of custom headers that will be added
158
+ # to the HTTP request.
159
+ #
160
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
+ #
162
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
163
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
164
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
165
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
166
+
167
+
168
+ request_headers = {}
169
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
170
+
171
+ # Set Headers
172
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
173
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
174
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'
175
+
176
+ request_url = @base_url || @client.base_url
177
+
178
+ options = {
179
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
180
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
181
+ query_params: {'api-version' => @client.api_version},
182
+ headers: request_headers.merge(custom_headers || {}),
183
+ base_url: request_url
184
+ }
185
+ promise = @client.make_request_async(:get, path_template, options)
186
+
187
+ promise = promise.then do |result|
188
+ http_response = result.response
189
+ status_code = http_response.status
190
+ response_content = http_response.body
191
+ unless status_code == 200
192
+ error_model = JSON.load(response_content)
193
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
194
+ end
195
+
196
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
197
+ # Deserialize Response
198
+ if status_code == 200
199
+ begin
200
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
201
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedClusterListResult.mapper()
202
+ result.body = @client.deserialize(result_mapper, parsed_response)
203
+ rescue Exception => e
204
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
205
+ end
206
+ end
207
+
208
+ result
209
+ end
210
+
211
+ promise.execute
212
+ end
213
+
214
+ #
215
+ # Gets upgrade profile for a managed cluster.
216
+ #
217
+ # Gets the details of the upgrade profile for a managed cluster with a
218
+ # specified resource group and name.
219
+ #
220
+ # @param resource_group_name [String] The name of the resource group.
221
+ # @param resource_name [String] The name of the managed cluster resource.
222
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
223
+ # will be added to the HTTP request.
224
+ #
225
+ # @return [ManagedClusterUpgradeProfile] operation results.
226
+ #
227
+ def get_upgrade_profile(resource_group_name, resource_name, custom_headers:nil)
228
+ response = get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
229
+ response.body unless response.nil?
230
+ end
231
+
232
+ #
233
+ # Gets upgrade profile for a managed cluster.
234
+ #
235
+ # Gets the details of the upgrade profile for a managed cluster with a
236
+ # specified resource group and name.
237
+ #
238
+ # @param resource_group_name [String] The name of the resource group.
239
+ # @param resource_name [String] The name of the managed cluster resource.
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
244
+ #
245
+ def get_upgrade_profile_with_http_info(resource_group_name, resource_name, custom_headers:nil)
246
+ get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
247
+ end
248
+
249
+ #
250
+ # Gets upgrade profile for a managed cluster.
251
+ #
252
+ # Gets the details of the upgrade profile for a managed cluster with a
253
+ # specified resource group and name.
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group.
256
+ # @param resource_name [String] The name of the managed cluster resource.
257
+ # @param [Hash{String => String}] A hash of custom headers that will be added
258
+ # to the HTTP request.
259
+ #
260
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
261
+ #
262
+ def get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:nil)
263
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
264
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
265
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
266
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
267
+
268
+
269
+ request_headers = {}
270
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
271
+
272
+ # Set Headers
273
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
274
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
275
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'
276
+
277
+ request_url = @base_url || @client.base_url
278
+
279
+ options = {
280
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
281
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
282
+ query_params: {'api-version' => @client.api_version},
283
+ headers: request_headers.merge(custom_headers || {}),
284
+ base_url: request_url
285
+ }
286
+ promise = @client.make_request_async(:get, path_template, options)
287
+
288
+ promise = promise.then do |result|
289
+ http_response = result.response
290
+ status_code = http_response.status
291
+ response_content = http_response.body
292
+ unless status_code == 200
293
+ error_model = JSON.load(response_content)
294
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
295
+ end
296
+
297
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
298
+ # Deserialize Response
299
+ if status_code == 200
300
+ begin
301
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
302
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedClusterUpgradeProfile.mapper()
303
+ result.body = @client.deserialize(result_mapper, parsed_response)
304
+ rescue Exception => e
305
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
306
+ end
307
+ end
308
+
309
+ result
310
+ end
311
+
312
+ promise.execute
313
+ end
314
+
315
+ #
316
+ # Gets an access profile of a managed cluster.
317
+ #
318
+ # Gets the accessProfile for the specified role name of the managed cluster
319
+ # with a specified resource group and name.
320
+ #
321
+ # @param resource_group_name [String] The name of the resource group.
322
+ # @param resource_name [String] The name of the managed cluster resource.
323
+ # @param role_name [String] The name of the role for managed cluster
324
+ # accessProfile resource.
325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
+ # will be added to the HTTP request.
327
+ #
328
+ # @return [ManagedClusterAccessProfile] operation results.
329
+ #
330
+ def get_access_profile(resource_group_name, resource_name, role_name, custom_headers:nil)
331
+ response = get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:custom_headers).value!
332
+ response.body unless response.nil?
333
+ end
334
+
335
+ #
336
+ # Gets an access profile of a managed cluster.
337
+ #
338
+ # Gets the accessProfile for the specified role name of the managed cluster
339
+ # with a specified resource group and name.
340
+ #
341
+ # @param resource_group_name [String] The name of the resource group.
342
+ # @param resource_name [String] The name of the managed cluster resource.
343
+ # @param role_name [String] The name of the role for managed cluster
344
+ # accessProfile resource.
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
349
+ #
350
+ def get_access_profile_with_http_info(resource_group_name, resource_name, role_name, custom_headers:nil)
351
+ get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:custom_headers).value!
352
+ end
353
+
354
+ #
355
+ # Gets an access profile of a managed cluster.
356
+ #
357
+ # Gets the accessProfile for the specified role name of the managed cluster
358
+ # with a specified resource group and name.
359
+ #
360
+ # @param resource_group_name [String] The name of the resource group.
361
+ # @param resource_name [String] The name of the managed cluster resource.
362
+ # @param role_name [String] The name of the role for managed cluster
363
+ # accessProfile resource.
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 get_access_profile_async(resource_group_name, resource_name, role_name, 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
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
373
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
374
+ fail ArgumentError, 'role_name is nil' if role_name.nil?
375
+
376
+
377
+ request_headers = {}
378
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
379
+
380
+ # Set Headers
381
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
382
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
383
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'
384
+
385
+ request_url = @base_url || @client.base_url
386
+
387
+ options = {
388
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
389
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'roleName' => role_name},
390
+ query_params: {'api-version' => @client.api_version},
391
+ headers: request_headers.merge(custom_headers || {}),
392
+ base_url: request_url
393
+ }
394
+ promise = @client.make_request_async(:post, path_template, options)
395
+
396
+ promise = promise.then do |result|
397
+ http_response = result.response
398
+ status_code = http_response.status
399
+ response_content = http_response.body
400
+ unless status_code == 200
401
+ error_model = JSON.load(response_content)
402
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
403
+ end
404
+
405
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
406
+ # Deserialize Response
407
+ if status_code == 200
408
+ begin
409
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
410
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedClusterAccessProfile.mapper()
411
+ result.body = @client.deserialize(result_mapper, parsed_response)
412
+ rescue Exception => e
413
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
414
+ end
415
+ end
416
+
417
+ result
418
+ end
419
+
420
+ promise.execute
421
+ end
422
+
423
+ #
424
+ # Gets a managed cluster.
425
+ #
426
+ # Gets the details of the managed cluster with a specified resource group and
427
+ # name.
428
+ #
429
+ # @param resource_group_name [String] The name of the resource group.
430
+ # @param resource_name [String] The name of the managed cluster resource.
431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
+ # will be added to the HTTP request.
433
+ #
434
+ # @return [ManagedCluster] operation results.
435
+ #
436
+ def get(resource_group_name, resource_name, custom_headers:nil)
437
+ response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
438
+ response.body unless response.nil?
439
+ end
440
+
441
+ #
442
+ # Gets a managed cluster.
443
+ #
444
+ # Gets the details of the managed cluster with a specified resource group and
445
+ # name.
446
+ #
447
+ # @param resource_group_name [String] The name of the resource group.
448
+ # @param resource_name [String] The name of the managed cluster resource.
449
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
450
+ # will be added to the HTTP request.
451
+ #
452
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
453
+ #
454
+ def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
455
+ get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
456
+ end
457
+
458
+ #
459
+ # Gets a managed cluster.
460
+ #
461
+ # Gets the details of the managed cluster with a specified resource group and
462
+ # name.
463
+ #
464
+ # @param resource_group_name [String] The name of the resource group.
465
+ # @param resource_name [String] The name of the managed cluster resource.
466
+ # @param [Hash{String => String}] A hash of custom headers that will be added
467
+ # to the HTTP request.
468
+ #
469
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
470
+ #
471
+ def get_async(resource_group_name, resource_name, custom_headers:nil)
472
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
473
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
474
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
475
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
476
+
477
+
478
+ request_headers = {}
479
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
480
+
481
+ # Set Headers
482
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
483
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
484
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
485
+
486
+ request_url = @base_url || @client.base_url
487
+
488
+ options = {
489
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
490
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
491
+ query_params: {'api-version' => @client.api_version},
492
+ headers: request_headers.merge(custom_headers || {}),
493
+ base_url: request_url
494
+ }
495
+ promise = @client.make_request_async(:get, path_template, options)
496
+
497
+ promise = promise.then do |result|
498
+ http_response = result.response
499
+ status_code = http_response.status
500
+ response_content = http_response.body
501
+ unless status_code == 200
502
+ error_model = JSON.load(response_content)
503
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
504
+ end
505
+
506
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
507
+ # Deserialize Response
508
+ if status_code == 200
509
+ begin
510
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
511
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
512
+ result.body = @client.deserialize(result_mapper, parsed_response)
513
+ rescue Exception => e
514
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
515
+ end
516
+ end
517
+
518
+ result
519
+ end
520
+
521
+ promise.execute
522
+ end
523
+
524
+ #
525
+ # Creates or updates a managed cluster.
526
+ #
527
+ # Creates or updates a managed cluster with the specified configuration for
528
+ # agents and Kubernetes version.
529
+ #
530
+ # @param resource_group_name [String] The name of the resource group.
531
+ # @param resource_name [String] The name of the managed cluster resource.
532
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
533
+ # Update a Managed Cluster operation.
534
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
535
+ # will be added to the HTTP request.
536
+ #
537
+ # @return [ManagedCluster] operation results.
538
+ #
539
+ def create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
540
+ response = create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
541
+ response.body unless response.nil?
542
+ end
543
+
544
+ #
545
+ # @param resource_group_name [String] The name of the resource group.
546
+ # @param resource_name [String] The name of the managed cluster resource.
547
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
548
+ # Update a Managed Cluster operation.
549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
550
+ # will be added to the HTTP request.
551
+ #
552
+ # @return [Concurrent::Promise] promise which provides async access to http
553
+ # response.
554
+ #
555
+ def create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
556
+ # Send request
557
+ promise = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
558
+
559
+ promise = promise.then do |response|
560
+ # Defining deserialization method.
561
+ deserialize_method = lambda do |parsed_response|
562
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
563
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
564
+ end
565
+
566
+ # Waiting for response.
567
+ @client.get_long_running_operation_result(response, deserialize_method)
568
+ end
569
+
570
+ promise
571
+ end
572
+
573
+ #
574
+ # Updates tags on a managed cluster.
575
+ #
576
+ # Updates a managed cluster with the specified tags.
577
+ #
578
+ # @param resource_group_name [String] The name of the resource group.
579
+ # @param resource_name [String] The name of the managed cluster resource.
580
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
581
+ # Cluster Tags operation.
582
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
583
+ # will be added to the HTTP request.
584
+ #
585
+ # @return [ManagedCluster] operation results.
586
+ #
587
+ def update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
588
+ response = update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
589
+ response.body unless response.nil?
590
+ end
591
+
592
+ #
593
+ # @param resource_group_name [String] The name of the resource group.
594
+ # @param resource_name [String] The name of the managed cluster resource.
595
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
596
+ # Cluster Tags operation.
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ # @return [Concurrent::Promise] promise which provides async access to http
601
+ # response.
602
+ #
603
+ def update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
604
+ # Send request
605
+ promise = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
606
+
607
+ promise = promise.then do |response|
608
+ # Defining deserialization method.
609
+ deserialize_method = lambda do |parsed_response|
610
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
611
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
612
+ end
613
+
614
+ # Waiting for response.
615
+ @client.get_long_running_operation_result(response, deserialize_method)
616
+ end
617
+
618
+ promise
619
+ end
620
+
621
+ #
622
+ # Deletes a managed cluster.
623
+ #
624
+ # Deletes the managed cluster with a specified resource group and name.
625
+ #
626
+ # @param resource_group_name [String] The name of the resource group.
627
+ # @param resource_name [String] The name of the managed cluster resource.
628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
+ # will be added to the HTTP request.
630
+ #
631
+ def delete(resource_group_name, resource_name, custom_headers:nil)
632
+ response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
633
+ nil
634
+ end
635
+
636
+ #
637
+ # @param resource_group_name [String] The name of the resource group.
638
+ # @param resource_name [String] The name of the managed cluster resource.
639
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
640
+ # will be added to the HTTP request.
641
+ #
642
+ # @return [Concurrent::Promise] promise which provides async access to http
643
+ # response.
644
+ #
645
+ def delete_async(resource_group_name, resource_name, custom_headers:nil)
646
+ # Send request
647
+ promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
648
+
649
+ promise = promise.then do |response|
650
+ # Defining deserialization method.
651
+ deserialize_method = lambda do |parsed_response|
652
+ end
653
+
654
+ # Waiting for response.
655
+ @client.get_long_running_operation_result(response, deserialize_method)
656
+ end
657
+
658
+ promise
659
+ end
660
+
661
+ #
662
+ # Creates or updates a managed cluster.
663
+ #
664
+ # Creates or updates a managed cluster with the specified configuration for
665
+ # agents and Kubernetes version.
666
+ #
667
+ # @param resource_group_name [String] The name of the resource group.
668
+ # @param resource_name [String] The name of the managed cluster resource.
669
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
670
+ # Update a Managed Cluster operation.
671
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
672
+ # will be added to the HTTP request.
673
+ #
674
+ # @return [ManagedCluster] operation results.
675
+ #
676
+ def begin_create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
677
+ response = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
678
+ response.body unless response.nil?
679
+ end
680
+
681
+ #
682
+ # Creates or updates a managed cluster.
683
+ #
684
+ # Creates or updates a managed cluster with the specified configuration for
685
+ # agents and Kubernetes version.
686
+ #
687
+ # @param resource_group_name [String] The name of the resource group.
688
+ # @param resource_name [String] The name of the managed cluster resource.
689
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
690
+ # Update a Managed Cluster operation.
691
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
692
+ # will be added to the HTTP request.
693
+ #
694
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
695
+ #
696
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
697
+ begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
698
+ end
699
+
700
+ #
701
+ # Creates or updates a managed cluster.
702
+ #
703
+ # Creates or updates a managed cluster with the specified configuration for
704
+ # agents and Kubernetes version.
705
+ #
706
+ # @param resource_group_name [String] The name of the resource group.
707
+ # @param resource_name [String] The name of the managed cluster resource.
708
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
709
+ # Update a Managed Cluster operation.
710
+ # @param [Hash{String => String}] A hash of custom headers that will be added
711
+ # to the HTTP request.
712
+ #
713
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
714
+ #
715
+ def begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
716
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
717
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
718
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
719
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
720
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
721
+
722
+
723
+ request_headers = {}
724
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
725
+
726
+ # Set Headers
727
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
728
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
729
+
730
+ # Serialize Request
731
+ request_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
732
+ request_content = @client.serialize(request_mapper, parameters)
733
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
734
+
735
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
736
+
737
+ request_url = @base_url || @client.base_url
738
+
739
+ options = {
740
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
741
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
742
+ query_params: {'api-version' => @client.api_version},
743
+ body: request_content,
744
+ headers: request_headers.merge(custom_headers || {}),
745
+ base_url: request_url
746
+ }
747
+ promise = @client.make_request_async(:put, path_template, options)
748
+
749
+ promise = promise.then do |result|
750
+ http_response = result.response
751
+ status_code = http_response.status
752
+ response_content = http_response.body
753
+ unless status_code == 200 || status_code == 201
754
+ error_model = JSON.load(response_content)
755
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
756
+ end
757
+
758
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
759
+ # Deserialize Response
760
+ if status_code == 200
761
+ begin
762
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
763
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
764
+ result.body = @client.deserialize(result_mapper, parsed_response)
765
+ rescue Exception => e
766
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
767
+ end
768
+ end
769
+ # Deserialize Response
770
+ if status_code == 201
771
+ begin
772
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
773
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
774
+ result.body = @client.deserialize(result_mapper, parsed_response)
775
+ rescue Exception => e
776
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
777
+ end
778
+ end
779
+
780
+ result
781
+ end
782
+
783
+ promise.execute
784
+ end
785
+
786
+ #
787
+ # Updates tags on a managed cluster.
788
+ #
789
+ # Updates a managed cluster with the specified tags.
790
+ #
791
+ # @param resource_group_name [String] The name of the resource group.
792
+ # @param resource_name [String] The name of the managed cluster resource.
793
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
794
+ # Cluster Tags operation.
795
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
796
+ # will be added to the HTTP request.
797
+ #
798
+ # @return [ManagedCluster] operation results.
799
+ #
800
+ def begin_update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
801
+ response = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
802
+ response.body unless response.nil?
803
+ end
804
+
805
+ #
806
+ # Updates tags on a managed cluster.
807
+ #
808
+ # Updates a managed cluster with the specified tags.
809
+ #
810
+ # @param resource_group_name [String] The name of the resource group.
811
+ # @param resource_name [String] The name of the managed cluster resource.
812
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
813
+ # Cluster Tags operation.
814
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
815
+ # will be added to the HTTP request.
816
+ #
817
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
818
+ #
819
+ def begin_update_tags_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
820
+ begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
821
+ end
822
+
823
+ #
824
+ # Updates tags on a managed cluster.
825
+ #
826
+ # Updates a managed cluster with the specified tags.
827
+ #
828
+ # @param resource_group_name [String] The name of the resource group.
829
+ # @param resource_name [String] The name of the managed cluster resource.
830
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
831
+ # Cluster Tags operation.
832
+ # @param [Hash{String => String}] A hash of custom headers that will be added
833
+ # to the HTTP request.
834
+ #
835
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
836
+ #
837
+ def begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
838
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
839
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
840
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
841
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
842
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
843
+
844
+
845
+ request_headers = {}
846
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
847
+
848
+ # Set Headers
849
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
850
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
851
+
852
+ # Serialize Request
853
+ request_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::TagsObject.mapper()
854
+ request_content = @client.serialize(request_mapper, parameters)
855
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
856
+
857
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
858
+
859
+ request_url = @base_url || @client.base_url
860
+
861
+ options = {
862
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
863
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
864
+ query_params: {'api-version' => @client.api_version},
865
+ body: request_content,
866
+ headers: request_headers.merge(custom_headers || {}),
867
+ base_url: request_url
868
+ }
869
+ promise = @client.make_request_async(:patch, path_template, options)
870
+
871
+ promise = promise.then do |result|
872
+ http_response = result.response
873
+ status_code = http_response.status
874
+ response_content = http_response.body
875
+ unless status_code == 200
876
+ error_model = JSON.load(response_content)
877
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
878
+ end
879
+
880
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
881
+ # Deserialize Response
882
+ if status_code == 200
883
+ begin
884
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
885
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedCluster.mapper()
886
+ result.body = @client.deserialize(result_mapper, parsed_response)
887
+ rescue Exception => e
888
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
889
+ end
890
+ end
891
+
892
+ result
893
+ end
894
+
895
+ promise.execute
896
+ end
897
+
898
+ #
899
+ # Deletes a managed cluster.
900
+ #
901
+ # Deletes the managed cluster with a specified resource group and name.
902
+ #
903
+ # @param resource_group_name [String] The name of the resource group.
904
+ # @param resource_name [String] The name of the managed cluster resource.
905
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
906
+ # will be added to the HTTP request.
907
+ #
908
+ #
909
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
910
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
911
+ nil
912
+ end
913
+
914
+ #
915
+ # Deletes a managed cluster.
916
+ #
917
+ # Deletes the managed cluster with a specified resource group and name.
918
+ #
919
+ # @param resource_group_name [String] The name of the resource group.
920
+ # @param resource_name [String] The name of the managed cluster resource.
921
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
922
+ # will be added to the HTTP request.
923
+ #
924
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
925
+ #
926
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
927
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
928
+ end
929
+
930
+ #
931
+ # Deletes a managed cluster.
932
+ #
933
+ # Deletes the managed cluster with a specified resource group and name.
934
+ #
935
+ # @param resource_group_name [String] The name of the resource group.
936
+ # @param resource_name [String] The name of the managed cluster resource.
937
+ # @param [Hash{String => String}] A hash of custom headers that will be added
938
+ # to the HTTP request.
939
+ #
940
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
941
+ #
942
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
943
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
944
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
945
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
946
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
947
+
948
+
949
+ request_headers = {}
950
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
951
+
952
+ # Set Headers
953
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
954
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
955
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
956
+
957
+ request_url = @base_url || @client.base_url
958
+
959
+ options = {
960
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
961
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
962
+ query_params: {'api-version' => @client.api_version},
963
+ headers: request_headers.merge(custom_headers || {}),
964
+ base_url: request_url
965
+ }
966
+ promise = @client.make_request_async(:delete, path_template, options)
967
+
968
+ promise = promise.then do |result|
969
+ http_response = result.response
970
+ status_code = http_response.status
971
+ response_content = http_response.body
972
+ unless status_code == 202 || status_code == 204
973
+ error_model = JSON.load(response_content)
974
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
975
+ end
976
+
977
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
978
+
979
+ result
980
+ end
981
+
982
+ promise.execute
983
+ end
984
+
985
+ #
986
+ # Gets a list of managed clusters in the specified subscription.
987
+ #
988
+ # Gets a list of managed clusters in the specified subscription. The operation
989
+ # returns properties of each managed cluster.
990
+ #
991
+ # @param next_page_link [String] The NextLink from the previous successful call
992
+ # to List operation.
993
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
994
+ # will be added to the HTTP request.
995
+ #
996
+ # @return [ManagedClusterListResult] operation results.
997
+ #
998
+ def list_next(next_page_link, custom_headers:nil)
999
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1000
+ response.body unless response.nil?
1001
+ end
1002
+
1003
+ #
1004
+ # Gets a list of managed clusters in the specified subscription.
1005
+ #
1006
+ # Gets a list of managed clusters in the specified subscription. The operation
1007
+ # returns properties of each managed cluster.
1008
+ #
1009
+ # @param next_page_link [String] The NextLink from the previous successful call
1010
+ # to List operation.
1011
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1012
+ # will be added to the HTTP request.
1013
+ #
1014
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1015
+ #
1016
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1017
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1018
+ end
1019
+
1020
+ #
1021
+ # Gets a list of managed clusters in the specified subscription.
1022
+ #
1023
+ # Gets a list of managed clusters in the specified subscription. The operation
1024
+ # returns properties of each managed cluster.
1025
+ #
1026
+ # @param next_page_link [String] The NextLink from the previous successful call
1027
+ # to List operation.
1028
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1029
+ # to the HTTP request.
1030
+ #
1031
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1032
+ #
1033
+ def list_next_async(next_page_link, custom_headers:nil)
1034
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1035
+
1036
+
1037
+ request_headers = {}
1038
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1039
+
1040
+ # Set Headers
1041
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1042
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1043
+ path_template = '{nextLink}'
1044
+
1045
+ request_url = @base_url || @client.base_url
1046
+
1047
+ options = {
1048
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1049
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1050
+ headers: request_headers.merge(custom_headers || {}),
1051
+ base_url: request_url
1052
+ }
1053
+ promise = @client.make_request_async(:get, path_template, options)
1054
+
1055
+ promise = promise.then do |result|
1056
+ http_response = result.response
1057
+ status_code = http_response.status
1058
+ response_content = http_response.body
1059
+ unless status_code == 200
1060
+ error_model = JSON.load(response_content)
1061
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1062
+ end
1063
+
1064
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1065
+ # Deserialize Response
1066
+ if status_code == 200
1067
+ begin
1068
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1069
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedClusterListResult.mapper()
1070
+ result.body = @client.deserialize(result_mapper, parsed_response)
1071
+ rescue Exception => e
1072
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1073
+ end
1074
+ end
1075
+
1076
+ result
1077
+ end
1078
+
1079
+ promise.execute
1080
+ end
1081
+
1082
+ #
1083
+ # Lists managed clusters in the specified subscription and resource group.
1084
+ #
1085
+ # Lists managed clusters in the specified subscription and resource group. The
1086
+ # operation returns properties of each managed cluster.
1087
+ #
1088
+ # @param next_page_link [String] The NextLink from the previous successful call
1089
+ # to List operation.
1090
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1091
+ # will be added to the HTTP request.
1092
+ #
1093
+ # @return [ManagedClusterListResult] operation results.
1094
+ #
1095
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1096
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1097
+ response.body unless response.nil?
1098
+ end
1099
+
1100
+ #
1101
+ # Lists managed clusters in the specified subscription and resource group.
1102
+ #
1103
+ # Lists managed clusters in the specified subscription and resource group. The
1104
+ # operation returns properties of each managed cluster.
1105
+ #
1106
+ # @param next_page_link [String] The NextLink from the previous successful call
1107
+ # to List operation.
1108
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1109
+ # will be added to the HTTP request.
1110
+ #
1111
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1112
+ #
1113
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1114
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1115
+ end
1116
+
1117
+ #
1118
+ # Lists managed clusters in the specified subscription and resource group.
1119
+ #
1120
+ # Lists managed clusters in the specified subscription and resource group. The
1121
+ # operation returns properties of each managed cluster.
1122
+ #
1123
+ # @param next_page_link [String] The NextLink from the previous successful call
1124
+ # to List operation.
1125
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1126
+ # to the HTTP request.
1127
+ #
1128
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1129
+ #
1130
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1131
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1132
+
1133
+
1134
+ request_headers = {}
1135
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1136
+
1137
+ # Set Headers
1138
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1139
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1140
+ path_template = '{nextLink}'
1141
+
1142
+ request_url = @base_url || @client.base_url
1143
+
1144
+ options = {
1145
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1146
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1147
+ headers: request_headers.merge(custom_headers || {}),
1148
+ base_url: request_url
1149
+ }
1150
+ promise = @client.make_request_async(:get, path_template, options)
1151
+
1152
+ promise = promise.then do |result|
1153
+ http_response = result.response
1154
+ status_code = http_response.status
1155
+ response_content = http_response.body
1156
+ unless status_code == 200
1157
+ error_model = JSON.load(response_content)
1158
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1159
+ end
1160
+
1161
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1162
+ # Deserialize Response
1163
+ if status_code == 200
1164
+ begin
1165
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1166
+ result_mapper = Azure::ContainerService::Mgmt::V2018_03_31::Models::ManagedClusterListResult.mapper()
1167
+ result.body = @client.deserialize(result_mapper, parsed_response)
1168
+ rescue Exception => e
1169
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1170
+ end
1171
+ end
1172
+
1173
+ result
1174
+ end
1175
+
1176
+ promise.execute
1177
+ end
1178
+
1179
+ #
1180
+ # Gets a list of managed clusters in the specified subscription.
1181
+ #
1182
+ # Gets a list of managed clusters in the specified subscription. The operation
1183
+ # returns properties of each managed cluster.
1184
+ #
1185
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1186
+ # will be added to the HTTP request.
1187
+ #
1188
+ # @return [ManagedClusterListResult] which provide lazy access to pages of the
1189
+ # response.
1190
+ #
1191
+ def list_as_lazy(custom_headers:nil)
1192
+ response = list_async(custom_headers:custom_headers).value!
1193
+ unless response.nil?
1194
+ page = response.body
1195
+ page.next_method = Proc.new do |next_page_link|
1196
+ list_next_async(next_page_link, custom_headers:custom_headers)
1197
+ end
1198
+ page
1199
+ end
1200
+ end
1201
+
1202
+ #
1203
+ # Lists managed clusters in the specified subscription and resource group.
1204
+ #
1205
+ # Lists managed clusters in the specified subscription and resource group. The
1206
+ # operation returns properties of each managed cluster.
1207
+ #
1208
+ # @param resource_group_name [String] The name of the resource group.
1209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1210
+ # will be added to the HTTP request.
1211
+ #
1212
+ # @return [ManagedClusterListResult] which provide lazy access to pages of the
1213
+ # response.
1214
+ #
1215
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1216
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1217
+ unless response.nil?
1218
+ page = response.body
1219
+ page.next_method = Proc.new do |next_page_link|
1220
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1221
+ end
1222
+ page
1223
+ end
1224
+ end
1225
+
1226
+ end
1227
+ end