azure_mgmt_container_service 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-03-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  3. data/lib/2016-09-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  4. data/lib/2017-01-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  5. data/lib/2017-07-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  6. data/lib/2017-08-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  7. data/lib/2017-09-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  8. data/lib/2018-03-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  9. data/lib/2018-08-01-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  10. data/lib/2018-09-30-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  11. data/lib/2019-02-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  12. data/lib/2019-04-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  13. data/lib/2019-04-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  14. data/lib/2019-06-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  15. data/lib/2019-08-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  16. data/lib/2019-09-30-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  17. data/lib/2019-10-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  18. data/lib/2020-02-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  19. data/lib/2020-06-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  20. data/lib/2020-07-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  21. data/lib/2020-09-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  22. data/lib/2020-12-01/generated/azure_mgmt_container_service.rb +126 -0
  23. data/lib/2020-12-01/generated/azure_mgmt_container_service/agent_pools.rb +1054 -0
  24. data/lib/2020-12-01/generated/azure_mgmt_container_service/container_service_client.rb +157 -0
  25. data/lib/2020-12-01/generated/azure_mgmt_container_service/maintenance_configurations.rb +589 -0
  26. data/lib/2020-12-01/generated/azure_mgmt_container_service/managed_clusters.rb +2309 -0
  27. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool.rb +533 -0
  28. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions.rb +93 -0
  29. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions_properties_agent_pool_versions_item.rb +71 -0
  30. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_list_result.rb +99 -0
  31. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_mode.rb +16 -0
  32. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_type.rb +16 -0
  33. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile.rb +129 -0
  34. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile_properties_upgrades_item.rb +59 -0
  35. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_settings.rb +47 -0
  36. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/code.rb +16 -0
  37. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/connection_status.rb +18 -0
  38. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
  39. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
  40. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
  41. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_network_profile.rb +179 -0
  42. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
  43. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
  44. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
  45. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
  46. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
  47. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/created_by_type.rb +18 -0
  48. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/credential_result.rb +59 -0
  49. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/credential_results.rb +57 -0
  50. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/expander.rb +18 -0
  51. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/kubelet_config.rb +174 -0
  52. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/kubelet_disk_type.rb +15 -0
  53. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/license_type.rb +16 -0
  54. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/linux_osconfig.rb +81 -0
  55. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/load_balancer_sku.rb +16 -0
  56. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/maintenance_configuration.rb +115 -0
  57. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/maintenance_configuration_list_result.rb +101 -0
  58. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster.rb +428 -0
  59. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_aadprofile.rb +123 -0
  60. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
  61. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile.rb +80 -0
  62. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile_identity.rb +59 -0
  63. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile.rb +340 -0
  64. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile_properties.rb +506 -0
  65. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_apiserver_access_profile.rb +77 -0
  66. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_auto_upgrade_profile.rb +47 -0
  67. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_identity.rb +104 -0
  68. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_identity_user_assigned_identities_value.rb +61 -0
  69. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
  70. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile.rb +132 -0
  71. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_managed_outbound_ips.rb +55 -0
  72. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ipprefixes.rb +57 -0
  73. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ips.rb +56 -0
  74. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity.rb +98 -0
  75. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_exception.rb +77 -0
  76. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_profile.rb +89 -0
  77. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_provisioning_info.rb +49 -0
  78. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_provisioning_state.rb +18 -0
  79. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +92 -0
  80. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile_upgrades_item.rb +59 -0
  81. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_properties_auto_scaler_profile.rb +224 -0
  82. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_properties_identity_profile_value.rb +61 -0
  83. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_service_principal_profile.rb +59 -0
  84. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_sku.rb +60 -0
  85. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_skuname.rb +15 -0
  86. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_skutier.rb +16 -0
  87. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
  88. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_windows_profile.rb +84 -0
  89. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/network_mode.rb +16 -0
  90. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/network_plugin.rb +16 -0
  91. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/network_policy.rb +16 -0
  92. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/operation_list_result.rb +56 -0
  93. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/operation_value.rb +108 -0
  94. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/osdisk_type.rb +16 -0
  95. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
  96. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/outbound_type.rb +16 -0
  97. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/power_state.rb +47 -0
  98. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint.rb +46 -0
  99. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint_connection.rb +111 -0
  100. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint_connection_list_result.rb +55 -0
  101. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint_connection_provisioning_state.rb +18 -0
  102. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_link_resource.rb +111 -0
  103. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_link_resources_list_result.rb +55 -0
  104. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_link_service_connection_state.rb +59 -0
  105. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/resource.rb +110 -0
  106. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/resource_identity_type.rb +17 -0
  107. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/resource_reference.rb +46 -0
  108. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/scale_set_eviction_policy.rb +16 -0
  109. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/scale_set_priority.rb +16 -0
  110. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/sub_resource.rb +72 -0
  111. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/sysctl_config.rb +343 -0
  112. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/system_data.rb +106 -0
  113. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/tags_object.rb +54 -0
  114. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/time_in_week.rb +66 -0
  115. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/time_span.rb +57 -0
  116. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/upgrade_channel.rb +18 -0
  117. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/user_assigned_identity.rb +69 -0
  118. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/week_day.rb +21 -0
  119. data/lib/2020-12-01/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  120. data/lib/2020-12-01/generated/azure_mgmt_container_service/operations.rb +109 -0
  121. data/lib/2020-12-01/generated/azure_mgmt_container_service/private_endpoint_connections.rb +515 -0
  122. data/lib/2020-12-01/generated/azure_mgmt_container_service/private_link_resources.rb +132 -0
  123. data/lib/2020-12-01/generated/azure_mgmt_container_service/resolve_private_link_service_id.rb +143 -0
  124. data/lib/azure_mgmt_container_service.rb +1 -0
  125. data/lib/profiles/latest/modules/containerservice_profile_module.rb +268 -194
  126. data/lib/version.rb +1 -1
  127. metadata +104 -2
