azure_mgmt_kubernetes_configuration 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/source_control_configuration_client.rb +1 -1
  3. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration.rb +50 -0
  4. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/azure_entity_resource.rb +77 -0
  5. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/compliance_state_type.rb +19 -0
  6. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/compliance_status.rb +83 -0
  7. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/created_by_type.rb +18 -0
  8. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/error_definition.rb +58 -0
  9. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/error_response.rb +47 -0
  10. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/helm_operator_properties.rb +57 -0
  11. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/message_level_type.rb +17 -0
  12. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/operator_scope_type.rb +16 -0
  13. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/operator_type.rb +15 -0
  14. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/provisioning_state_type.rb +19 -0
  15. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/proxy_resource.rb +65 -0
  16. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource.rb +86 -0
  17. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation.rb +73 -0
  18. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation_display.rb +79 -0
  19. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation_list.rb +100 -0
  20. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/result.rb +46 -0
  21. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/source_control_configuration.rb +247 -0
  22. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/source_control_configuration_list.rb +104 -0
  23. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/system_data.rb +105 -0
  24. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/tracked_resource.rb +95 -0
  25. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/module_definition.rb +9 -0
  26. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/operations.rb +227 -0
  27. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/source_control_configuration_client.rb +136 -0
  28. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/source_control_configurations.rb +722 -0
  29. data/lib/azure_mgmt_kubernetes_configuration.rb +1 -0
  30. data/lib/profiles/latest/modules/kubernetesconfiguration_profile_module.rb +67 -55
  31. data/lib/version.rb +1 -1
  32. metadata +29 -3
