azure_mgmt_container_service 0.20.3 → 0.20.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) 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.rb +99 -0
  21. data/lib/2020-07-01/generated/azure_mgmt_container_service/agent_pools.rb +900 -0
  22. data/lib/2020-07-01/generated/azure_mgmt_container_service/container_service_client.rb +145 -0
  23. data/lib/2020-07-01/generated/azure_mgmt_container_service/managed_clusters.rb +2197 -0
  24. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool.rb +441 -0
  25. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions.rb +93 -0
  26. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions_properties_agent_pool_versions_item.rb +71 -0
  27. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_list_result.rb +99 -0
  28. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_mode.rb +16 -0
  29. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_type.rb +16 -0
  30. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile.rb +129 -0
  31. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile_properties_upgrades_item.rb +59 -0
  32. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_settings.rb +47 -0
  33. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/connection_status.rb +18 -0
  34. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
  35. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
  36. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
  37. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_network_profile.rb +179 -0
  38. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
  39. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
  40. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
  41. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
  42. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
  43. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/credential_result.rb +59 -0
  44. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/credential_results.rb +57 -0
  45. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/license_type.rb +16 -0
  46. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/load_balancer_sku.rb +16 -0
  47. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster.rb +389 -0
  48. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_aadprofile.rb +123 -0
  49. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
  50. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile.rb +80 -0
  51. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile_identity.rb +59 -0
  52. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile.rb +280 -0
  53. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile_properties.rb +414 -0
  54. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_apiserver_access_profile.rb +66 -0
  55. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_identity.rb +104 -0
  56. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_identity_user_assigned_identities_value.rb +61 -0
  57. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
  58. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile.rb +132 -0
  59. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_managed_outbound_ips.rb +55 -0
  60. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ipprefixes.rb +57 -0
  61. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ips.rb +56 -0
  62. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +92 -0
  63. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile_upgrades_item.rb +59 -0
  64. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_properties_auto_scaler_profile.rb +135 -0
  65. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_properties_identity_profile_value.rb +61 -0
  66. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_service_principal_profile.rb +59 -0
  67. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_sku.rb +60 -0
  68. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_skuname.rb +15 -0
  69. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_skutier.rb +16 -0
  70. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
  71. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/managed_cluster_windows_profile.rb +76 -0
  72. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/network_mode.rb +16 -0
  73. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/network_plugin.rb +16 -0
  74. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/network_policy.rb +16 -0
  75. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/operation_list_result.rb +56 -0
  76. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/operation_value.rb +108 -0
  77. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
  78. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/outbound_type.rb +16 -0
  79. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/private_endpoint.rb +46 -0
  80. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/private_endpoint_connection.rb +111 -0
  81. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/private_endpoint_connection_list_result.rb +55 -0
  82. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/private_endpoint_connection_provisioning_state.rb +18 -0
  83. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/private_link_service_connection_state.rb +59 -0
  84. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/resource.rb +110 -0
  85. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/resource_identity_type.rb +17 -0
  86. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/resource_reference.rb +46 -0
  87. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/scale_set_eviction_policy.rb +16 -0
  88. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/scale_set_priority.rb +16 -0
  89. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/sub_resource.rb +72 -0
  90. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/tags_object.rb +54 -0
  91. data/lib/2020-07-01/generated/azure_mgmt_container_service/models/user_assigned_identity.rb +69 -0
  92. data/lib/2020-07-01/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  93. data/lib/2020-07-01/generated/azure_mgmt_container_service/operations.rb +109 -0
  94. data/lib/2020-07-01/generated/azure_mgmt_container_service/private_endpoint_connections.rb +515 -0
  95. data/lib/azure_mgmt_container_service.rb +1 -0
  96. data/lib/profiles/latest/modules/containerservice_profile_module.rb +143 -139
  97. data/lib/version.rb +1 -1
  98. metadata +77 -2