@@ -0,0 +1,2309 @@
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::V2020_12_01
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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
101
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
102
+ # Deserialize Response
103
+ if status_code == 200
104
+ begin
105
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
106
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterListResult.mapper()
107
+ result.body = @client.deserialize(result_mapper, parsed_response)
108
+ rescue Exception => e
109
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
110
+ end
111
+ end
112
+
113
+ result
114
+ end
115
+
116
+ promise.execute
117
+ end
118
+
119
+ #
120
+ # Lists managed clusters in the specified subscription and resource group.
121
+ #
122
+ # Lists managed clusters in the specified subscription and resource group. The
123
+ # operation returns properties of each managed cluster.
124
+ #
125
+ # @param resource_group_name [String] The name of the resource group.
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [Array<ManagedCluster>] operation results.
130
+ #
131
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
132
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
133
+ first_page.get_all_items
134
+ end
135
+
136
+ #
137
+ # Lists managed clusters in the specified subscription and resource group.
138
+ #
139
+ # Lists managed clusters in the specified subscription and resource group. The
140
+ # operation returns properties of each managed cluster.
141
+ #
142
+ # @param resource_group_name [String] The name of the resource group.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
147
+ #
148
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
149
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
150
+ end
151
+
152
+ #
153
+ # Lists managed clusters in the specified subscription and resource group.
154
+ #
155
+ # Lists managed clusters in the specified subscription and resource group. The
156
+ # operation returns properties of each managed cluster.
157
+ #
158
+ # @param resource_group_name [String] The name of the resource group.
159
+ # @param [Hash{String => String}] A hash of custom headers that will be added
160
+ # to the HTTP request.
161
+ #
162
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
163
+ #
164
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
165
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
166
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
167
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
168
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
169
+
170
+
171
+ request_headers = {}
172
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
173
+
174
+ # Set Headers
175
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
176
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
177
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'
178
+
179
+ request_url = @base_url || @client.base_url
180
+
181
+ options = {
182
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
183
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
184
+ query_params: {'api-version' => @client.api_version},
185
+ headers: request_headers.merge(custom_headers || {}),
186
+ base_url: request_url
187
+ }
188
+ promise = @client.make_request_async(:get, path_template, options)
189
+
190
+ promise = promise.then do |result|
191
+ http_response = result.response
192
+ status_code = http_response.status
193
+ response_content = http_response.body
194
+ unless status_code == 200
195
+ error_model = JSON.load(response_content)
196
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
197
+ end
198
+
199
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
200
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
201
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
202
+ # Deserialize Response
203
+ if status_code == 200
204
+ begin
205
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
206
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterListResult.mapper()
207
+ result.body = @client.deserialize(result_mapper, parsed_response)
208
+ rescue Exception => e
209
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
210
+ end
211
+ end
212
+
213
+ result
214
+ end
215
+
216
+ promise.execute
217
+ end
218
+
219
+ #
220
+ # Gets upgrade profile for a managed cluster.
221
+ #
222
+ # Gets the details of the upgrade profile for a managed cluster with a
223
+ # specified resource group and name.
224
+ #
225
+ # @param resource_group_name [String] The name of the resource group.
226
+ # @param resource_name [String] The name of the managed cluster resource.
227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
228
+ # will be added to the HTTP request.
229
+ #
230
+ # @return [ManagedClusterUpgradeProfile] operation results.
231
+ #
232
+ def get_upgrade_profile(resource_group_name, resource_name, custom_headers:nil)
233
+ response = get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
234
+ response.body unless response.nil?
235
+ end
236
+
237
+ #
238
+ # Gets upgrade profile for a managed cluster.
239
+ #
240
+ # Gets the details of the upgrade profile for a managed cluster with a
241
+ # specified resource group and name.
242
+ #
243
+ # @param resource_group_name [String] The name of the resource group.
244
+ # @param resource_name [String] The name of the managed cluster resource.
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
249
+ #
250
+ def get_upgrade_profile_with_http_info(resource_group_name, resource_name, custom_headers:nil)
251
+ get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
252
+ end
253
+
254
+ #
255
+ # Gets upgrade profile for a managed cluster.
256
+ #
257
+ # Gets the details of the upgrade profile for a managed cluster with a
258
+ # specified resource group and name.
259
+ #
260
+ # @param resource_group_name [String] The name of the resource group.
261
+ # @param resource_name [String] The name of the managed cluster resource.
262
+ # @param [Hash{String => String}] A hash of custom headers that will be added
263
+ # to the HTTP request.
264
+ #
265
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
266
+ #
267
+ def get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:nil)
268
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
269
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
270
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
271
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
272
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
273
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
274
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
275
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
276
+
277
+
278
+ request_headers = {}
279
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
280
+
281
+ # Set Headers
282
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
283
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
284
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'
285
+
286
+ request_url = @base_url || @client.base_url
287
+
288
+ options = {
289
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
290
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
291
+ query_params: {'api-version' => @client.api_version},
292
+ headers: request_headers.merge(custom_headers || {}),
293
+ base_url: request_url
294
+ }
295
+ promise = @client.make_request_async(:get, path_template, options)
296
+
297
+ promise = promise.then do |result|
298
+ http_response = result.response
299
+ status_code = http_response.status
300
+ response_content = http_response.body
301
+ unless status_code == 200
302
+ error_model = JSON.load(response_content)
303
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
304
+ end
305
+
306
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
307
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
308
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
309
+ # Deserialize Response
310
+ if status_code == 200
311
+ begin
312
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
313
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterUpgradeProfile.mapper()
314
+ result.body = @client.deserialize(result_mapper, parsed_response)
315
+ rescue Exception => e
316
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
317
+ end
318
+ end
319
+
320
+ result
321
+ end
322
+
323
+ promise.execute
324
+ end
325
+
326
+ #
327
+ # Gets an access profile of a managed cluster.
328
+ #
329
+ # Gets the accessProfile for the specified role name of the managed cluster
330
+ # with a specified resource group and name. **WARNING**: This API will be
331
+ # deprecated. Instead use
332
+ # [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials)
333
+ # or
334
+ # [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials)
335
+ # .
336
+ #
337
+ # @param resource_group_name [String] The name of the resource group.
338
+ # @param resource_name [String] The name of the managed cluster resource.
339
+ # @param role_name [String] The name of the role for managed cluster
340
+ # accessProfile resource.
341
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
342
+ # will be added to the HTTP request.
343
+ #
344
+ # @return [ManagedClusterAccessProfile] operation results.
345
+ #
346
+ def get_access_profile(resource_group_name, resource_name, role_name, custom_headers:nil)
347
+ response = get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:custom_headers).value!
348
+ response.body unless response.nil?
349
+ end
350
+
351
+ #
352
+ # Gets an access profile of a managed cluster.
353
+ #
354
+ # Gets the accessProfile for the specified role name of the managed cluster
355
+ # with a specified resource group and name. **WARNING**: This API will be
356
+ # deprecated. Instead use
357
+ # [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials)
358
+ # or
359
+ # [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials)
360
+ # .
361
+ #
362
+ # @param resource_group_name [String] The name of the resource group.
363
+ # @param resource_name [String] The name of the managed cluster resource.
364
+ # @param role_name [String] The name of the role for managed cluster
365
+ # accessProfile resource.
366
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
367
+ # will be added to the HTTP request.
368
+ #
369
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
370
+ #
371
+ def get_access_profile_with_http_info(resource_group_name, resource_name, role_name, custom_headers:nil)
372
+ get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:custom_headers).value!
373
+ end
374
+
375
+ #
376
+ # Gets an access profile of a managed cluster.
377
+ #
378
+ # Gets the accessProfile for the specified role name of the managed cluster
379
+ # with a specified resource group and name. **WARNING**: This API will be
380
+ # deprecated. Instead use
381
+ # [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials)
382
+ # or
383
+ # [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials)
384
+ # .
385
+ #
386
+ # @param resource_group_name [String] The name of the resource group.
387
+ # @param resource_name [String] The name of the managed cluster resource.
388
+ # @param role_name [String] The name of the role for managed cluster
389
+ # accessProfile resource.
390
+ # @param [Hash{String => String}] A hash of custom headers that will be added
391
+ # to the HTTP request.
392
+ #
393
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
394
+ #
395
+ def get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:nil)
396
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
397
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
398
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
399
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
400
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
401
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
402
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
403
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
404
+ fail ArgumentError, 'role_name is nil' if role_name.nil?
405
+
406
+
407
+ request_headers = {}
408
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
409
+
410
+ # Set Headers
411
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
412
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
413
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'
414
+
415
+ request_url = @base_url || @client.base_url
416
+
417
+ options = {
418
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
419
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'roleName' => role_name},
420
+ query_params: {'api-version' => @client.api_version},
421
+ headers: request_headers.merge(custom_headers || {}),
422
+ base_url: request_url
423
+ }
424
+ promise = @client.make_request_async(:post, path_template, options)
425
+
426
+ promise = promise.then do |result|
427
+ http_response = result.response
428
+ status_code = http_response.status
429
+ response_content = http_response.body
430
+ unless status_code == 200
431
+ error_model = JSON.load(response_content)
432
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
433
+ end
434
+
435
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
436
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
437
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
438
+ # Deserialize Response
439
+ if status_code == 200
440
+ begin
441
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
442
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterAccessProfile.mapper()
443
+ result.body = @client.deserialize(result_mapper, parsed_response)
444
+ rescue Exception => e
445
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
446
+ end
447
+ end
448
+
449
+ result
450
+ end
451
+
452
+ promise.execute
453
+ end
454
+
455
+ #
456
+ # Gets cluster admin credential of a managed cluster.
457
+ #
458
+ # Gets cluster admin credential of the managed cluster with a specified
459
+ # resource group and name.
460
+ #
461
+ # @param resource_group_name [String] The name of the resource group.
462
+ # @param resource_name [String] The name of the managed cluster resource.
463
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
464
+ # will be added to the HTTP request.
465
+ #
466
+ # @return [CredentialResults] operation results.
467
+ #
468
+ def list_cluster_admin_credentials(resource_group_name, resource_name, custom_headers:nil)
469
+ response = list_cluster_admin_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
470
+ response.body unless response.nil?
471
+ end
472
+
473
+ #
474
+ # Gets cluster admin credential of a managed cluster.
475
+ #
476
+ # Gets cluster admin credential of the managed cluster with a specified
477
+ # resource group and name.
478
+ #
479
+ # @param resource_group_name [String] The name of the resource group.
480
+ # @param resource_name [String] The name of the managed cluster resource.
481
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
482
+ # will be added to the HTTP request.
483
+ #
484
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
485
+ #
486
+ def list_cluster_admin_credentials_with_http_info(resource_group_name, resource_name, custom_headers:nil)
487
+ list_cluster_admin_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
488
+ end
489
+
490
+ #
491
+ # Gets cluster admin credential of a managed cluster.
492
+ #
493
+ # Gets cluster admin credential of the managed cluster with a specified
494
+ # resource group and name.
495
+ #
496
+ # @param resource_group_name [String] The name of the resource group.
497
+ # @param resource_name [String] The name of the managed cluster resource.
498
+ # @param [Hash{String => String}] A hash of custom headers that will be added
499
+ # to the HTTP request.
500
+ #
501
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
502
+ #
503
+ def list_cluster_admin_credentials_async(resource_group_name, resource_name, custom_headers:nil)
504
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
505
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
506
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
507
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
508
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
509
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
510
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
511
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
512
+
513
+
514
+ request_headers = {}
515
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
516
+
517
+ # Set Headers
518
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
519
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
520
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'
521
+
522
+ request_url = @base_url || @client.base_url
523
+
524
+ options = {
525
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
526
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
527
+ query_params: {'api-version' => @client.api_version},
528
+ headers: request_headers.merge(custom_headers || {}),
529
+ base_url: request_url
530
+ }
531
+ promise = @client.make_request_async(:post, path_template, options)
532
+
533
+ promise = promise.then do |result|
534
+ http_response = result.response
535
+ status_code = http_response.status
536
+ response_content = http_response.body
537
+ unless status_code == 200
538
+ error_model = JSON.load(response_content)
539
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
540
+ end
541
+
542
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
543
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
544
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
545
+ # Deserialize Response
546
+ if status_code == 200
547
+ begin
548
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
549
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::CredentialResults.mapper()
550
+ result.body = @client.deserialize(result_mapper, parsed_response)
551
+ rescue Exception => e
552
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
553
+ end
554
+ end
555
+
556
+ result
557
+ end
558
+
559
+ promise.execute
560
+ end
561
+
562
+ #
563
+ # Gets cluster user credential of a managed cluster.
564
+ #
565
+ # Gets cluster user credential of the managed cluster with a specified resource
566
+ # group and name.
567
+ #
568
+ # @param resource_group_name [String] The name of the resource group.
569
+ # @param resource_name [String] The name of the managed cluster resource.
570
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
571
+ # will be added to the HTTP request.
572
+ #
573
+ # @return [CredentialResults] operation results.
574
+ #
575
+ def list_cluster_user_credentials(resource_group_name, resource_name, custom_headers:nil)
576
+ response = list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
577
+ response.body unless response.nil?
578
+ end
579
+
580
+ #
581
+ # Gets cluster user credential of a managed cluster.
582
+ #
583
+ # Gets cluster user credential of the managed cluster with a specified resource
584
+ # group and name.
585
+ #
586
+ # @param resource_group_name [String] The name of the resource group.
587
+ # @param resource_name [String] The name of the managed cluster resource.
588
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
589
+ # will be added to the HTTP request.
590
+ #
591
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
592
+ #
593
+ def list_cluster_user_credentials_with_http_info(resource_group_name, resource_name, custom_headers:nil)
594
+ list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
595
+ end
596
+
597
+ #
598
+ # Gets cluster user credential of a managed cluster.
599
+ #
600
+ # Gets cluster user credential of the managed cluster with a specified resource
601
+ # group and name.
602
+ #
603
+ # @param resource_group_name [String] The name of the resource group.
604
+ # @param resource_name [String] The name of the managed cluster resource.
605
+ # @param [Hash{String => String}] A hash of custom headers that will be added
606
+ # to the HTTP request.
607
+ #
608
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
609
+ #
610
+ def list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:nil)
611
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
612
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
613
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
614
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
615
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
616
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
617
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
618
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
619
+
620
+
621
+ request_headers = {}
622
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
623
+
624
+ # Set Headers
625
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
626
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
627
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'
628
+
629
+ request_url = @base_url || @client.base_url
630
+
631
+ options = {
632
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
633
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
634
+ query_params: {'api-version' => @client.api_version},
635
+ headers: request_headers.merge(custom_headers || {}),
636
+ base_url: request_url
637
+ }
638
+ promise = @client.make_request_async(:post, path_template, options)
639
+
640
+ promise = promise.then do |result|
641
+ http_response = result.response
642
+ status_code = http_response.status
643
+ response_content = http_response.body
644
+ unless status_code == 200
645
+ error_model = JSON.load(response_content)
646
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
647
+ end
648
+
649
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
650
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
651
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
652
+ # Deserialize Response
653
+ if status_code == 200
654
+ begin
655
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
656
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::CredentialResults.mapper()
657
+ result.body = @client.deserialize(result_mapper, parsed_response)
658
+ rescue Exception => e
659
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
660
+ end
661
+ end
662
+
663
+ result
664
+ end
665
+
666
+ promise.execute
667
+ end
668
+
669
+ #
670
+ # Gets cluster monitoring user credential of a managed cluster.
671
+ #
672
+ # Gets cluster monitoring user credential of the managed cluster with a
673
+ # specified resource group and name.
674
+ #
675
+ # @param resource_group_name [String] The name of the resource group.
676
+ # @param resource_name [String] The name of the managed cluster resource.
677
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
678
+ # will be added to the HTTP request.
679
+ #
680
+ # @return [CredentialResults] operation results.
681
+ #
682
+ def list_cluster_monitoring_user_credentials(resource_group_name, resource_name, custom_headers:nil)
683
+ response = list_cluster_monitoring_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
684
+ response.body unless response.nil?
685
+ end
686
+
687
+ #
688
+ # Gets cluster monitoring user credential of a managed cluster.
689
+ #
690
+ # Gets cluster monitoring user credential of the managed cluster with a
691
+ # specified resource group and name.
692
+ #
693
+ # @param resource_group_name [String] The name of the resource group.
694
+ # @param resource_name [String] The name of the managed cluster resource.
695
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
696
+ # will be added to the HTTP request.
697
+ #
698
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
699
+ #
700
+ def list_cluster_monitoring_user_credentials_with_http_info(resource_group_name, resource_name, custom_headers:nil)
701
+ list_cluster_monitoring_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
702
+ end
703
+
704
+ #
705
+ # Gets cluster monitoring user credential of a managed cluster.
706
+ #
707
+ # Gets cluster monitoring user credential of the managed cluster with a
708
+ # specified resource group and name.
709
+ #
710
+ # @param resource_group_name [String] The name of the resource group.
711
+ # @param resource_name [String] The name of the managed cluster resource.
712
+ # @param [Hash{String => String}] A hash of custom headers that will be added
713
+ # to the HTTP request.
714
+ #
715
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
716
+ #
717
+ def list_cluster_monitoring_user_credentials_async(resource_group_name, resource_name, custom_headers:nil)
718
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
719
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
720
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
721
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
722
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
723
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
724
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
725
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
726
+
727
+
728
+ request_headers = {}
729
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
730
+
731
+ # Set Headers
732
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
733
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
734
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'
735
+
736
+ request_url = @base_url || @client.base_url
737
+
738
+ options = {
739
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
740
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
741
+ query_params: {'api-version' => @client.api_version},
742
+ headers: request_headers.merge(custom_headers || {}),
743
+ base_url: request_url
744
+ }
745
+ promise = @client.make_request_async(:post, path_template, options)
746
+
747
+ promise = promise.then do |result|
748
+ http_response = result.response
749
+ status_code = http_response.status
750
+ response_content = http_response.body
751
+ unless status_code == 200
752
+ error_model = JSON.load(response_content)
753
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
754
+ end
755
+
756
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
757
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
758
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2020_12_01::Models::CredentialResults.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
+
770
+ result
771
+ end
772
+
773
+ promise.execute
774
+ end
775
+
776
+ #
777
+ # Gets a managed cluster.
778
+ #
779
+ # Gets the details of the managed cluster with a specified resource group and
780
+ # name.
781
+ #
782
+ # @param resource_group_name [String] The name of the resource group.
783
+ # @param resource_name [String] The name of the managed cluster resource.
784
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
785
+ # will be added to the HTTP request.
786
+ #
787
+ # @return [ManagedCluster] operation results.
788
+ #
789
+ def get(resource_group_name, resource_name, custom_headers:nil)
790
+ response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
791
+ response.body unless response.nil?
792
+ end
793
+
794
+ #
795
+ # Gets a managed cluster.
796
+ #
797
+ # Gets the details of the managed cluster with a specified resource group and
798
+ # name.
799
+ #
800
+ # @param resource_group_name [String] The name of the resource group.
801
+ # @param resource_name [String] The name of the managed cluster resource.
802
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
803
+ # will be added to the HTTP request.
804
+ #
805
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
806
+ #
807
+ def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
808
+ get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
809
+ end
810
+
811
+ #
812
+ # Gets a managed cluster.
813
+ #
814
+ # Gets the details of the managed cluster with a specified resource group and
815
+ # name.
816
+ #
817
+ # @param resource_group_name [String] The name of the resource group.
818
+ # @param resource_name [String] The name of the managed cluster resource.
819
+ # @param [Hash{String => String}] A hash of custom headers that will be added
820
+ # to the HTTP request.
821
+ #
822
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
823
+ #
824
+ def get_async(resource_group_name, resource_name, custom_headers:nil)
825
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
826
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
827
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
828
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
829
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
830
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
831
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
832
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
833
+
834
+
835
+ request_headers = {}
836
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
837
+
838
+ # Set Headers
839
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
840
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
841
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
842
+
843
+ request_url = @base_url || @client.base_url
844
+
845
+ options = {
846
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
847
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
848
+ query_params: {'api-version' => @client.api_version},
849
+ headers: request_headers.merge(custom_headers || {}),
850
+ base_url: request_url
851
+ }
852
+ promise = @client.make_request_async(:get, path_template, options)
853
+
854
+ promise = promise.then do |result|
855
+ http_response = result.response
856
+ status_code = http_response.status
857
+ response_content = http_response.body
858
+ unless status_code == 200
859
+ error_model = JSON.load(response_content)
860
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
861
+ end
862
+
863
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
864
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
865
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
866
+ # Deserialize Response
867
+ if status_code == 200
868
+ begin
869
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
870
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
871
+ result.body = @client.deserialize(result_mapper, parsed_response)
872
+ rescue Exception => e
873
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
874
+ end
875
+ end
876
+
877
+ result
878
+ end
879
+
880
+ promise.execute
881
+ end
882
+
883
+ #
884
+ # Creates or updates a managed cluster.
885
+ #
886
+ # Creates or updates a managed cluster with the specified configuration for
887
+ # agents and Kubernetes version.
888
+ #
889
+ # @param resource_group_name [String] The name of the resource group.
890
+ # @param resource_name [String] The name of the managed cluster resource.
891
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
892
+ # Update a Managed Cluster operation.
893
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
894
+ # will be added to the HTTP request.
895
+ #
896
+ # @return [ManagedCluster] operation results.
897
+ #
898
+ def create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
899
+ response = create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
900
+ response.body unless response.nil?
901
+ end
902
+
903
+ #
904
+ # @param resource_group_name [String] The name of the resource group.
905
+ # @param resource_name [String] The name of the managed cluster resource.
906
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
907
+ # Update a Managed Cluster operation.
908
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
909
+ # will be added to the HTTP request.
910
+ #
911
+ # @return [Concurrent::Promise] promise which provides async access to http
912
+ # response.
913
+ #
914
+ def create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
915
+ # Send request
916
+ promise = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
917
+
918
+ promise = promise.then do |response|
919
+ # Defining deserialization method.
920
+ deserialize_method = lambda do |parsed_response|
921
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
922
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
923
+ end
924
+
925
+ # Waiting for response.
926
+ @client.get_long_running_operation_result(response, deserialize_method)
927
+ end
928
+
929
+ promise
930
+ end
931
+
932
+ #
933
+ # Updates tags on a managed cluster.
934
+ #
935
+ # Updates a managed cluster with the specified tags.
936
+ #
937
+ # @param resource_group_name [String] The name of the resource group.
938
+ # @param resource_name [String] The name of the managed cluster resource.
939
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
940
+ # Cluster Tags operation.
941
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
942
+ # will be added to the HTTP request.
943
+ #
944
+ # @return [ManagedCluster] operation results.
945
+ #
946
+ def update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
947
+ response = update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
948
+ response.body unless response.nil?
949
+ end
950
+
951
+ #
952
+ # @param resource_group_name [String] The name of the resource group.
953
+ # @param resource_name [String] The name of the managed cluster resource.
954
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
955
+ # Cluster Tags operation.
956
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
957
+ # will be added to the HTTP request.
958
+ #
959
+ # @return [Concurrent::Promise] promise which provides async access to http
960
+ # response.
961
+ #
962
+ def update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
963
+ # Send request
964
+ promise = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
965
+
966
+ promise = promise.then do |response|
967
+ # Defining deserialization method.
968
+ deserialize_method = lambda do |parsed_response|
969
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
970
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
971
+ end
972
+
973
+ # Waiting for response.
974
+ @client.get_long_running_operation_result(response, deserialize_method)
975
+ end
976
+
977
+ promise
978
+ end
979
+
980
+ #
981
+ # Deletes a managed cluster.
982
+ #
983
+ # Deletes the managed cluster with a specified resource group and name.
984
+ #
985
+ # @param resource_group_name [String] The name of the resource group.
986
+ # @param resource_name [String] The name of the managed cluster resource.
987
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
988
+ # will be added to the HTTP request.
989
+ #
990
+ def delete(resource_group_name, resource_name, custom_headers:nil)
991
+ response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
992
+ nil
993
+ end
994
+
995
+ #
996
+ # @param resource_group_name [String] The name of the resource group.
997
+ # @param resource_name [String] The name of the managed cluster resource.
998
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
999
+ # will be added to the HTTP request.
1000
+ #
1001
+ # @return [Concurrent::Promise] promise which provides async access to http
1002
+ # response.
1003
+ #
1004
+ def delete_async(resource_group_name, resource_name, custom_headers:nil)
1005
+ # Send request
1006
+ promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
1007
+
1008
+ promise = promise.then do |response|
1009
+ # Defining deserialization method.
1010
+ deserialize_method = lambda do |parsed_response|
1011
+ end
1012
+
1013
+ # Waiting for response.
1014
+ @client.get_long_running_operation_result(response, deserialize_method)
1015
+ end
1016
+
1017
+ promise
1018
+ end
1019
+
1020
+ #
1021
+ # Reset Service Principal Profile of a managed cluster.
1022
+ #
1023
+ # Update the service principal Profile for a managed cluster.
1024
+ #
1025
+ # @param resource_group_name [String] The name of the resource group.
1026
+ # @param resource_name [String] The name of the managed cluster resource.
1027
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1028
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1029
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1030
+ # will be added to the HTTP request.
1031
+ #
1032
+ def reset_service_principal_profile(resource_group_name, resource_name, parameters, custom_headers:nil)
1033
+ response = reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1034
+ nil
1035
+ end
1036
+
1037
+ #
1038
+ # @param resource_group_name [String] The name of the resource group.
1039
+ # @param resource_name [String] The name of the managed cluster resource.
1040
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1041
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1042
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1043
+ # will be added to the HTTP request.
1044
+ #
1045
+ # @return [Concurrent::Promise] promise which provides async access to http
1046
+ # response.
1047
+ #
1048
+ def reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1049
+ # Send request
1050
+ promise = begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
1051
+
1052
+ promise = promise.then do |response|
1053
+ # Defining deserialization method.
1054
+ deserialize_method = lambda do |parsed_response|
1055
+ end
1056
+
1057
+ # Waiting for response.
1058
+ @client.get_long_running_operation_result(response, deserialize_method)
1059
+ end
1060
+
1061
+ promise
1062
+ end
1063
+
1064
+ #
1065
+ # Reset AAD Profile of a managed cluster.
1066
+ #
1067
+ # Update the AAD Profile for a managed cluster.
1068
+ #
1069
+ # @param resource_group_name [String] The name of the resource group.
1070
+ # @param resource_name [String] The name of the managed cluster resource.
1071
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1072
+ # AAD Profile operation for a Managed Cluster.
1073
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1074
+ # will be added to the HTTP request.
1075
+ #
1076
+ def reset_aadprofile(resource_group_name, resource_name, parameters, custom_headers:nil)
1077
+ response = reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1078
+ nil
1079
+ end
1080
+
1081
+ #
1082
+ # @param resource_group_name [String] The name of the resource group.
1083
+ # @param resource_name [String] The name of the managed cluster resource.
1084
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1085
+ # AAD Profile operation for a Managed Cluster.
1086
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1087
+ # will be added to the HTTP request.
1088
+ #
1089
+ # @return [Concurrent::Promise] promise which provides async access to http
1090
+ # response.
1091
+ #
1092
+ def reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1093
+ # Send request
1094
+ promise = begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
1095
+
1096
+ promise = promise.then do |response|
1097
+ # Defining deserialization method.
1098
+ deserialize_method = lambda do |parsed_response|
1099
+ end
1100
+
1101
+ # Waiting for response.
1102
+ @client.get_long_running_operation_result(response, deserialize_method)
1103
+ end
1104
+
1105
+ promise
1106
+ end
1107
+
1108
+ #
1109
+ # Rotate certificates of a managed cluster.
1110
+ #
1111
+ # Rotate certificates of a managed cluster.
1112
+ #
1113
+ # @param resource_group_name [String] The name of the resource group.
1114
+ # @param resource_name [String] The name of the managed cluster resource.
1115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1116
+ # will be added to the HTTP request.
1117
+ #
1118
+ def rotate_cluster_certificates(resource_group_name, resource_name, custom_headers:nil)
1119
+ response = rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1120
+ nil
1121
+ end
1122
+
1123
+ #
1124
+ # @param resource_group_name [String] The name of the resource group.
1125
+ # @param resource_name [String] The name of the managed cluster resource.
1126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1127
+ # will be added to the HTTP request.
1128
+ #
1129
+ # @return [Concurrent::Promise] promise which provides async access to http
1130
+ # response.
1131
+ #
1132
+ def rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:nil)
1133
+ # Send request
1134
+ promise = begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:custom_headers)
1135
+
1136
+ promise = promise.then do |response|
1137
+ # Defining deserialization method.
1138
+ deserialize_method = lambda do |parsed_response|
1139
+ end
1140
+
1141
+ # Waiting for response.
1142
+ @client.get_long_running_operation_result(response, deserialize_method)
1143
+ end
1144
+
1145
+ promise
1146
+ end
1147
+
1148
+ #
1149
+ # Stop Managed Cluster
1150
+ #
1151
+ # Stops a Running Managed Cluster
1152
+ #
1153
+ # @param resource_group_name [String] The name of the resource group.
1154
+ # @param resource_name [String] The name of the managed cluster resource.
1155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1156
+ # will be added to the HTTP request.
1157
+ #
1158
+ def stop(resource_group_name, resource_name, custom_headers:nil)
1159
+ response = stop_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1160
+ nil
1161
+ end
1162
+
1163
+ #
1164
+ # @param resource_group_name [String] The name of the resource group.
1165
+ # @param resource_name [String] The name of the managed cluster resource.
1166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1167
+ # will be added to the HTTP request.
1168
+ #
1169
+ # @return [Concurrent::Promise] promise which provides async access to http
1170
+ # response.
1171
+ #
1172
+ def stop_async(resource_group_name, resource_name, custom_headers:nil)
1173
+ # Send request
1174
+ promise = begin_stop_async(resource_group_name, resource_name, custom_headers:custom_headers)
1175
+
1176
+ promise = promise.then do |response|
1177
+ # Defining deserialization method.
1178
+ deserialize_method = lambda do |parsed_response|
1179
+ end
1180
+
1181
+ # Waiting for response.
1182
+ @client.get_long_running_operation_result(response, deserialize_method)
1183
+ end
1184
+
1185
+ promise
1186
+ end
1187
+
1188
+ #
1189
+ # Start Managed Cluster
1190
+ #
1191
+ # Starts a Stopped Managed Cluster
1192
+ #
1193
+ # @param resource_group_name [String] The name of the resource group.
1194
+ # @param resource_name [String] The name of the managed cluster resource.
1195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1196
+ # will be added to the HTTP request.
1197
+ #
1198
+ def start(resource_group_name, resource_name, custom_headers:nil)
1199
+ response = start_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1200
+ nil
1201
+ end
1202
+
1203
+ #
1204
+ # @param resource_group_name [String] The name of the resource group.
1205
+ # @param resource_name [String] The name of the managed cluster resource.
1206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1207
+ # will be added to the HTTP request.
1208
+ #
1209
+ # @return [Concurrent::Promise] promise which provides async access to http
1210
+ # response.
1211
+ #
1212
+ def start_async(resource_group_name, resource_name, custom_headers:nil)
1213
+ # Send request
1214
+ promise = begin_start_async(resource_group_name, resource_name, custom_headers:custom_headers)
1215
+
1216
+ promise = promise.then do |response|
1217
+ # Defining deserialization method.
1218
+ deserialize_method = lambda do |parsed_response|
1219
+ end
1220
+
1221
+ # Waiting for response.
1222
+ @client.get_long_running_operation_result(response, deserialize_method)
1223
+ end
1224
+
1225
+ promise
1226
+ end
1227
+
1228
+ #
1229
+ # Creates or updates a managed cluster.
1230
+ #
1231
+ # Creates or updates a managed cluster with the specified configuration for
1232
+ # agents and Kubernetes version.
1233
+ #
1234
+ # @param resource_group_name [String] The name of the resource group.
1235
+ # @param resource_name [String] The name of the managed cluster resource.
1236
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
1237
+ # Update a Managed Cluster operation.
1238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1239
+ # will be added to the HTTP request.
1240
+ #
1241
+ # @return [ManagedCluster] operation results.
1242
+ #
1243
+ def begin_create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
1244
+ response = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1245
+ response.body unless response.nil?
1246
+ end
1247
+
1248
+ #
1249
+ # Creates or updates a managed cluster.
1250
+ #
1251
+ # Creates or updates a managed cluster with the specified configuration for
1252
+ # agents and Kubernetes version.
1253
+ #
1254
+ # @param resource_group_name [String] The name of the resource group.
1255
+ # @param resource_name [String] The name of the managed cluster resource.
1256
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
1257
+ # Update a Managed Cluster operation.
1258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1259
+ # will be added to the HTTP request.
1260
+ #
1261
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1262
+ #
1263
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1264
+ begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1265
+ end
1266
+
1267
+ #
1268
+ # Creates or updates a managed cluster.
1269
+ #
1270
+ # Creates or updates a managed cluster with the specified configuration for
1271
+ # agents and Kubernetes version.
1272
+ #
1273
+ # @param resource_group_name [String] The name of the resource group.
1274
+ # @param resource_name [String] The name of the managed cluster resource.
1275
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
1276
+ # Update a Managed Cluster operation.
1277
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1278
+ # to the HTTP request.
1279
+ #
1280
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1281
+ #
1282
+ def begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1283
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1284
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1285
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1286
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1287
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1288
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1289
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1290
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1291
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1292
+
1293
+
1294
+ request_headers = {}
1295
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1296
+
1297
+ # Set Headers
1298
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1299
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1300
+
1301
+ # Serialize Request
1302
+ request_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
1303
+ request_content = @client.serialize(request_mapper, parameters)
1304
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1305
+
1306
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
1307
+
1308
+ request_url = @base_url || @client.base_url
1309
+
1310
+ options = {
1311
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1312
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1313
+ query_params: {'api-version' => @client.api_version},
1314
+ body: request_content,
1315
+ headers: request_headers.merge(custom_headers || {}),
1316
+ base_url: request_url
1317
+ }
1318
+ promise = @client.make_request_async(:put, path_template, options)
1319
+
1320
+ promise = promise.then do |result|
1321
+ http_response = result.response
1322
+ status_code = http_response.status
1323
+ response_content = http_response.body
1324
+ unless status_code == 200 || status_code == 201
1325
+ error_model = JSON.load(response_content)
1326
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1327
+ end
1328
+
1329
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1330
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1331
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1332
+ # Deserialize Response
1333
+ if status_code == 200
1334
+ begin
1335
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1336
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
1337
+ result.body = @client.deserialize(result_mapper, parsed_response)
1338
+ rescue Exception => e
1339
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1340
+ end
1341
+ end
1342
+ # Deserialize Response
1343
+ if status_code == 201
1344
+ begin
1345
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1346
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
1347
+ result.body = @client.deserialize(result_mapper, parsed_response)
1348
+ rescue Exception => e
1349
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1350
+ end
1351
+ end
1352
+
1353
+ result
1354
+ end
1355
+
1356
+ promise.execute
1357
+ end
1358
+
1359
+ #
1360
+ # Updates tags on a managed cluster.
1361
+ #
1362
+ # Updates a managed cluster with the specified tags.
1363
+ #
1364
+ # @param resource_group_name [String] The name of the resource group.
1365
+ # @param resource_name [String] The name of the managed cluster resource.
1366
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
1367
+ # Cluster Tags operation.
1368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1369
+ # will be added to the HTTP request.
1370
+ #
1371
+ # @return [ManagedCluster] operation results.
1372
+ #
1373
+ def begin_update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
1374
+ response = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1375
+ response.body unless response.nil?
1376
+ end
1377
+
1378
+ #
1379
+ # Updates tags on a managed cluster.
1380
+ #
1381
+ # Updates a managed cluster with the specified tags.
1382
+ #
1383
+ # @param resource_group_name [String] The name of the resource group.
1384
+ # @param resource_name [String] The name of the managed cluster resource.
1385
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
1386
+ # Cluster Tags operation.
1387
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1388
+ # will be added to the HTTP request.
1389
+ #
1390
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1391
+ #
1392
+ def begin_update_tags_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1393
+ begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1394
+ end
1395
+
1396
+ #
1397
+ # Updates tags on a managed cluster.
1398
+ #
1399
+ # Updates a managed cluster with the specified tags.
1400
+ #
1401
+ # @param resource_group_name [String] The name of the resource group.
1402
+ # @param resource_name [String] The name of the managed cluster resource.
1403
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
1404
+ # Cluster Tags operation.
1405
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1406
+ # to the HTTP request.
1407
+ #
1408
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1409
+ #
1410
+ def begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1411
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1412
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1413
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1414
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1415
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1416
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1417
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1418
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1419
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1420
+
1421
+
1422
+ request_headers = {}
1423
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1424
+
1425
+ # Set Headers
1426
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1427
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1428
+
1429
+ # Serialize Request
1430
+ request_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::TagsObject.mapper()
1431
+ request_content = @client.serialize(request_mapper, parameters)
1432
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1433
+
1434
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
1435
+
1436
+ request_url = @base_url || @client.base_url
1437
+
1438
+ options = {
1439
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1440
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1441
+ query_params: {'api-version' => @client.api_version},
1442
+ body: request_content,
1443
+ headers: request_headers.merge(custom_headers || {}),
1444
+ base_url: request_url
1445
+ }
1446
+ promise = @client.make_request_async(:patch, path_template, options)
1447
+
1448
+ promise = promise.then do |result|
1449
+ http_response = result.response
1450
+ status_code = http_response.status
1451
+ response_content = http_response.body
1452
+ unless status_code == 200
1453
+ error_model = JSON.load(response_content)
1454
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1455
+ end
1456
+
1457
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1458
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1459
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1460
+ # Deserialize Response
1461
+ if status_code == 200
1462
+ begin
1463
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1464
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedCluster.mapper()
1465
+ result.body = @client.deserialize(result_mapper, parsed_response)
1466
+ rescue Exception => e
1467
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1468
+ end
1469
+ end
1470
+
1471
+ result
1472
+ end
1473
+
1474
+ promise.execute
1475
+ end
1476
+
1477
+ #
1478
+ # Deletes a managed cluster.
1479
+ #
1480
+ # Deletes the managed cluster with a specified resource group and name.
1481
+ #
1482
+ # @param resource_group_name [String] The name of the resource group.
1483
+ # @param resource_name [String] The name of the managed cluster resource.
1484
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1485
+ # will be added to the HTTP request.
1486
+ #
1487
+ #
1488
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
1489
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1490
+ nil
1491
+ end
1492
+
1493
+ #
1494
+ # Deletes a managed cluster.
1495
+ #
1496
+ # Deletes the managed cluster with a specified resource group and name.
1497
+ #
1498
+ # @param resource_group_name [String] The name of the resource group.
1499
+ # @param resource_name [String] The name of the managed cluster resource.
1500
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1501
+ # will be added to the HTTP request.
1502
+ #
1503
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1504
+ #
1505
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1506
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1507
+ end
1508
+
1509
+ #
1510
+ # Deletes a managed cluster.
1511
+ #
1512
+ # Deletes the managed cluster with a specified resource group and name.
1513
+ #
1514
+ # @param resource_group_name [String] The name of the resource group.
1515
+ # @param resource_name [String] The name of the managed cluster resource.
1516
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1517
+ # to the HTTP request.
1518
+ #
1519
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1520
+ #
1521
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
1522
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1523
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1524
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1525
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1526
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1527
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1528
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1529
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1530
+
1531
+
1532
+ request_headers = {}
1533
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1534
+
1535
+ # Set Headers
1536
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1537
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1538
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
1539
+
1540
+ request_url = @base_url || @client.base_url
1541
+
1542
+ options = {
1543
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1544
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1545
+ query_params: {'api-version' => @client.api_version},
1546
+ headers: request_headers.merge(custom_headers || {}),
1547
+ base_url: request_url
1548
+ }
1549
+ promise = @client.make_request_async(:delete, path_template, options)
1550
+
1551
+ promise = promise.then do |result|
1552
+ http_response = result.response
1553
+ status_code = http_response.status
1554
+ response_content = http_response.body
1555
+ unless status_code == 202 || status_code == 204
1556
+ error_model = JSON.load(response_content)
1557
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1558
+ end
1559
+
1560
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1561
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1562
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1563
+
1564
+ result
1565
+ end
1566
+
1567
+ promise.execute
1568
+ end
1569
+
1570
+ #
1571
+ # Reset Service Principal Profile of a managed cluster.
1572
+ #
1573
+ # Update the service principal Profile for a managed cluster.
1574
+ #
1575
+ # @param resource_group_name [String] The name of the resource group.
1576
+ # @param resource_name [String] The name of the managed cluster resource.
1577
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1578
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1580
+ # will be added to the HTTP request.
1581
+ #
1582
+ #
1583
+ def begin_reset_service_principal_profile(resource_group_name, resource_name, parameters, custom_headers:nil)
1584
+ response = begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1585
+ nil
1586
+ end
1587
+
1588
+ #
1589
+ # Reset Service Principal Profile of a managed cluster.
1590
+ #
1591
+ # Update the service principal Profile for a managed cluster.
1592
+ #
1593
+ # @param resource_group_name [String] The name of the resource group.
1594
+ # @param resource_name [String] The name of the managed cluster resource.
1595
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1596
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1598
+ # will be added to the HTTP request.
1599
+ #
1600
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1601
+ #
1602
+ def begin_reset_service_principal_profile_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1603
+ begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1604
+ end
1605
+
1606
+ #
1607
+ # Reset Service Principal Profile of a managed cluster.
1608
+ #
1609
+ # Update the service principal Profile for a managed cluster.
1610
+ #
1611
+ # @param resource_group_name [String] The name of the resource group.
1612
+ # @param resource_name [String] The name of the managed cluster resource.
1613
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1614
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1615
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1616
+ # to the HTTP request.
1617
+ #
1618
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1619
+ #
1620
+ def begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1621
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1622
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1623
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1624
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1625
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1626
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1627
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1628
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1629
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1630
+
1631
+
1632
+ request_headers = {}
1633
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1634
+
1635
+ # Set Headers
1636
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1637
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1638
+
1639
+ # Serialize Request
1640
+ request_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterServicePrincipalProfile.mapper()
1641
+ request_content = @client.serialize(request_mapper, parameters)
1642
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1643
+
1644
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'
1645
+
1646
+ request_url = @base_url || @client.base_url
1647
+
1648
+ options = {
1649
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1650
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1651
+ query_params: {'api-version' => @client.api_version},
1652
+ body: request_content,
1653
+ headers: request_headers.merge(custom_headers || {}),
1654
+ base_url: request_url
1655
+ }
1656
+ promise = @client.make_request_async(:post, path_template, options)
1657
+
1658
+ promise = promise.then do |result|
1659
+ http_response = result.response
1660
+ status_code = http_response.status
1661
+ response_content = http_response.body
1662
+ unless status_code == 200 || status_code == 202
1663
+ error_model = JSON.load(response_content)
1664
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1665
+ end
1666
+
1667
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1668
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1669
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1670
+
1671
+ result
1672
+ end
1673
+
1674
+ promise.execute
1675
+ end
1676
+
1677
+ #
1678
+ # Reset AAD Profile of a managed cluster.
1679
+ #
1680
+ # Update the AAD Profile for a managed cluster.
1681
+ #
1682
+ # @param resource_group_name [String] The name of the resource group.
1683
+ # @param resource_name [String] The name of the managed cluster resource.
1684
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1685
+ # AAD Profile operation for a Managed Cluster.
1686
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1687
+ # will be added to the HTTP request.
1688
+ #
1689
+ #
1690
+ def begin_reset_aadprofile(resource_group_name, resource_name, parameters, custom_headers:nil)
1691
+ response = begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1692
+ nil
1693
+ end
1694
+
1695
+ #
1696
+ # Reset AAD Profile of a managed cluster.
1697
+ #
1698
+ # Update the AAD Profile for a managed cluster.
1699
+ #
1700
+ # @param resource_group_name [String] The name of the resource group.
1701
+ # @param resource_name [String] The name of the managed cluster resource.
1702
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1703
+ # AAD Profile operation for a Managed Cluster.
1704
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1705
+ # will be added to the HTTP request.
1706
+ #
1707
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1708
+ #
1709
+ def begin_reset_aadprofile_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1710
+ begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1711
+ end
1712
+
1713
+ #
1714
+ # Reset AAD Profile of a managed cluster.
1715
+ #
1716
+ # Update the AAD Profile for a managed cluster.
1717
+ #
1718
+ # @param resource_group_name [String] The name of the resource group.
1719
+ # @param resource_name [String] The name of the managed cluster resource.
1720
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1721
+ # AAD Profile operation for a Managed Cluster.
1722
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1723
+ # to the HTTP request.
1724
+ #
1725
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1726
+ #
1727
+ def begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1728
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1729
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1730
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1731
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1732
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1733
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1734
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1735
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1736
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1737
+
1738
+
1739
+ request_headers = {}
1740
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1741
+
1742
+ # Set Headers
1743
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1744
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1745
+
1746
+ # Serialize Request
1747
+ request_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterAADProfile.mapper()
1748
+ request_content = @client.serialize(request_mapper, parameters)
1749
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1750
+
1751
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'
1752
+
1753
+ request_url = @base_url || @client.base_url
1754
+
1755
+ options = {
1756
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1757
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1758
+ query_params: {'api-version' => @client.api_version},
1759
+ body: request_content,
1760
+ headers: request_headers.merge(custom_headers || {}),
1761
+ base_url: request_url
1762
+ }
1763
+ promise = @client.make_request_async(:post, path_template, options)
1764
+
1765
+ promise = promise.then do |result|
1766
+ http_response = result.response
1767
+ status_code = http_response.status
1768
+ response_content = http_response.body
1769
+ unless status_code == 200 || status_code == 202
1770
+ error_model = JSON.load(response_content)
1771
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1772
+ end
1773
+
1774
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1775
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1776
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1777
+
1778
+ result
1779
+ end
1780
+
1781
+ promise.execute
1782
+ end
1783
+
1784
+ #
1785
+ # Rotate certificates of a managed cluster.
1786
+ #
1787
+ # Rotate certificates of a managed cluster.
1788
+ #
1789
+ # @param resource_group_name [String] The name of the resource group.
1790
+ # @param resource_name [String] The name of the managed cluster resource.
1791
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1792
+ # will be added to the HTTP request.
1793
+ #
1794
+ #
1795
+ def begin_rotate_cluster_certificates(resource_group_name, resource_name, custom_headers:nil)
1796
+ response = begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1797
+ nil
1798
+ end
1799
+
1800
+ #
1801
+ # Rotate certificates of a managed cluster.
1802
+ #
1803
+ # Rotate certificates of a managed cluster.
1804
+ #
1805
+ # @param resource_group_name [String] The name of the resource group.
1806
+ # @param resource_name [String] The name of the managed cluster resource.
1807
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1808
+ # will be added to the HTTP request.
1809
+ #
1810
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1811
+ #
1812
+ def begin_rotate_cluster_certificates_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1813
+ begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1814
+ end
1815
+
1816
+ #
1817
+ # Rotate certificates of a managed cluster.
1818
+ #
1819
+ # Rotate certificates of a managed cluster.
1820
+ #
1821
+ # @param resource_group_name [String] The name of the resource group.
1822
+ # @param resource_name [String] The name of the managed cluster resource.
1823
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1824
+ # to the HTTP request.
1825
+ #
1826
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1827
+ #
1828
+ def begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:nil)
1829
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1830
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1831
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1832
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1833
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1834
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1835
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1836
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1837
+
1838
+
1839
+ request_headers = {}
1840
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1841
+
1842
+ # Set Headers
1843
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1844
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1845
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'
1846
+
1847
+ request_url = @base_url || @client.base_url
1848
+
1849
+ options = {
1850
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1851
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1852
+ query_params: {'api-version' => @client.api_version},
1853
+ headers: request_headers.merge(custom_headers || {}),
1854
+ base_url: request_url
1855
+ }
1856
+ promise = @client.make_request_async(:post, path_template, options)
1857
+
1858
+ promise = promise.then do |result|
1859
+ http_response = result.response
1860
+ status_code = http_response.status
1861
+ response_content = http_response.body
1862
+ unless status_code == 202 || status_code == 204
1863
+ error_model = JSON.load(response_content)
1864
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1865
+ end
1866
+
1867
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1868
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1869
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1870
+
1871
+ result
1872
+ end
1873
+
1874
+ promise.execute
1875
+ end
1876
+
1877
+ #
1878
+ # Stop Managed Cluster
1879
+ #
1880
+ # Stops a Running Managed Cluster
1881
+ #
1882
+ # @param resource_group_name [String] The name of the resource group.
1883
+ # @param resource_name [String] The name of the managed cluster resource.
1884
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1885
+ # will be added to the HTTP request.
1886
+ #
1887
+ #
1888
+ def begin_stop(resource_group_name, resource_name, custom_headers:nil)
1889
+ response = begin_stop_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1890
+ nil
1891
+ end
1892
+
1893
+ #
1894
+ # Stop Managed Cluster
1895
+ #
1896
+ # Stops a Running Managed Cluster
1897
+ #
1898
+ # @param resource_group_name [String] The name of the resource group.
1899
+ # @param resource_name [String] The name of the managed cluster resource.
1900
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1901
+ # will be added to the HTTP request.
1902
+ #
1903
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1904
+ #
1905
+ def begin_stop_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1906
+ begin_stop_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1907
+ end
1908
+
1909
+ #
1910
+ # Stop Managed Cluster
1911
+ #
1912
+ # Stops a Running Managed Cluster
1913
+ #
1914
+ # @param resource_group_name [String] The name of the resource group.
1915
+ # @param resource_name [String] The name of the managed cluster resource.
1916
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1917
+ # to the HTTP request.
1918
+ #
1919
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1920
+ #
1921
+ def begin_stop_async(resource_group_name, resource_name, custom_headers:nil)
1922
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1923
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1924
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1925
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1926
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1927
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1928
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1929
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
1930
+
1931
+
1932
+ request_headers = {}
1933
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1934
+
1935
+ # Set Headers
1936
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1937
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1938
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'
1939
+
1940
+ request_url = @base_url || @client.base_url
1941
+
1942
+ options = {
1943
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1944
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1945
+ query_params: {'api-version' => @client.api_version},
1946
+ headers: request_headers.merge(custom_headers || {}),
1947
+ base_url: request_url
1948
+ }
1949
+ promise = @client.make_request_async(:post, path_template, options)
1950
+
1951
+ promise = promise.then do |result|
1952
+ http_response = result.response
1953
+ status_code = http_response.status
1954
+ response_content = http_response.body
1955
+ unless status_code == 202 || status_code == 204
1956
+ error_model = JSON.load(response_content)
1957
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1958
+ end
1959
+
1960
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1961
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1962
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1963
+
1964
+ result
1965
+ end
1966
+
1967
+ promise.execute
1968
+ end
1969
+
1970
+ #
1971
+ # Start Managed Cluster
1972
+ #
1973
+ # Starts a Stopped Managed Cluster
1974
+ #
1975
+ # @param resource_group_name [String] The name of the resource group.
1976
+ # @param resource_name [String] The name of the managed cluster resource.
1977
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1978
+ # will be added to the HTTP request.
1979
+ #
1980
+ #
1981
+ def begin_start(resource_group_name, resource_name, custom_headers:nil)
1982
+ response = begin_start_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1983
+ nil
1984
+ end
1985
+
1986
+ #
1987
+ # Start Managed Cluster
1988
+ #
1989
+ # Starts a Stopped Managed Cluster
1990
+ #
1991
+ # @param resource_group_name [String] The name of the resource group.
1992
+ # @param resource_name [String] The name of the managed cluster resource.
1993
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1994
+ # will be added to the HTTP request.
1995
+ #
1996
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1997
+ #
1998
+ def begin_start_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1999
+ begin_start_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
2000
+ end
2001
+
2002
+ #
2003
+ # Start Managed Cluster
2004
+ #
2005
+ # Starts a Stopped Managed Cluster
2006
+ #
2007
+ # @param resource_group_name [String] The name of the resource group.
2008
+ # @param resource_name [String] The name of the managed cluster resource.
2009
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2010
+ # to the HTTP request.
2011
+ #
2012
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2013
+ #
2014
+ def begin_start_async(resource_group_name, resource_name, custom_headers:nil)
2015
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2016
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2017
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2018
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2019
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
2020
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
2021
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
2022
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
2023
+
2024
+
2025
+ request_headers = {}
2026
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2027
+
2028
+ # Set Headers
2029
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2030
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2031
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'
2032
+
2033
+ request_url = @base_url || @client.base_url
2034
+
2035
+ options = {
2036
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2037
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
2038
+ query_params: {'api-version' => @client.api_version},
2039
+ headers: request_headers.merge(custom_headers || {}),
2040
+ base_url: request_url
2041
+ }
2042
+ promise = @client.make_request_async(:post, path_template, options)
2043
+
2044
+ promise = promise.then do |result|
2045
+ http_response = result.response
2046
+ status_code = http_response.status
2047
+ response_content = http_response.body
2048
+ unless status_code == 202 || status_code == 204
2049
+ error_model = JSON.load(response_content)
2050
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2051
+ end
2052
+
2053
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2054
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2055
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2056
+
2057
+ result
2058
+ end
2059
+
2060
+ promise.execute
2061
+ end
2062
+
2063
+ #
2064
+ # Gets a list of managed clusters in the specified subscription.
2065
+ #
2066
+ # Gets a list of managed clusters in the specified subscription. The operation
2067
+ # returns properties of each managed cluster.
2068
+ #
2069
+ # @param next_page_link [String] The NextLink from the previous successful call
2070
+ # to List operation.
2071
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2072
+ # will be added to the HTTP request.
2073
+ #
2074
+ # @return [ManagedClusterListResult] operation results.
2075
+ #
2076
+ def list_next(next_page_link, custom_headers:nil)
2077
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2078
+ response.body unless response.nil?
2079
+ end
2080
+
2081
+ #
2082
+ # Gets a list of managed clusters in the specified subscription.
2083
+ #
2084
+ # Gets a list of managed clusters in the specified subscription. The operation
2085
+ # returns properties of each managed cluster.
2086
+ #
2087
+ # @param next_page_link [String] The NextLink from the previous successful call
2088
+ # to List operation.
2089
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2090
+ # will be added to the HTTP request.
2091
+ #
2092
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2093
+ #
2094
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2095
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2096
+ end
2097
+
2098
+ #
2099
+ # Gets a list of managed clusters in the specified subscription.
2100
+ #
2101
+ # Gets a list of managed clusters in the specified subscription. The operation
2102
+ # returns properties of each managed cluster.
2103
+ #
2104
+ # @param next_page_link [String] The NextLink from the previous successful call
2105
+ # to List operation.
2106
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2107
+ # to the HTTP request.
2108
+ #
2109
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2110
+ #
2111
+ def list_next_async(next_page_link, custom_headers:nil)
2112
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2113
+
2114
+
2115
+ request_headers = {}
2116
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2117
+
2118
+ # Set Headers
2119
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2120
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2121
+ path_template = '{nextLink}'
2122
+
2123
+ request_url = @base_url || @client.base_url
2124
+
2125
+ options = {
2126
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2127
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2128
+ headers: request_headers.merge(custom_headers || {}),
2129
+ base_url: request_url
2130
+ }
2131
+ promise = @client.make_request_async(:get, path_template, options)
2132
+
2133
+ promise = promise.then do |result|
2134
+ http_response = result.response
2135
+ status_code = http_response.status
2136
+ response_content = http_response.body
2137
+ unless status_code == 200
2138
+ error_model = JSON.load(response_content)
2139
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2140
+ end
2141
+
2142
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2143
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2144
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2145
+ # Deserialize Response
2146
+ if status_code == 200
2147
+ begin
2148
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2149
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterListResult.mapper()
2150
+ result.body = @client.deserialize(result_mapper, parsed_response)
2151
+ rescue Exception => e
2152
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2153
+ end
2154
+ end
2155
+
2156
+ result
2157
+ end
2158
+
2159
+ promise.execute
2160
+ end
2161
+
2162
+ #
2163
+ # Lists managed clusters in the specified subscription and resource group.
2164
+ #
2165
+ # Lists managed clusters in the specified subscription and resource group. The
2166
+ # operation returns properties of each managed cluster.
2167
+ #
2168
+ # @param next_page_link [String] The NextLink from the previous successful call
2169
+ # to List operation.
2170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2171
+ # will be added to the HTTP request.
2172
+ #
2173
+ # @return [ManagedClusterListResult] operation results.
2174
+ #
2175
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
2176
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2177
+ response.body unless response.nil?
2178
+ end
2179
+
2180
+ #
2181
+ # Lists managed clusters in the specified subscription and resource group.
2182
+ #
2183
+ # Lists managed clusters in the specified subscription and resource group. The
2184
+ # operation returns properties of each managed cluster.
2185
+ #
2186
+ # @param next_page_link [String] The NextLink from the previous successful call
2187
+ # to List operation.
2188
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2189
+ # will be added to the HTTP request.
2190
+ #
2191
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2192
+ #
2193
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2194
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2195
+ end
2196
+
2197
+ #
2198
+ # Lists managed clusters in the specified subscription and resource group.
2199
+ #
2200
+ # Lists managed clusters in the specified subscription and resource group. The
2201
+ # operation returns properties of each managed cluster.
2202
+ #
2203
+ # @param next_page_link [String] The NextLink from the previous successful call
2204
+ # to List operation.
2205
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2206
+ # to the HTTP request.
2207
+ #
2208
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2209
+ #
2210
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
2211
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2212
+
2213
+
2214
+ request_headers = {}
2215
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2216
+
2217
+ # Set Headers
2218
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2219
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2220
+ path_template = '{nextLink}'
2221
+
2222
+ request_url = @base_url || @client.base_url
2223
+
2224
+ options = {
2225
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2226
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2227
+ headers: request_headers.merge(custom_headers || {}),
2228
+ base_url: request_url
2229
+ }
2230
+ promise = @client.make_request_async(:get, path_template, options)
2231
+
2232
+ promise = promise.then do |result|
2233
+ http_response = result.response
2234
+ status_code = http_response.status
2235
+ response_content = http_response.body
2236
+ unless status_code == 200
2237
+ error_model = JSON.load(response_content)
2238
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2239
+ end
2240
+
2241
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2242
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2243
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2244
+ # Deserialize Response
2245
+ if status_code == 200
2246
+ begin
2247
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2248
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::ManagedClusterListResult.mapper()
2249
+ result.body = @client.deserialize(result_mapper, parsed_response)
2250
+ rescue Exception => e
2251
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2252
+ end
2253
+ end
2254
+
2255
+ result
2256
+ end
2257
+
2258
+ promise.execute
2259
+ end
2260
+
2261
+ #
2262
+ # Gets a list of managed clusters in the specified subscription.
2263
+ #
2264
+ # Gets a list of managed clusters in the specified subscription. The operation
2265
+ # returns properties of each managed cluster.
2266
+ #
2267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2268
+ # will be added to the HTTP request.
2269
+ #
2270
+ # @return [ManagedClusterListResult] which provide lazy access to pages of the
2271
+ # response.
2272
+ #
2273
+ def list_as_lazy(custom_headers:nil)
2274
+ response = list_async(custom_headers:custom_headers).value!
2275
+ unless response.nil?
2276
+ page = response.body
2277
+ page.next_method = Proc.new do |next_page_link|
2278
+ list_next_async(next_page_link, custom_headers:custom_headers)
2279
+ end
2280
+ page
2281
+ end
2282
+ end
2283
+
2284
+ #
2285
+ # Lists managed clusters in the specified subscription and resource group.
2286
+ #
2287
+ # Lists managed clusters in the specified subscription and resource group. The
2288
+ # operation returns properties of each managed cluster.
2289
+ #
2290
+ # @param resource_group_name [String] The name of the resource group.
2291
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2292
+ # will be added to the HTTP request.
2293
+ #
2294
+ # @return [ManagedClusterListResult] which provide lazy access to pages of the
2295
+ # response.
2296
+ #
2297
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
2298
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
2299
+ unless response.nil?
2300
+ page = response.body
2301
+ page.next_method = Proc.new do |next_page_link|
2302
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
2303
+ end
2304
+ page
2305
+ end
2306
+ end
2307
+
2308
+ end
2309
+ end