@@ -0,0 +1,722 @@
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::KubernetesConfiguration::Mgmt::V2021_03_01
7
+ #
8
+ # Use these APIs to create Source Control Configuration resources through
9
+ # ARM, for Kubernetes Clusters.
10
+ #
11
+ class SourceControlConfigurations
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the SourceControlConfigurations class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [SourceControlConfigurationClient] reference to the SourceControlConfigurationClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets details of the Source Control Configuration.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
30
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
31
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
32
+ # 'Microsoft.Kubernetes'
33
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
34
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
35
+ # K8S clusters). Possible values include: 'managedClusters',
36
+ # 'connectedClusters'
37
+ # @param cluster_name [String] The name of the kubernetes cluster.
38
+ # @param source_control_configuration_name [String] Name of the Source Control
39
+ # Configuration.
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [SourceControlConfiguration] operation results.
44
+ #
45
+ def get(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
46
+ response = get_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:custom_headers).value!
47
+ response.body unless response.nil?
48
+ end
49
+
50
+ #
51
+ # Gets details of the Source Control Configuration.
52
+ #
53
+ # @param resource_group_name [String] The name of the resource group.
54
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
55
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
56
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
57
+ # 'Microsoft.Kubernetes'
58
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
59
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
60
+ # K8S clusters). Possible values include: 'managedClusters',
61
+ # 'connectedClusters'
62
+ # @param cluster_name [String] The name of the kubernetes cluster.
63
+ # @param source_control_configuration_name [String] Name of the Source Control
64
+ # Configuration.
65
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
66
+ # will be added to the HTTP request.
67
+ #
68
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
69
+ #
70
+ def get_with_http_info(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
71
+ get_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:custom_headers).value!
72
+ end
73
+
74
+ #
75
+ # Gets details of the Source Control Configuration.
76
+ #
77
+ # @param resource_group_name [String] The name of the resource group.
78
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
79
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
80
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
81
+ # 'Microsoft.Kubernetes'
82
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
83
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
84
+ # K8S clusters). Possible values include: 'managedClusters',
85
+ # 'connectedClusters'
86
+ # @param cluster_name [String] The name of the kubernetes cluster.
87
+ # @param source_control_configuration_name [String] Name of the Source Control
88
+ # Configuration.
89
+ # @param [Hash{String => String}] A hash of custom headers that will be added
90
+ # to the HTTP request.
91
+ #
92
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
93
+ #
94
+ def get_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
95
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
96
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
97
+ fail ArgumentError, 'cluster_rp is nil' if cluster_rp.nil?
98
+ fail ArgumentError, 'cluster_resource_name is nil' if cluster_resource_name.nil?
99
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
100
+ fail ArgumentError, 'source_control_configuration_name is nil' if source_control_configuration_name.nil?
101
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
102
+
103
+
104
+ request_headers = {}
105
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
106
+
107
+ # Set Headers
108
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
109
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
110
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'
111
+
112
+ request_url = @base_url || @client.base_url
113
+
114
+ options = {
115
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
116
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterRp' => cluster_rp,'clusterResourceName' => cluster_resource_name,'clusterName' => cluster_name,'sourceControlConfigurationName' => source_control_configuration_name},
117
+ query_params: {'api-version' => @client.api_version},
118
+ headers: request_headers.merge(custom_headers || {}),
119
+ base_url: request_url
120
+ }
121
+ promise = @client.make_request_async(:get, path_template, options)
122
+
123
+ promise = promise.then do |result|
124
+ http_response = result.response
125
+ status_code = http_response.status
126
+ response_content = http_response.body
127
+ unless status_code == 200
128
+ error_model = JSON.load(response_content)
129
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
130
+ end
131
+
132
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
133
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
134
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
135
+ # Deserialize Response
136
+ if status_code == 200
137
+ begin
138
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
139
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::SourceControlConfiguration.mapper()
140
+ result.body = @client.deserialize(result_mapper, parsed_response)
141
+ rescue Exception => e
142
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
143
+ end
144
+ end
145
+
146
+ result
147
+ end
148
+
149
+ promise.execute
150
+ end
151
+
152
+ #
153
+ # Create a new Kubernetes Source Control Configuration.
154
+ #
155
+ # @param resource_group_name [String] The name of the resource group.
156
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
157
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
158
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
159
+ # 'Microsoft.Kubernetes'
160
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
161
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
162
+ # K8S clusters). Possible values include: 'managedClusters',
163
+ # 'connectedClusters'
164
+ # @param cluster_name [String] The name of the kubernetes cluster.
165
+ # @param source_control_configuration_name [String] Name of the Source Control
166
+ # Configuration.
167
+ # @param source_control_configuration [SourceControlConfiguration] Properties
168
+ # necessary to Create KubernetesConfiguration.
169
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
170
+ # will be added to the HTTP request.
171
+ #
172
+ # @return [SourceControlConfiguration] operation results.
173
+ #
174
+ def create_or_update(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers:nil)
175
+ response = create_or_update_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers:custom_headers).value!
176
+ response.body unless response.nil?
177
+ end
178
+
179
+ #
180
+ # Create a new Kubernetes Source Control Configuration.
181
+ #
182
+ # @param resource_group_name [String] The name of the resource group.
183
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
184
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
185
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
186
+ # 'Microsoft.Kubernetes'
187
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
188
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
189
+ # K8S clusters). Possible values include: 'managedClusters',
190
+ # 'connectedClusters'
191
+ # @param cluster_name [String] The name of the kubernetes cluster.
192
+ # @param source_control_configuration_name [String] Name of the Source Control
193
+ # Configuration.
194
+ # @param source_control_configuration [SourceControlConfiguration] Properties
195
+ # necessary to Create KubernetesConfiguration.
196
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
197
+ # will be added to the HTTP request.
198
+ #
199
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
200
+ #
201
+ def create_or_update_with_http_info(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers:nil)
202
+ create_or_update_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers:custom_headers).value!
203
+ end
204
+
205
+ #
206
+ # Create a new Kubernetes Source Control Configuration.
207
+ #
208
+ # @param resource_group_name [String] The name of the resource group.
209
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
210
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
211
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
212
+ # 'Microsoft.Kubernetes'
213
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
214
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
215
+ # K8S clusters). Possible values include: 'managedClusters',
216
+ # 'connectedClusters'
217
+ # @param cluster_name [String] The name of the kubernetes cluster.
218
+ # @param source_control_configuration_name [String] Name of the Source Control
219
+ # Configuration.
220
+ # @param source_control_configuration [SourceControlConfiguration] Properties
221
+ # necessary to Create KubernetesConfiguration.
222
+ # @param [Hash{String => String}] A hash of custom headers that will be added
223
+ # to the HTTP request.
224
+ #
225
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
226
+ #
227
+ def create_or_update_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers:nil)
228
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
229
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
230
+ fail ArgumentError, 'cluster_rp is nil' if cluster_rp.nil?
231
+ fail ArgumentError, 'cluster_resource_name is nil' if cluster_resource_name.nil?
232
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
233
+ fail ArgumentError, 'source_control_configuration_name is nil' if source_control_configuration_name.nil?
234
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
235
+ fail ArgumentError, 'source_control_configuration is nil' if source_control_configuration.nil?
236
+
237
+
238
+ request_headers = {}
239
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
240
+
241
+ # Set Headers
242
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
243
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
244
+
245
+ # Serialize Request
246
+ request_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::SourceControlConfiguration.mapper()
247
+ request_content = @client.serialize(request_mapper, source_control_configuration)
248
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
249
+
250
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'
251
+
252
+ request_url = @base_url || @client.base_url
253
+
254
+ options = {
255
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
256
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterRp' => cluster_rp,'clusterResourceName' => cluster_resource_name,'clusterName' => cluster_name,'sourceControlConfigurationName' => source_control_configuration_name},
257
+ query_params: {'api-version' => @client.api_version},
258
+ body: request_content,
259
+ headers: request_headers.merge(custom_headers || {}),
260
+ base_url: request_url
261
+ }
262
+ promise = @client.make_request_async(:put, path_template, options)
263
+
264
+ promise = promise.then do |result|
265
+ http_response = result.response
266
+ status_code = http_response.status
267
+ response_content = http_response.body
268
+ unless status_code == 200 || status_code == 201
269
+ error_model = JSON.load(response_content)
270
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
271
+ end
272
+
273
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
274
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
275
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
276
+ # Deserialize Response
277
+ if status_code == 200
278
+ begin
279
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
280
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::SourceControlConfiguration.mapper()
281
+ result.body = @client.deserialize(result_mapper, parsed_response)
282
+ rescue Exception => e
283
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
284
+ end
285
+ end
286
+ # Deserialize Response
287
+ if status_code == 201
288
+ begin
289
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
290
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::SourceControlConfiguration.mapper()
291
+ result.body = @client.deserialize(result_mapper, parsed_response)
292
+ rescue Exception => e
293
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
294
+ end
295
+ end
296
+
297
+ result
298
+ end
299
+
300
+ promise.execute
301
+ end
302
+
303
+ #
304
+ # This will delete the YAML file used to set up the Source control
305
+ # configuration, thus stopping future sync from the source repo.
306
+ #
307
+ # @param resource_group_name [String] The name of the resource group.
308
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
309
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
310
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
311
+ # 'Microsoft.Kubernetes'
312
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
313
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
314
+ # K8S clusters). Possible values include: 'managedClusters',
315
+ # 'connectedClusters'
316
+ # @param cluster_name [String] The name of the kubernetes cluster.
317
+ # @param source_control_configuration_name [String] Name of the Source Control
318
+ # Configuration.
319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
320
+ # will be added to the HTTP request.
321
+ #
322
+ def delete(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
323
+ response = delete_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:custom_headers).value!
324
+ nil
325
+ end
326
+
327
+ #
328
+ # @param resource_group_name [String] The name of the resource group.
329
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
330
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
331
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
332
+ # 'Microsoft.Kubernetes'
333
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
334
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
335
+ # K8S clusters). Possible values include: 'managedClusters',
336
+ # 'connectedClusters'
337
+ # @param cluster_name [String] The name of the kubernetes cluster.
338
+ # @param source_control_configuration_name [String] Name of the Source Control
339
+ # Configuration.
340
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
341
+ # will be added to the HTTP request.
342
+ #
343
+ # @return [Concurrent::Promise] promise which provides async access to http
344
+ # response.
345
+ #
346
+ def delete_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
347
+ # Send request
348
+ promise = begin_delete_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:custom_headers)
349
+
350
+ promise = promise.then do |response|
351
+ # Defining deserialization method.
352
+ deserialize_method = lambda do |parsed_response|
353
+ end
354
+
355
+ # Waiting for response.
356
+ @client.get_long_running_operation_result(response, deserialize_method)
357
+ end
358
+
359
+ promise
360
+ end
361
+
362
+ #
363
+ # List all Source Control Configurations.
364
+ #
365
+ # @param resource_group_name [String] The name of the resource group.
366
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
367
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
368
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
369
+ # 'Microsoft.Kubernetes'
370
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
371
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
372
+ # K8S clusters). Possible values include: 'managedClusters',
373
+ # 'connectedClusters'
374
+ # @param cluster_name [String] The name of the kubernetes cluster.
375
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
376
+ # will be added to the HTTP request.
377
+ #
378
+ # @return [Array<SourceControlConfiguration>] operation results.
379
+ #
380
+ def list(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:nil)
381
+ first_page = list_as_lazy(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:custom_headers)
382
+ first_page.get_all_items
383
+ end
384
+
385
+ #
386
+ # List all Source Control Configurations.
387
+ #
388
+ # @param resource_group_name [String] The name of the resource group.
389
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
390
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
391
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
392
+ # 'Microsoft.Kubernetes'
393
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
394
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
395
+ # K8S clusters). Possible values include: 'managedClusters',
396
+ # 'connectedClusters'
397
+ # @param cluster_name [String] The name of the kubernetes cluster.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
402
+ #
403
+ def list_with_http_info(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:nil)
404
+ list_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:custom_headers).value!
405
+ end
406
+
407
+ #
408
+ # List all Source Control Configurations.
409
+ #
410
+ # @param resource_group_name [String] The name of the resource group.
411
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
412
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
413
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
414
+ # 'Microsoft.Kubernetes'
415
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
416
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
417
+ # K8S clusters). Possible values include: 'managedClusters',
418
+ # 'connectedClusters'
419
+ # @param cluster_name [String] The name of the kubernetes cluster.
420
+ # @param [Hash{String => String}] A hash of custom headers that will be added
421
+ # to the HTTP request.
422
+ #
423
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
424
+ #
425
+ def list_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:nil)
426
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
427
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
428
+ fail ArgumentError, 'cluster_rp is nil' if cluster_rp.nil?
429
+ fail ArgumentError, 'cluster_resource_name is nil' if cluster_resource_name.nil?
430
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
431
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
432
+
433
+
434
+ request_headers = {}
435
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
436
+
437
+ # Set Headers
438
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
439
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
440
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations'
441
+
442
+ request_url = @base_url || @client.base_url
443
+
444
+ options = {
445
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
446
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterRp' => cluster_rp,'clusterResourceName' => cluster_resource_name,'clusterName' => cluster_name},
447
+ query_params: {'api-version' => @client.api_version},
448
+ headers: request_headers.merge(custom_headers || {}),
449
+ base_url: request_url
450
+ }
451
+ promise = @client.make_request_async(:get, path_template, options)
452
+
453
+ promise = promise.then do |result|
454
+ http_response = result.response
455
+ status_code = http_response.status
456
+ response_content = http_response.body
457
+ unless status_code == 200
458
+ error_model = JSON.load(response_content)
459
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
460
+ end
461
+
462
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
463
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
464
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
465
+ # Deserialize Response
466
+ if status_code == 200
467
+ begin
468
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
469
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::SourceControlConfigurationList.mapper()
470
+ result.body = @client.deserialize(result_mapper, parsed_response)
471
+ rescue Exception => e
472
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
473
+ end
474
+ end
475
+
476
+ result
477
+ end
478
+
479
+ promise.execute
480
+ end
481
+
482
+ #
483
+ # This will delete the YAML file used to set up the Source control
484
+ # configuration, thus stopping future sync from the source repo.
485
+ #
486
+ # @param resource_group_name [String] The name of the resource group.
487
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
488
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
489
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
490
+ # 'Microsoft.Kubernetes'
491
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
492
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
493
+ # K8S clusters). Possible values include: 'managedClusters',
494
+ # 'connectedClusters'
495
+ # @param cluster_name [String] The name of the kubernetes cluster.
496
+ # @param source_control_configuration_name [String] Name of the Source Control
497
+ # Configuration.
498
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
499
+ # will be added to the HTTP request.
500
+ #
501
+ #
502
+ def begin_delete(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
503
+ response = begin_delete_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:custom_headers).value!
504
+ nil
505
+ end
506
+
507
+ #
508
+ # This will delete the YAML file used to set up the Source control
509
+ # configuration, thus stopping future sync from the source repo.
510
+ #
511
+ # @param resource_group_name [String] The name of the resource group.
512
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
513
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
514
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
515
+ # 'Microsoft.Kubernetes'
516
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
517
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
518
+ # K8S clusters). Possible values include: 'managedClusters',
519
+ # 'connectedClusters'
520
+ # @param cluster_name [String] The name of the kubernetes cluster.
521
+ # @param source_control_configuration_name [String] Name of the Source Control
522
+ # Configuration.
523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
524
+ # will be added to the HTTP request.
525
+ #
526
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
527
+ #
528
+ def begin_delete_with_http_info(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
529
+ begin_delete_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:custom_headers).value!
530
+ end
531
+
532
+ #
533
+ # This will delete the YAML file used to set up the Source control
534
+ # configuration, thus stopping future sync from the source repo.
535
+ #
536
+ # @param resource_group_name [String] The name of the resource group.
537
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
538
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
539
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
540
+ # 'Microsoft.Kubernetes'
541
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
542
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
543
+ # K8S clusters). Possible values include: 'managedClusters',
544
+ # 'connectedClusters'
545
+ # @param cluster_name [String] The name of the kubernetes cluster.
546
+ # @param source_control_configuration_name [String] Name of the Source Control
547
+ # Configuration.
548
+ # @param [Hash{String => String}] A hash of custom headers that will be added
549
+ # to the HTTP request.
550
+ #
551
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
552
+ #
553
+ def begin_delete_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers:nil)
554
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
555
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
556
+ fail ArgumentError, 'cluster_rp is nil' if cluster_rp.nil?
557
+ fail ArgumentError, 'cluster_resource_name is nil' if cluster_resource_name.nil?
558
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
559
+ fail ArgumentError, 'source_control_configuration_name is nil' if source_control_configuration_name.nil?
560
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
561
+
562
+
563
+ request_headers = {}
564
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
565
+
566
+ # Set Headers
567
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
568
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
569
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'
570
+
571
+ request_url = @base_url || @client.base_url
572
+
573
+ options = {
574
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
575
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterRp' => cluster_rp,'clusterResourceName' => cluster_resource_name,'clusterName' => cluster_name,'sourceControlConfigurationName' => source_control_configuration_name},
576
+ query_params: {'api-version' => @client.api_version},
577
+ headers: request_headers.merge(custom_headers || {}),
578
+ base_url: request_url
579
+ }
580
+ promise = @client.make_request_async(:delete, path_template, options)
581
+
582
+ promise = promise.then do |result|
583
+ http_response = result.response
584
+ status_code = http_response.status
585
+ response_content = http_response.body
586
+ unless status_code == 200 || status_code == 204
587
+ error_model = JSON.load(response_content)
588
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
589
+ end
590
+
591
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
592
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
593
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
594
+
595
+ result
596
+ end
597
+
598
+ promise.execute
599
+ end
600
+
601
+ #
602
+ # List all Source Control Configurations.
603
+ #
604
+ # @param next_page_link [String] The NextLink from the previous successful call
605
+ # to List operation.
606
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
607
+ # will be added to the HTTP request.
608
+ #
609
+ # @return [SourceControlConfigurationList] operation results.
610
+ #
611
+ def list_next(next_page_link, custom_headers:nil)
612
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
613
+ response.body unless response.nil?
614
+ end
615
+
616
+ #
617
+ # List all Source Control Configurations.
618
+ #
619
+ # @param next_page_link [String] The NextLink from the previous successful call
620
+ # to List operation.
621
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
622
+ # will be added to the HTTP request.
623
+ #
624
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
625
+ #
626
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
627
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
628
+ end
629
+
630
+ #
631
+ # List all Source Control Configurations.
632
+ #
633
+ # @param next_page_link [String] The NextLink from the previous successful call
634
+ # to List operation.
635
+ # @param [Hash{String => String}] A hash of custom headers that will be added
636
+ # to the HTTP request.
637
+ #
638
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
639
+ #
640
+ def list_next_async(next_page_link, custom_headers:nil)
641
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
642
+
643
+
644
+ request_headers = {}
645
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
646
+
647
+ # Set Headers
648
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
649
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
650
+ path_template = '{nextLink}'
651
+
652
+ request_url = @base_url || @client.base_url
653
+
654
+ options = {
655
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
656
+ skip_encoding_path_params: {'nextLink' => next_page_link},
657
+ headers: request_headers.merge(custom_headers || {}),
658
+ base_url: request_url
659
+ }
660
+ promise = @client.make_request_async(:get, path_template, options)
661
+
662
+ promise = promise.then do |result|
663
+ http_response = result.response
664
+ status_code = http_response.status
665
+ response_content = http_response.body
666
+ unless status_code == 200
667
+ error_model = JSON.load(response_content)
668
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
669
+ end
670
+
671
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
672
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
673
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
674
+ # Deserialize Response
675
+ if status_code == 200
676
+ begin
677
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
678
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::SourceControlConfigurationList.mapper()
679
+ result.body = @client.deserialize(result_mapper, parsed_response)
680
+ rescue Exception => e
681
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
682
+ end
683
+ end
684
+
685
+ result
686
+ end
687
+
688
+ promise.execute
689
+ end
690
+
691
+ #
692
+ # List all Source Control Configurations.
693
+ #
694
+ # @param resource_group_name [String] The name of the resource group.
695
+ # @param cluster_rp [Enum] The Kubernetes cluster RP - either
696
+ # Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for
697
+ # OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService',
698
+ # 'Microsoft.Kubernetes'
699
+ # @param cluster_resource_name [Enum] The Kubernetes cluster resource name -
700
+ # either managedClusters (for AKS clusters) or connectedClusters (for OnPrem
701
+ # K8S clusters). Possible values include: 'managedClusters',
702
+ # 'connectedClusters'
703
+ # @param cluster_name [String] The name of the kubernetes cluster.
704
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
705
+ # will be added to the HTTP request.
706
+ #
707
+ # @return [SourceControlConfigurationList] which provide lazy access to pages
708
+ # of the response.
709
+ #
710
+ def list_as_lazy(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:nil)
711
+ response = list_async(resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers:custom_headers).value!
712
+ unless response.nil?
713
+ page = response.body
714
+ page.next_method = Proc.new do |next_page_link|
715
+ list_next_async(next_page_link, custom_headers:custom_headers)
716
+ end
717
+ page
718
+ end
719
+ end
720
+
721
+ end
722
+ end