@@ -0,0 +1,145 @@
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_07_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ContainerServiceClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client Api Version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [Operations] operations
41
+ attr_reader :operations
42
+
43
+ # @return [ManagedClusters] managed_clusters
44
+ attr_reader :managed_clusters
45
+
46
+ # @return [AgentPools] agent_pools
47
+ attr_reader :agent_pools
48
+
49
+ # @return [PrivateEndpointConnections] private_endpoint_connections
50
+ attr_reader :private_endpoint_connections
51
+
52
+ #
53
+ # Creates initializes a new instance of the ContainerServiceClient class.
54
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
55
+ # @param base_url [String] the base URI of the service.
56
+ # @param options [Array] filters to be applied to the HTTP requests.
57
+ #
58
+ def initialize(credentials = nil, base_url = nil, options = nil)
59
+ super(credentials, options)
60
+ @base_url = base_url || 'https://management.azure.com'
61
+
62
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
63
+ @credentials = credentials
64
+
65
+ @operations = Operations.new(self)
66
+ @managed_clusters = ManagedClusters.new(self)
67
+ @agent_pools = AgentPools.new(self)
68
+ @private_endpoint_connections = PrivateEndpointConnections.new(self)
69
+ @api_version = '2020-07-01'
70
+ @accept_language = 'en-US'
71
+ @long_running_operation_retry_timeout = 30
72
+ @generate_client_request_id = true
73
+ add_telemetry
74
+ end
75
+
76
+ #
77
+ # Makes a request and returns the body of the response.
78
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
79
+ # @param path [String] the path, relative to {base_url}.
80
+ # @param options [Hash{String=>String}] specifying any request options like :body.
81
+ # @return [Hash{String=>String}] containing the body of the response.
82
+ # Example:
83
+ #
84
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
85
+ # path = "/path"
86
+ # options = {
87
+ # body: request_content,
88
+ # query_params: {'api-version' => '2016-02-01'}
89
+ # }
90
+ # result = @client.make_request(:put, path, options)
91
+ #
92
+ def make_request(method, path, options = {})
93
+ result = make_request_with_http_info(method, path, options)
94
+ result.body unless result.nil?
95
+ end
96
+
97
+ #
98
+ # Makes a request and returns the operation response.
99
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
100
+ # @param path [String] the path, relative to {base_url}.
101
+ # @param options [Hash{String=>String}] specifying any request options like :body.
102
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
103
+ #
104
+ def make_request_with_http_info(method, path, options = {})
105
+ result = make_request_async(method, path, options).value!
106
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
107
+ result
108
+ end
109
+
110
+ #
111
+ # Makes a request asynchronously.
112
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
113
+ # @param path [String] the path, relative to {base_url}.
114
+ # @param options [Hash{String=>String}] specifying any request options like :body.
115
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
116
+ #
117
+ def make_request_async(method, path, options = {})
118
+ fail ArgumentError, 'method is nil' if method.nil?
119
+ fail ArgumentError, 'path is nil' if path.nil?
120
+
121
+ request_url = options[:base_url] || @base_url
122
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
123
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
124
+ end
125
+
126
+ request_headers = @request_headers
127
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
128
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
129
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
130
+
131
+ super(request_url, method, path, options)
132
+ end
133
+
134
+
135
+ private
136
+ #
137
+ # Adds telemetry information.
138
+ #
139
+ def add_telemetry
140
+ sdk_information = 'azure_mgmt_container_service'
141
+ sdk_information = "#{sdk_information}/0.20.4"
142
+ add_user_agent_information(sdk_information)
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,2197 @@
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_07_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_07_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_07_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_07_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_07_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_07_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_07_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_07_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_07_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_07_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_07_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
+ # Upgrade node image version of an agent pool to the latest.
1150
+ #
1151
+ # Upgrade node image version of an agent pool to the latest.
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 agent_pool_name [String] The name of the agent pool.
1156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1157
+ # will be added to the HTTP request.
1158
+ #
1159
+ # @return [AgentPool] operation results.
1160
+ #
1161
+ def upgrade_node_image_version(resource_group_name, resource_name, agent_pool_name, custom_headers:nil)
1162
+ response = upgrade_node_image_version_async(resource_group_name, resource_name, agent_pool_name, custom_headers:custom_headers).value!
1163
+ response.body unless response.nil?
1164
+ end
1165
+
1166
+ #
1167
+ # @param resource_group_name [String] The name of the resource group.
1168
+ # @param resource_name [String] The name of the managed cluster resource.
1169
+ # @param agent_pool_name [String] The name of the agent pool.
1170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1171
+ # will be added to the HTTP request.
1172
+ #
1173
+ # @return [Concurrent::Promise] promise which provides async access to http
1174
+ # response.
1175
+ #
1176
+ def upgrade_node_image_version_async(resource_group_name, resource_name, agent_pool_name, custom_headers:nil)
1177
+ # Send request
1178
+ promise = begin_upgrade_node_image_version_async(resource_group_name, resource_name, agent_pool_name, custom_headers:custom_headers)
1179
+
1180
+ promise = promise.then do |response|
1181
+ # Defining deserialization method.
1182
+ deserialize_method = lambda do |parsed_response|
1183
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::AgentPool.mapper()
1184
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1185
+ end
1186
+
1187
+ # Waiting for response.
1188
+ @client.get_long_running_operation_result(response, deserialize_method)
1189
+ end
1190
+
1191
+ promise
1192
+ end
1193
+
1194
+ #
1195
+ # Creates or updates a managed cluster.
1196
+ #
1197
+ # Creates or updates a managed cluster with the specified configuration for
1198
+ # agents and Kubernetes version.
1199
+ #
1200
+ # @param resource_group_name [String] The name of the resource group.
1201
+ # @param resource_name [String] The name of the managed cluster resource.
1202
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
1203
+ # Update a Managed Cluster operation.
1204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1205
+ # will be added to the HTTP request.
1206
+ #
1207
+ # @return [ManagedCluster] operation results.
1208
+ #
1209
+ def begin_create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
1210
+ response = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1211
+ response.body unless response.nil?
1212
+ end
1213
+
1214
+ #
1215
+ # Creates or updates a managed cluster.
1216
+ #
1217
+ # Creates or updates a managed cluster with the specified configuration for
1218
+ # agents and Kubernetes version.
1219
+ #
1220
+ # @param resource_group_name [String] The name of the resource group.
1221
+ # @param resource_name [String] The name of the managed cluster resource.
1222
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
1223
+ # Update a Managed Cluster operation.
1224
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1225
+ # will be added to the HTTP request.
1226
+ #
1227
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1228
+ #
1229
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1230
+ begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1231
+ end
1232
+
1233
+ #
1234
+ # Creates or updates a managed cluster.
1235
+ #
1236
+ # Creates or updates a managed cluster with the specified configuration for
1237
+ # agents and Kubernetes version.
1238
+ #
1239
+ # @param resource_group_name [String] The name of the resource group.
1240
+ # @param resource_name [String] The name of the managed cluster resource.
1241
+ # @param parameters [ManagedCluster] Parameters supplied to the Create or
1242
+ # Update a Managed Cluster operation.
1243
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1244
+ # to the HTTP request.
1245
+ #
1246
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1247
+ #
1248
+ def begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1249
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1250
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1251
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1252
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1253
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1254
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1255
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1256
+ 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?
1257
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1258
+
1259
+
1260
+ request_headers = {}
1261
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1262
+
1263
+ # Set Headers
1264
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1265
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1266
+
1267
+ # Serialize Request
1268
+ request_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedCluster.mapper()
1269
+ request_content = @client.serialize(request_mapper, parameters)
1270
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1271
+
1272
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
1273
+
1274
+ request_url = @base_url || @client.base_url
1275
+
1276
+ options = {
1277
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1278
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1279
+ query_params: {'api-version' => @client.api_version},
1280
+ body: request_content,
1281
+ headers: request_headers.merge(custom_headers || {}),
1282
+ base_url: request_url
1283
+ }
1284
+ promise = @client.make_request_async(:put, path_template, options)
1285
+
1286
+ promise = promise.then do |result|
1287
+ http_response = result.response
1288
+ status_code = http_response.status
1289
+ response_content = http_response.body
1290
+ unless status_code == 200 || status_code == 201
1291
+ error_model = JSON.load(response_content)
1292
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1293
+ end
1294
+
1295
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1296
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1297
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1298
+ # Deserialize Response
1299
+ if status_code == 200
1300
+ begin
1301
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1302
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedCluster.mapper()
1303
+ result.body = @client.deserialize(result_mapper, parsed_response)
1304
+ rescue Exception => e
1305
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1306
+ end
1307
+ end
1308
+ # Deserialize Response
1309
+ if status_code == 201
1310
+ begin
1311
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1312
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedCluster.mapper()
1313
+ result.body = @client.deserialize(result_mapper, parsed_response)
1314
+ rescue Exception => e
1315
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1316
+ end
1317
+ end
1318
+
1319
+ result
1320
+ end
1321
+
1322
+ promise.execute
1323
+ end
1324
+
1325
+ #
1326
+ # Updates tags on a managed cluster.
1327
+ #
1328
+ # Updates a managed cluster with the specified tags.
1329
+ #
1330
+ # @param resource_group_name [String] The name of the resource group.
1331
+ # @param resource_name [String] The name of the managed cluster resource.
1332
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
1333
+ # Cluster Tags operation.
1334
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1335
+ # will be added to the HTTP request.
1336
+ #
1337
+ # @return [ManagedCluster] operation results.
1338
+ #
1339
+ def begin_update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
1340
+ response = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1341
+ response.body unless response.nil?
1342
+ end
1343
+
1344
+ #
1345
+ # Updates tags on a managed cluster.
1346
+ #
1347
+ # Updates a managed cluster with the specified tags.
1348
+ #
1349
+ # @param resource_group_name [String] The name of the resource group.
1350
+ # @param resource_name [String] The name of the managed cluster resource.
1351
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
1352
+ # Cluster Tags operation.
1353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1354
+ # will be added to the HTTP request.
1355
+ #
1356
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1357
+ #
1358
+ def begin_update_tags_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1359
+ begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1360
+ end
1361
+
1362
+ #
1363
+ # Updates tags on a managed cluster.
1364
+ #
1365
+ # Updates a managed cluster with the specified tags.
1366
+ #
1367
+ # @param resource_group_name [String] The name of the resource group.
1368
+ # @param resource_name [String] The name of the managed cluster resource.
1369
+ # @param parameters [TagsObject] Parameters supplied to the Update Managed
1370
+ # Cluster Tags operation.
1371
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1372
+ # to the HTTP request.
1373
+ #
1374
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1375
+ #
1376
+ def begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1377
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1378
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1379
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1380
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1381
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1382
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1383
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1384
+ 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?
1385
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1386
+
1387
+
1388
+ request_headers = {}
1389
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1390
+
1391
+ # Set Headers
1392
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1393
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1394
+
1395
+ # Serialize Request
1396
+ request_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::TagsObject.mapper()
1397
+ request_content = @client.serialize(request_mapper, parameters)
1398
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1399
+
1400
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
1401
+
1402
+ request_url = @base_url || @client.base_url
1403
+
1404
+ options = {
1405
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1406
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1407
+ query_params: {'api-version' => @client.api_version},
1408
+ body: request_content,
1409
+ headers: request_headers.merge(custom_headers || {}),
1410
+ base_url: request_url
1411
+ }
1412
+ promise = @client.make_request_async(:patch, path_template, options)
1413
+
1414
+ promise = promise.then do |result|
1415
+ http_response = result.response
1416
+ status_code = http_response.status
1417
+ response_content = http_response.body
1418
+ unless status_code == 200
1419
+ error_model = JSON.load(response_content)
1420
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1421
+ end
1422
+
1423
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1424
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1425
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1426
+ # Deserialize Response
1427
+ if status_code == 200
1428
+ begin
1429
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1430
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedCluster.mapper()
1431
+ result.body = @client.deserialize(result_mapper, parsed_response)
1432
+ rescue Exception => e
1433
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1434
+ end
1435
+ end
1436
+
1437
+ result
1438
+ end
1439
+
1440
+ promise.execute
1441
+ end
1442
+
1443
+ #
1444
+ # Deletes a managed cluster.
1445
+ #
1446
+ # Deletes the managed cluster with a specified resource group and name.
1447
+ #
1448
+ # @param resource_group_name [String] The name of the resource group.
1449
+ # @param resource_name [String] The name of the managed cluster resource.
1450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1451
+ # will be added to the HTTP request.
1452
+ #
1453
+ #
1454
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
1455
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1456
+ nil
1457
+ end
1458
+
1459
+ #
1460
+ # Deletes a managed cluster.
1461
+ #
1462
+ # Deletes the managed cluster with a specified resource group and name.
1463
+ #
1464
+ # @param resource_group_name [String] The name of the resource group.
1465
+ # @param resource_name [String] The name of the managed cluster resource.
1466
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1467
+ # will be added to the HTTP request.
1468
+ #
1469
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1470
+ #
1471
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1472
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1473
+ end
1474
+
1475
+ #
1476
+ # Deletes a managed cluster.
1477
+ #
1478
+ # Deletes the managed cluster with a specified resource group and name.
1479
+ #
1480
+ # @param resource_group_name [String] The name of the resource group.
1481
+ # @param resource_name [String] The name of the managed cluster resource.
1482
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1483
+ # to the HTTP request.
1484
+ #
1485
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1486
+ #
1487
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
1488
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1489
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1490
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1491
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1492
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1493
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1494
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1495
+ 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?
1496
+
1497
+
1498
+ request_headers = {}
1499
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1500
+
1501
+ # Set Headers
1502
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1503
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1504
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
1505
+
1506
+ request_url = @base_url || @client.base_url
1507
+
1508
+ options = {
1509
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1510
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1511
+ query_params: {'api-version' => @client.api_version},
1512
+ headers: request_headers.merge(custom_headers || {}),
1513
+ base_url: request_url
1514
+ }
1515
+ promise = @client.make_request_async(:delete, path_template, options)
1516
+
1517
+ promise = promise.then do |result|
1518
+ http_response = result.response
1519
+ status_code = http_response.status
1520
+ response_content = http_response.body
1521
+ unless status_code == 202 || status_code == 204
1522
+ error_model = JSON.load(response_content)
1523
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1524
+ end
1525
+
1526
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1527
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1528
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1529
+
1530
+ result
1531
+ end
1532
+
1533
+ promise.execute
1534
+ end
1535
+
1536
+ #
1537
+ # Reset Service Principal Profile of a managed cluster.
1538
+ #
1539
+ # Update the service principal Profile for a managed cluster.
1540
+ #
1541
+ # @param resource_group_name [String] The name of the resource group.
1542
+ # @param resource_name [String] The name of the managed cluster resource.
1543
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1544
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1546
+ # will be added to the HTTP request.
1547
+ #
1548
+ #
1549
+ def begin_reset_service_principal_profile(resource_group_name, resource_name, parameters, custom_headers:nil)
1550
+ response = begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1551
+ nil
1552
+ end
1553
+
1554
+ #
1555
+ # Reset Service Principal Profile of a managed cluster.
1556
+ #
1557
+ # Update the service principal Profile for a managed cluster.
1558
+ #
1559
+ # @param resource_group_name [String] The name of the resource group.
1560
+ # @param resource_name [String] The name of the managed cluster resource.
1561
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1562
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1563
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1564
+ # will be added to the HTTP request.
1565
+ #
1566
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1567
+ #
1568
+ def begin_reset_service_principal_profile_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1569
+ begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1570
+ end
1571
+
1572
+ #
1573
+ # Reset Service Principal Profile of a managed cluster.
1574
+ #
1575
+ # Update the service principal Profile for a managed cluster.
1576
+ #
1577
+ # @param resource_group_name [String] The name of the resource group.
1578
+ # @param resource_name [String] The name of the managed cluster resource.
1579
+ # @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
1580
+ # to the Reset Service Principal Profile operation for a Managed Cluster.
1581
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1582
+ # to the HTTP request.
1583
+ #
1584
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1585
+ #
1586
+ def begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1587
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1588
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1589
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1590
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1591
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1592
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1593
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1594
+ 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?
1595
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1596
+
1597
+
1598
+ request_headers = {}
1599
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1600
+
1601
+ # Set Headers
1602
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1603
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1604
+
1605
+ # Serialize Request
1606
+ request_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedClusterServicePrincipalProfile.mapper()
1607
+ request_content = @client.serialize(request_mapper, parameters)
1608
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1609
+
1610
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'
1611
+
1612
+ request_url = @base_url || @client.base_url
1613
+
1614
+ options = {
1615
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1616
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1617
+ query_params: {'api-version' => @client.api_version},
1618
+ body: request_content,
1619
+ headers: request_headers.merge(custom_headers || {}),
1620
+ base_url: request_url
1621
+ }
1622
+ promise = @client.make_request_async(:post, path_template, options)
1623
+
1624
+ promise = promise.then do |result|
1625
+ http_response = result.response
1626
+ status_code = http_response.status
1627
+ response_content = http_response.body
1628
+ unless status_code == 200 || status_code == 202
1629
+ error_model = JSON.load(response_content)
1630
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1631
+ end
1632
+
1633
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1634
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1635
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1636
+
1637
+ result
1638
+ end
1639
+
1640
+ promise.execute
1641
+ end
1642
+
1643
+ #
1644
+ # Reset AAD Profile of a managed cluster.
1645
+ #
1646
+ # Update the AAD Profile for a managed cluster.
1647
+ #
1648
+ # @param resource_group_name [String] The name of the resource group.
1649
+ # @param resource_name [String] The name of the managed cluster resource.
1650
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1651
+ # AAD Profile operation for a Managed Cluster.
1652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1653
+ # will be added to the HTTP request.
1654
+ #
1655
+ #
1656
+ def begin_reset_aadprofile(resource_group_name, resource_name, parameters, custom_headers:nil)
1657
+ response = begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1658
+ nil
1659
+ end
1660
+
1661
+ #
1662
+ # Reset AAD Profile of a managed cluster.
1663
+ #
1664
+ # Update the AAD Profile for a managed cluster.
1665
+ #
1666
+ # @param resource_group_name [String] The name of the resource group.
1667
+ # @param resource_name [String] The name of the managed cluster resource.
1668
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1669
+ # AAD Profile operation for a Managed Cluster.
1670
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1671
+ # will be added to the HTTP request.
1672
+ #
1673
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1674
+ #
1675
+ def begin_reset_aadprofile_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
1676
+ begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
1677
+ end
1678
+
1679
+ #
1680
+ # Reset AAD Profile of a managed cluster.
1681
+ #
1682
+ # Update the AAD Profile for a managed cluster.
1683
+ #
1684
+ # @param resource_group_name [String] The name of the resource group.
1685
+ # @param resource_name [String] The name of the managed cluster resource.
1686
+ # @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
1687
+ # AAD Profile operation for a Managed Cluster.
1688
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1689
+ # to the HTTP request.
1690
+ #
1691
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1692
+ #
1693
+ def begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
1694
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1695
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1696
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1697
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1698
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1699
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1700
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1701
+ 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?
1702
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1703
+
1704
+
1705
+ request_headers = {}
1706
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1707
+
1708
+ # Set Headers
1709
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1710
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1711
+
1712
+ # Serialize Request
1713
+ request_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedClusterAADProfile.mapper()
1714
+ request_content = @client.serialize(request_mapper, parameters)
1715
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1716
+
1717
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'
1718
+
1719
+ request_url = @base_url || @client.base_url
1720
+
1721
+ options = {
1722
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1723
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1724
+ query_params: {'api-version' => @client.api_version},
1725
+ body: request_content,
1726
+ headers: request_headers.merge(custom_headers || {}),
1727
+ base_url: request_url
1728
+ }
1729
+ promise = @client.make_request_async(:post, path_template, options)
1730
+
1731
+ promise = promise.then do |result|
1732
+ http_response = result.response
1733
+ status_code = http_response.status
1734
+ response_content = http_response.body
1735
+ unless status_code == 200 || status_code == 202
1736
+ error_model = JSON.load(response_content)
1737
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1738
+ end
1739
+
1740
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1741
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1742
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1743
+
1744
+ result
1745
+ end
1746
+
1747
+ promise.execute
1748
+ end
1749
+
1750
+ #
1751
+ # Rotate certificates of a managed cluster.
1752
+ #
1753
+ # Rotate certificates of a managed cluster.
1754
+ #
1755
+ # @param resource_group_name [String] The name of the resource group.
1756
+ # @param resource_name [String] The name of the managed cluster resource.
1757
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1758
+ # will be added to the HTTP request.
1759
+ #
1760
+ #
1761
+ def begin_rotate_cluster_certificates(resource_group_name, resource_name, custom_headers:nil)
1762
+ response = begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1763
+ nil
1764
+ end
1765
+
1766
+ #
1767
+ # Rotate certificates of a managed cluster.
1768
+ #
1769
+ # Rotate certificates of a managed cluster.
1770
+ #
1771
+ # @param resource_group_name [String] The name of the resource group.
1772
+ # @param resource_name [String] The name of the managed cluster resource.
1773
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1774
+ # will be added to the HTTP request.
1775
+ #
1776
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1777
+ #
1778
+ def begin_rotate_cluster_certificates_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1779
+ begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1780
+ end
1781
+
1782
+ #
1783
+ # Rotate certificates of a managed cluster.
1784
+ #
1785
+ # Rotate certificates of a managed cluster.
1786
+ #
1787
+ # @param resource_group_name [String] The name of the resource group.
1788
+ # @param resource_name [String] The name of the managed cluster resource.
1789
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1790
+ # to the HTTP request.
1791
+ #
1792
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1793
+ #
1794
+ def begin_rotate_cluster_certificates_async(resource_group_name, resource_name, custom_headers:nil)
1795
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1796
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1797
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1798
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1799
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1800
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1801
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1802
+ 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?
1803
+
1804
+
1805
+ request_headers = {}
1806
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1807
+
1808
+ # Set Headers
1809
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1810
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1811
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'
1812
+
1813
+ request_url = @base_url || @client.base_url
1814
+
1815
+ options = {
1816
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1817
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1818
+ query_params: {'api-version' => @client.api_version},
1819
+ headers: request_headers.merge(custom_headers || {}),
1820
+ base_url: request_url
1821
+ }
1822
+ promise = @client.make_request_async(:post, path_template, options)
1823
+
1824
+ promise = promise.then do |result|
1825
+ http_response = result.response
1826
+ status_code = http_response.status
1827
+ response_content = http_response.body
1828
+ unless status_code == 202 || status_code == 204
1829
+ error_model = JSON.load(response_content)
1830
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1831
+ end
1832
+
1833
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1834
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1835
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1836
+
1837
+ result
1838
+ end
1839
+
1840
+ promise.execute
1841
+ end
1842
+
1843
+ #
1844
+ # Upgrade node image version of an agent pool to the latest.
1845
+ #
1846
+ # Upgrade node image version of an agent pool to the latest.
1847
+ #
1848
+ # @param resource_group_name [String] The name of the resource group.
1849
+ # @param resource_name [String] The name of the managed cluster resource.
1850
+ # @param agent_pool_name [String] The name of the agent pool.
1851
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1852
+ # will be added to the HTTP request.
1853
+ #
1854
+ # @return [AgentPool] operation results.
1855
+ #
1856
+ def begin_upgrade_node_image_version(resource_group_name, resource_name, agent_pool_name, custom_headers:nil)
1857
+ response = begin_upgrade_node_image_version_async(resource_group_name, resource_name, agent_pool_name, custom_headers:custom_headers).value!
1858
+ response.body unless response.nil?
1859
+ end
1860
+
1861
+ #
1862
+ # Upgrade node image version of an agent pool to the latest.
1863
+ #
1864
+ # Upgrade node image version of an agent pool to the latest.
1865
+ #
1866
+ # @param resource_group_name [String] The name of the resource group.
1867
+ # @param resource_name [String] The name of the managed cluster resource.
1868
+ # @param agent_pool_name [String] The name of the agent pool.
1869
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1870
+ # will be added to the HTTP request.
1871
+ #
1872
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1873
+ #
1874
+ def begin_upgrade_node_image_version_with_http_info(resource_group_name, resource_name, agent_pool_name, custom_headers:nil)
1875
+ begin_upgrade_node_image_version_async(resource_group_name, resource_name, agent_pool_name, custom_headers:custom_headers).value!
1876
+ end
1877
+
1878
+ #
1879
+ # Upgrade node image version of an agent pool to the latest.
1880
+ #
1881
+ # Upgrade node image version of an agent pool to the latest.
1882
+ #
1883
+ # @param resource_group_name [String] The name of the resource group.
1884
+ # @param resource_name [String] The name of the managed cluster resource.
1885
+ # @param agent_pool_name [String] The name of the agent pool.
1886
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1887
+ # to the HTTP request.
1888
+ #
1889
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1890
+ #
1891
+ def begin_upgrade_node_image_version_async(resource_group_name, resource_name, agent_pool_name, custom_headers:nil)
1892
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1893
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1894
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1895
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1896
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1897
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
1898
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
1899
+ 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?
1900
+ fail ArgumentError, 'agent_pool_name is nil' if agent_pool_name.nil?
1901
+
1902
+
1903
+ request_headers = {}
1904
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1905
+
1906
+ # Set Headers
1907
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1908
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1909
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'
1910
+
1911
+ request_url = @base_url || @client.base_url
1912
+
1913
+ options = {
1914
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1915
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'agentPoolName' => agent_pool_name},
1916
+ query_params: {'api-version' => @client.api_version},
1917
+ headers: request_headers.merge(custom_headers || {}),
1918
+ base_url: request_url
1919
+ }
1920
+ promise = @client.make_request_async(:post, path_template, options)
1921
+
1922
+ promise = promise.then do |result|
1923
+ http_response = result.response
1924
+ status_code = http_response.status
1925
+ response_content = http_response.body
1926
+ unless status_code == 200 || status_code == 202
1927
+ error_model = JSON.load(response_content)
1928
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1929
+ end
1930
+
1931
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1932
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1933
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1934
+ # Deserialize Response
1935
+ if status_code == 202
1936
+ begin
1937
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1938
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::AgentPool.mapper()
1939
+ result.body = @client.deserialize(result_mapper, parsed_response)
1940
+ rescue Exception => e
1941
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1942
+ end
1943
+ end
1944
+
1945
+ result
1946
+ end
1947
+
1948
+ promise.execute
1949
+ end
1950
+
1951
+ #
1952
+ # Gets a list of managed clusters in the specified subscription.
1953
+ #
1954
+ # Gets a list of managed clusters in the specified subscription. The operation
1955
+ # returns properties of each managed cluster.
1956
+ #
1957
+ # @param next_page_link [String] The NextLink from the previous successful call
1958
+ # to List operation.
1959
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1960
+ # will be added to the HTTP request.
1961
+ #
1962
+ # @return [ManagedClusterListResult] operation results.
1963
+ #
1964
+ def list_next(next_page_link, custom_headers:nil)
1965
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1966
+ response.body unless response.nil?
1967
+ end
1968
+
1969
+ #
1970
+ # Gets a list of managed clusters in the specified subscription.
1971
+ #
1972
+ # Gets a list of managed clusters in the specified subscription. The operation
1973
+ # returns properties of each managed cluster.
1974
+ #
1975
+ # @param next_page_link [String] The NextLink from the previous successful call
1976
+ # to List operation.
1977
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1978
+ # will be added to the HTTP request.
1979
+ #
1980
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1981
+ #
1982
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1983
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1984
+ end
1985
+
1986
+ #
1987
+ # Gets a list of managed clusters in the specified subscription.
1988
+ #
1989
+ # Gets a list of managed clusters in the specified subscription. The operation
1990
+ # returns properties of each managed cluster.
1991
+ #
1992
+ # @param next_page_link [String] The NextLink from the previous successful call
1993
+ # to List operation.
1994
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1995
+ # to the HTTP request.
1996
+ #
1997
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1998
+ #
1999
+ def list_next_async(next_page_link, custom_headers:nil)
2000
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2001
+
2002
+
2003
+ request_headers = {}
2004
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2005
+
2006
+ # Set Headers
2007
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2008
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2009
+ path_template = '{nextLink}'
2010
+
2011
+ request_url = @base_url || @client.base_url
2012
+
2013
+ options = {
2014
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2015
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2016
+ headers: request_headers.merge(custom_headers || {}),
2017
+ base_url: request_url
2018
+ }
2019
+ promise = @client.make_request_async(:get, path_template, options)
2020
+
2021
+ promise = promise.then do |result|
2022
+ http_response = result.response
2023
+ status_code = http_response.status
2024
+ response_content = http_response.body
2025
+ unless status_code == 200
2026
+ error_model = JSON.load(response_content)
2027
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2028
+ end
2029
+
2030
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2031
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2032
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2033
+ # Deserialize Response
2034
+ if status_code == 200
2035
+ begin
2036
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2037
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedClusterListResult.mapper()
2038
+ result.body = @client.deserialize(result_mapper, parsed_response)
2039
+ rescue Exception => e
2040
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2041
+ end
2042
+ end
2043
+
2044
+ result
2045
+ end
2046
+
2047
+ promise.execute
2048
+ end
2049
+
2050
+ #
2051
+ # Lists managed clusters in the specified subscription and resource group.
2052
+ #
2053
+ # Lists managed clusters in the specified subscription and resource group. The
2054
+ # operation returns properties of each managed cluster.
2055
+ #
2056
+ # @param next_page_link [String] The NextLink from the previous successful call
2057
+ # to List operation.
2058
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2059
+ # will be added to the HTTP request.
2060
+ #
2061
+ # @return [ManagedClusterListResult] operation results.
2062
+ #
2063
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
2064
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2065
+ response.body unless response.nil?
2066
+ end
2067
+
2068
+ #
2069
+ # Lists managed clusters in the specified subscription and resource group.
2070
+ #
2071
+ # Lists managed clusters in the specified subscription and resource group. The
2072
+ # operation returns properties of each managed cluster.
2073
+ #
2074
+ # @param next_page_link [String] The NextLink from the previous successful call
2075
+ # to List operation.
2076
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2077
+ # will be added to the HTTP request.
2078
+ #
2079
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2080
+ #
2081
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2082
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2083
+ end
2084
+
2085
+ #
2086
+ # Lists managed clusters in the specified subscription and resource group.
2087
+ #
2088
+ # Lists managed clusters in the specified subscription and resource group. The
2089
+ # operation returns properties of each managed cluster.
2090
+ #
2091
+ # @param next_page_link [String] The NextLink from the previous successful call
2092
+ # to List operation.
2093
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2094
+ # to the HTTP request.
2095
+ #
2096
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2097
+ #
2098
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
2099
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2100
+
2101
+
2102
+ request_headers = {}
2103
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2104
+
2105
+ # Set Headers
2106
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2107
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2108
+ path_template = '{nextLink}'
2109
+
2110
+ request_url = @base_url || @client.base_url
2111
+
2112
+ options = {
2113
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2114
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2115
+ headers: request_headers.merge(custom_headers || {}),
2116
+ base_url: request_url
2117
+ }
2118
+ promise = @client.make_request_async(:get, path_template, options)
2119
+
2120
+ promise = promise.then do |result|
2121
+ http_response = result.response
2122
+ status_code = http_response.status
2123
+ response_content = http_response.body
2124
+ unless status_code == 200
2125
+ error_model = JSON.load(response_content)
2126
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2127
+ end
2128
+
2129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2130
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2131
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2132
+ # Deserialize Response
2133
+ if status_code == 200
2134
+ begin
2135
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2136
+ result_mapper = Azure::ContainerService::Mgmt::V2020_07_01::Models::ManagedClusterListResult.mapper()
2137
+ result.body = @client.deserialize(result_mapper, parsed_response)
2138
+ rescue Exception => e
2139
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2140
+ end
2141
+ end
2142
+
2143
+ result
2144
+ end
2145
+
2146
+ promise.execute
2147
+ end
2148
+
2149
+ #
2150
+ # Gets a list of managed clusters in the specified subscription.
2151
+ #
2152
+ # Gets a list of managed clusters in the specified subscription. The operation
2153
+ # returns properties of each managed cluster.
2154
+ #
2155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2156
+ # will be added to the HTTP request.
2157
+ #
2158
+ # @return [ManagedClusterListResult] which provide lazy access to pages of the
2159
+ # response.
2160
+ #
2161
+ def list_as_lazy(custom_headers:nil)
2162
+ response = list_async(custom_headers:custom_headers).value!
2163
+ unless response.nil?
2164
+ page = response.body
2165
+ page.next_method = Proc.new do |next_page_link|
2166
+ list_next_async(next_page_link, custom_headers:custom_headers)
2167
+ end
2168
+ page
2169
+ end
2170
+ end
2171
+
2172
+ #
2173
+ # Lists managed clusters in the specified subscription and resource group.
2174
+ #
2175
+ # Lists managed clusters in the specified subscription and resource group. The
2176
+ # operation returns properties of each managed cluster.
2177
+ #
2178
+ # @param resource_group_name [String] The name of the resource group.
2179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2180
+ # will be added to the HTTP request.
2181
+ #
2182
+ # @return [ManagedClusterListResult] which provide lazy access to pages of the
2183
+ # response.
2184
+ #
2185
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
2186
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
2187
+ unless response.nil?
2188
+ page = response.body
2189
+ page.next_method = Proc.new do |next_page_link|
2190
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
2191
+ end
2192
+ page
2193
+ end
2194
+ end
2195
+
2196
+ end
2197
+ end