azure_mgmt_container_service 0.20.2 → 0.20.3

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