azure_mgmt_container_service 0.18.5 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/2016-03-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2016-03-30/generated/azure_mgmt_container_service/container_services.rb +10 -0
- data/lib/2016-09-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2016-09-30/generated/azure_mgmt_container_service/container_services.rb +14 -0
- data/lib/2017-01-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2017-01-31/generated/azure_mgmt_container_service/container_services.rb +14 -0
- data/lib/2017-07-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2017-07-01/generated/azure_mgmt_container_service/container_services.rb +14 -0
- data/lib/2017-08-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2017-08-31/generated/azure_mgmt_container_service/managed_clusters.rb +20 -0
- data/lib/2017-09-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2017-09-30/generated/azure_mgmt_container_service/container_services.rb +2 -0
- data/lib/2018-03-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2018-03-31/generated/azure_mgmt_container_service/managed_clusters.rb +28 -0
- data/lib/2018-03-31/generated/azure_mgmt_container_service/operations.rb +2 -0
- data/lib/2018-08-01-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2018-08-01-preview/generated/azure_mgmt_container_service/managed_clusters.rb +28 -0
- data/lib/2018-08-01-preview/generated/azure_mgmt_container_service/operations.rb +2 -0
- data/lib/2018-09-30-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2018-09-30-preview/generated/azure_mgmt_container_service/open_shift_managed_clusters.rb +16 -0
- data/lib/2019-02-01/generated/azure_mgmt_container_service/agent_pools.rb +10 -0
- data/lib/2019-02-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2019-02-01/generated/azure_mgmt_container_service/managed_clusters.rb +28 -0
- data/lib/2019-02-01/generated/azure_mgmt_container_service/operations.rb +2 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_service/agent_pools.rb +81 -76
- data/lib/2019-04-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2019-04-01/generated/azure_mgmt_container_service/container_services.rb +2 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_service/managed_clusters.rb +58 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_service/operations.rb +2 -0
- data/lib/2019-04-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
- data/lib/2019-04-30/generated/azure_mgmt_container_service/open_shift_managed_clusters.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service.rb +77 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/agent_pools.rb +904 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/container_service_client.rb +145 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/container_services.rb +133 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/managed_clusters.rb +1788 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool.rb +344 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions.rb +93 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions_properties_agent_pool_versions_item.rb +71 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool_list_result.rb +99 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool_type.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile.rb +117 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile_properties_upgrades_item.rb +59 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_network_profile.rb +140 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/credential_result.rb +59 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/credential_results.rb +57 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/load_balancer_sku.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster.rb +325 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_aadprofile.rb +80 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile.rb +66 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile.rb +211 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile_properties.rb +317 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_identity.rb +78 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +92 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile_upgrades_item.rb +59 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_service_principal_profile.rb +59 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/managed_cluster_windows_profile.rb +63 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/network_plugin.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/network_policy.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/operation_list_result.rb +56 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/operation_value.rb +108 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/orchestrator_profile.rb +68 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/orchestrator_version_profile.rb +100 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/orchestrator_version_profile_list_result.rb +92 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/resource.rb +110 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/resource_identity_type.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/scale_set_eviction_policy.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/scale_set_priority.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/sub_resource.rb +72 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/models/tags_object.rb +54 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/module_definition.rb +9 -0
- data/lib/2019-06-01/generated/azure_mgmt_container_service/operations.rb +109 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service.rb +83 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/agent_pools.rb +904 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/container_service_client.rb +145 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/container_services.rb +133 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/managed_clusters.rb +1788 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool.rb +344 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions.rb +93 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions_properties_agent_pool_versions_item.rb +71 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool_list_result.rb +99 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool_type.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile.rb +117 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile_properties_upgrades_item.rb +59 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_network_profile.rb +153 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/credential_result.rb +59 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/credential_results.rb +57 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/load_balancer_sku.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster.rb +318 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_aadprofile.rb +80 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile.rb +66 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile.rb +211 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile_properties.rb +317 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_apiserver_access_profile.rb +66 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_identity.rb +78 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile.rb +95 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_managed_outbound_ips.rb +55 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ipprefixes.rb +57 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ips.rb +56 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +92 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile_upgrades_item.rb +59 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_service_principal_profile.rb +59 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/managed_cluster_windows_profile.rb +63 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/network_plugin.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/network_policy.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/operation_list_result.rb +56 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/operation_value.rb +108 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/orchestrator_profile.rb +68 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/orchestrator_version_profile.rb +100 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/orchestrator_version_profile_list_result.rb +92 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/resource.rb +110 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/resource_identity_type.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/resource_reference.rb +46 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/scale_set_eviction_policy.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/scale_set_priority.rb +16 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/sub_resource.rb +72 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/models/tags_object.rb +54 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/module_definition.rb +9 -0
- data/lib/2019-08-01/generated/azure_mgmt_container_service/operations.rb +109 -0
- data/lib/azure_mgmt_container_service.rb +9 -7
- data/lib/profiles/latest/modules/containerservice_profile_module.rb +207 -143
- data/lib/version.rb +1 -1
- metadata +117 -5
@@ -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::V2019_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 [ContainerServices] container_services
|
41
|
+
attr_reader :container_services
|
42
|
+
|
43
|
+
# @return [Operations] operations
|
44
|
+
attr_reader :operations
|
45
|
+
|
46
|
+
# @return [ManagedClusters] managed_clusters
|
47
|
+
attr_reader :managed_clusters
|
48
|
+
|
49
|
+
# @return [AgentPools] agent_pools
|
50
|
+
attr_reader :agent_pools
|
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
|
+
@container_services = ContainerServices.new(self)
|
66
|
+
@operations = Operations.new(self)
|
67
|
+
@managed_clusters = ManagedClusters.new(self)
|
68
|
+
@agent_pools = AgentPools.new(self)
|
69
|
+
@api_version = '2019-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.19.0"
|
142
|
+
add_user_agent_information(sdk_information)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
@@ -0,0 +1,133 @@
|
|
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::V2019_06_01
|
7
|
+
#
|
8
|
+
# The Container Service Client.
|
9
|
+
#
|
10
|
+
class ContainerServices
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ContainerServices 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 supported orchestrators in the specified subscription.
|
26
|
+
#
|
27
|
+
# Gets a list of supported orchestrators in the specified subscription. The
|
28
|
+
# operation returns properties of each orchestrator including version,
|
29
|
+
# available upgrades and whether that version or upgrades are in preview.
|
30
|
+
#
|
31
|
+
# @param location [String] The name of a supported Azure region.
|
32
|
+
# @param resource_type [String] resource type for which the list of
|
33
|
+
# orchestrators needs to be returned
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
# @return [OrchestratorVersionProfileListResult] operation results.
|
38
|
+
#
|
39
|
+
def list_orchestrators(location, resource_type:nil, custom_headers:nil)
|
40
|
+
response = list_orchestrators_async(location, resource_type:resource_type, custom_headers:custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Gets a list of supported orchestrators in the specified subscription.
|
46
|
+
#
|
47
|
+
# Gets a list of supported orchestrators in the specified subscription. The
|
48
|
+
# operation returns properties of each orchestrator including version,
|
49
|
+
# available upgrades and whether that version or upgrades are in preview.
|
50
|
+
#
|
51
|
+
# @param location [String] The name of a supported Azure region.
|
52
|
+
# @param resource_type [String] resource type for which the list of
|
53
|
+
# orchestrators needs to be returned
|
54
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
55
|
+
# will be added to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
58
|
+
#
|
59
|
+
def list_orchestrators_with_http_info(location, resource_type:nil, custom_headers:nil)
|
60
|
+
list_orchestrators_async(location, resource_type:resource_type, custom_headers:custom_headers).value!
|
61
|
+
end
|
62
|
+
|
63
|
+
#
|
64
|
+
# Gets a list of supported orchestrators in the specified subscription.
|
65
|
+
#
|
66
|
+
# Gets a list of supported orchestrators in the specified subscription. The
|
67
|
+
# operation returns properties of each orchestrator including version,
|
68
|
+
# available upgrades and whether that version or upgrades are in preview.
|
69
|
+
#
|
70
|
+
# @param location [String] The name of a supported Azure region.
|
71
|
+
# @param resource_type [String] resource type for which the list of
|
72
|
+
# orchestrators needs to be returned
|
73
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
74
|
+
# to the HTTP request.
|
75
|
+
#
|
76
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
77
|
+
#
|
78
|
+
def list_orchestrators_async(location, resource_type:nil, custom_headers:nil)
|
79
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
81
|
+
fail ArgumentError, 'location is nil' if location.nil?
|
82
|
+
|
83
|
+
|
84
|
+
request_headers = {}
|
85
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
86
|
+
|
87
|
+
# Set Headers
|
88
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
89
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
90
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators'
|
91
|
+
|
92
|
+
request_url = @base_url || @client.base_url
|
93
|
+
|
94
|
+
options = {
|
95
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
96
|
+
path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
|
97
|
+
query_params: {'api-version' => @client.api_version,'resource-type' => resource_type},
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
100
|
+
}
|
101
|
+
promise = @client.make_request_async(:get, path_template, options)
|
102
|
+
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
105
|
+
status_code = http_response.status
|
106
|
+
response_content = http_response.body
|
107
|
+
unless status_code == 200
|
108
|
+
error_model = JSON.load(response_content)
|
109
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
110
|
+
end
|
111
|
+
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
113
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
114
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
115
|
+
# Deserialize Response
|
116
|
+
if status_code == 200
|
117
|
+
begin
|
118
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
119
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::OrchestratorVersionProfileListResult.mapper()
|
120
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
121
|
+
rescue Exception => e
|
122
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
result
|
127
|
+
end
|
128
|
+
|
129
|
+
promise.execute
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
133
|
+
end
|
@@ -0,0 +1,1788 @@
|
|
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::V2019_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::V2019_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::V2019_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::V2019_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.
|
331
|
+
#
|
332
|
+
# @param resource_group_name [String] The name of the resource group.
|
333
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
334
|
+
# @param role_name [String] The name of the role for managed cluster
|
335
|
+
# accessProfile resource.
|
336
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
337
|
+
# will be added to the HTTP request.
|
338
|
+
#
|
339
|
+
# @return [ManagedClusterAccessProfile] operation results.
|
340
|
+
#
|
341
|
+
def get_access_profile(resource_group_name, resource_name, role_name, custom_headers:nil)
|
342
|
+
response = get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:custom_headers).value!
|
343
|
+
response.body unless response.nil?
|
344
|
+
end
|
345
|
+
|
346
|
+
#
|
347
|
+
# Gets an access profile of a managed cluster.
|
348
|
+
#
|
349
|
+
# Gets the accessProfile for the specified role name of the managed cluster
|
350
|
+
# with a specified resource group and name.
|
351
|
+
#
|
352
|
+
# @param resource_group_name [String] The name of the resource group.
|
353
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
354
|
+
# @param role_name [String] The name of the role for managed cluster
|
355
|
+
# accessProfile resource.
|
356
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
357
|
+
# will be added to the HTTP request.
|
358
|
+
#
|
359
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
360
|
+
#
|
361
|
+
def get_access_profile_with_http_info(resource_group_name, resource_name, role_name, custom_headers:nil)
|
362
|
+
get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:custom_headers).value!
|
363
|
+
end
|
364
|
+
|
365
|
+
#
|
366
|
+
# Gets an access profile of a managed cluster.
|
367
|
+
#
|
368
|
+
# Gets the accessProfile for the specified role name of the managed cluster
|
369
|
+
# with a specified resource group and name.
|
370
|
+
#
|
371
|
+
# @param resource_group_name [String] The name of the resource group.
|
372
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
373
|
+
# @param role_name [String] The name of the role for managed cluster
|
374
|
+
# accessProfile resource.
|
375
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
376
|
+
# to the HTTP request.
|
377
|
+
#
|
378
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
379
|
+
#
|
380
|
+
def get_access_profile_async(resource_group_name, resource_name, role_name, custom_headers:nil)
|
381
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
382
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
383
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
384
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
385
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
386
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
387
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
388
|
+
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?
|
389
|
+
fail ArgumentError, 'role_name is nil' if role_name.nil?
|
390
|
+
|
391
|
+
|
392
|
+
request_headers = {}
|
393
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
394
|
+
|
395
|
+
# Set Headers
|
396
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
397
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
398
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'
|
399
|
+
|
400
|
+
request_url = @base_url || @client.base_url
|
401
|
+
|
402
|
+
options = {
|
403
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
404
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'roleName' => role_name},
|
405
|
+
query_params: {'api-version' => @client.api_version},
|
406
|
+
headers: request_headers.merge(custom_headers || {}),
|
407
|
+
base_url: request_url
|
408
|
+
}
|
409
|
+
promise = @client.make_request_async(:post, path_template, options)
|
410
|
+
|
411
|
+
promise = promise.then do |result|
|
412
|
+
http_response = result.response
|
413
|
+
status_code = http_response.status
|
414
|
+
response_content = http_response.body
|
415
|
+
unless status_code == 200
|
416
|
+
error_model = JSON.load(response_content)
|
417
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
418
|
+
end
|
419
|
+
|
420
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
421
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
422
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
423
|
+
# Deserialize Response
|
424
|
+
if status_code == 200
|
425
|
+
begin
|
426
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
427
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedClusterAccessProfile.mapper()
|
428
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
429
|
+
rescue Exception => e
|
430
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
result
|
435
|
+
end
|
436
|
+
|
437
|
+
promise.execute
|
438
|
+
end
|
439
|
+
|
440
|
+
#
|
441
|
+
# Gets cluster admin credential of a managed cluster.
|
442
|
+
#
|
443
|
+
# Gets cluster admin credential of the managed cluster with a specified
|
444
|
+
# resource group and name.
|
445
|
+
#
|
446
|
+
# @param resource_group_name [String] The name of the resource group.
|
447
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
448
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
449
|
+
# will be added to the HTTP request.
|
450
|
+
#
|
451
|
+
# @return [CredentialResults] operation results.
|
452
|
+
#
|
453
|
+
def list_cluster_admin_credentials(resource_group_name, resource_name, custom_headers:nil)
|
454
|
+
response = list_cluster_admin_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
455
|
+
response.body unless response.nil?
|
456
|
+
end
|
457
|
+
|
458
|
+
#
|
459
|
+
# Gets cluster admin credential of a managed cluster.
|
460
|
+
#
|
461
|
+
# Gets cluster admin credential of the managed cluster with a specified
|
462
|
+
# resource group and name.
|
463
|
+
#
|
464
|
+
# @param resource_group_name [String] The name of the resource group.
|
465
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
466
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
467
|
+
# will be added to the HTTP request.
|
468
|
+
#
|
469
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
470
|
+
#
|
471
|
+
def list_cluster_admin_credentials_with_http_info(resource_group_name, resource_name, custom_headers:nil)
|
472
|
+
list_cluster_admin_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
473
|
+
end
|
474
|
+
|
475
|
+
#
|
476
|
+
# Gets cluster admin credential of a managed cluster.
|
477
|
+
#
|
478
|
+
# Gets cluster admin credential of the managed cluster with a specified
|
479
|
+
# resource group and name.
|
480
|
+
#
|
481
|
+
# @param resource_group_name [String] The name of the resource group.
|
482
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
483
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
484
|
+
# to the HTTP request.
|
485
|
+
#
|
486
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
487
|
+
#
|
488
|
+
def list_cluster_admin_credentials_async(resource_group_name, resource_name, custom_headers:nil)
|
489
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
490
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
491
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
492
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
493
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
494
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
495
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
496
|
+
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?
|
497
|
+
|
498
|
+
|
499
|
+
request_headers = {}
|
500
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
501
|
+
|
502
|
+
# Set Headers
|
503
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
504
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
505
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'
|
506
|
+
|
507
|
+
request_url = @base_url || @client.base_url
|
508
|
+
|
509
|
+
options = {
|
510
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
511
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
512
|
+
query_params: {'api-version' => @client.api_version},
|
513
|
+
headers: request_headers.merge(custom_headers || {}),
|
514
|
+
base_url: request_url
|
515
|
+
}
|
516
|
+
promise = @client.make_request_async(:post, path_template, options)
|
517
|
+
|
518
|
+
promise = promise.then do |result|
|
519
|
+
http_response = result.response
|
520
|
+
status_code = http_response.status
|
521
|
+
response_content = http_response.body
|
522
|
+
unless status_code == 200
|
523
|
+
error_model = JSON.load(response_content)
|
524
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
525
|
+
end
|
526
|
+
|
527
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
528
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
529
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
530
|
+
# Deserialize Response
|
531
|
+
if status_code == 200
|
532
|
+
begin
|
533
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
534
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::CredentialResults.mapper()
|
535
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
536
|
+
rescue Exception => e
|
537
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
538
|
+
end
|
539
|
+
end
|
540
|
+
|
541
|
+
result
|
542
|
+
end
|
543
|
+
|
544
|
+
promise.execute
|
545
|
+
end
|
546
|
+
|
547
|
+
#
|
548
|
+
# Gets cluster user credential of a managed cluster.
|
549
|
+
#
|
550
|
+
# Gets cluster user credential of the managed cluster with a specified resource
|
551
|
+
# group and name.
|
552
|
+
#
|
553
|
+
# @param resource_group_name [String] The name of the resource group.
|
554
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
555
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
556
|
+
# will be added to the HTTP request.
|
557
|
+
#
|
558
|
+
# @return [CredentialResults] operation results.
|
559
|
+
#
|
560
|
+
def list_cluster_user_credentials(resource_group_name, resource_name, custom_headers:nil)
|
561
|
+
response = list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
562
|
+
response.body unless response.nil?
|
563
|
+
end
|
564
|
+
|
565
|
+
#
|
566
|
+
# Gets cluster user credential of a managed cluster.
|
567
|
+
#
|
568
|
+
# Gets cluster user credential of the managed cluster with a specified resource
|
569
|
+
# group and name.
|
570
|
+
#
|
571
|
+
# @param resource_group_name [String] The name of the resource group.
|
572
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
573
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
574
|
+
# will be added to the HTTP request.
|
575
|
+
#
|
576
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
577
|
+
#
|
578
|
+
def list_cluster_user_credentials_with_http_info(resource_group_name, resource_name, custom_headers:nil)
|
579
|
+
list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
580
|
+
end
|
581
|
+
|
582
|
+
#
|
583
|
+
# Gets cluster user credential of a managed cluster.
|
584
|
+
#
|
585
|
+
# Gets cluster user credential of the managed cluster with a specified resource
|
586
|
+
# group and name.
|
587
|
+
#
|
588
|
+
# @param resource_group_name [String] The name of the resource group.
|
589
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
590
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
591
|
+
# to the HTTP request.
|
592
|
+
#
|
593
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
594
|
+
#
|
595
|
+
def list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:nil)
|
596
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
597
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
598
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
599
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
600
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
601
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
602
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
603
|
+
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?
|
604
|
+
|
605
|
+
|
606
|
+
request_headers = {}
|
607
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
608
|
+
|
609
|
+
# Set Headers
|
610
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
611
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
612
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'
|
613
|
+
|
614
|
+
request_url = @base_url || @client.base_url
|
615
|
+
|
616
|
+
options = {
|
617
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
618
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
619
|
+
query_params: {'api-version' => @client.api_version},
|
620
|
+
headers: request_headers.merge(custom_headers || {}),
|
621
|
+
base_url: request_url
|
622
|
+
}
|
623
|
+
promise = @client.make_request_async(:post, path_template, options)
|
624
|
+
|
625
|
+
promise = promise.then do |result|
|
626
|
+
http_response = result.response
|
627
|
+
status_code = http_response.status
|
628
|
+
response_content = http_response.body
|
629
|
+
unless status_code == 200
|
630
|
+
error_model = JSON.load(response_content)
|
631
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
632
|
+
end
|
633
|
+
|
634
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
635
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
636
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
637
|
+
# Deserialize Response
|
638
|
+
if status_code == 200
|
639
|
+
begin
|
640
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
641
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::CredentialResults.mapper()
|
642
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
643
|
+
rescue Exception => e
|
644
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
result
|
649
|
+
end
|
650
|
+
|
651
|
+
promise.execute
|
652
|
+
end
|
653
|
+
|
654
|
+
#
|
655
|
+
# Gets a managed cluster.
|
656
|
+
#
|
657
|
+
# Gets the details of the managed cluster with a specified resource group and
|
658
|
+
# name.
|
659
|
+
#
|
660
|
+
# @param resource_group_name [String] The name of the resource group.
|
661
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
662
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
663
|
+
# will be added to the HTTP request.
|
664
|
+
#
|
665
|
+
# @return [ManagedCluster] operation results.
|
666
|
+
#
|
667
|
+
def get(resource_group_name, resource_name, custom_headers:nil)
|
668
|
+
response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
669
|
+
response.body unless response.nil?
|
670
|
+
end
|
671
|
+
|
672
|
+
#
|
673
|
+
# Gets a managed cluster.
|
674
|
+
#
|
675
|
+
# Gets the details of the managed cluster with a specified resource group and
|
676
|
+
# name.
|
677
|
+
#
|
678
|
+
# @param resource_group_name [String] The name of the resource group.
|
679
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
680
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
681
|
+
# will be added to the HTTP request.
|
682
|
+
#
|
683
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
684
|
+
#
|
685
|
+
def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
|
686
|
+
get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
687
|
+
end
|
688
|
+
|
689
|
+
#
|
690
|
+
# Gets a managed cluster.
|
691
|
+
#
|
692
|
+
# Gets the details of the managed cluster with a specified resource group and
|
693
|
+
# name.
|
694
|
+
#
|
695
|
+
# @param resource_group_name [String] The name of the resource group.
|
696
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
697
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
698
|
+
# to the HTTP request.
|
699
|
+
#
|
700
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
701
|
+
#
|
702
|
+
def get_async(resource_group_name, resource_name, custom_headers:nil)
|
703
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
704
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
705
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
706
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
707
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
708
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
709
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
710
|
+
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?
|
711
|
+
|
712
|
+
|
713
|
+
request_headers = {}
|
714
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
715
|
+
|
716
|
+
# Set Headers
|
717
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
718
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
719
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
|
720
|
+
|
721
|
+
request_url = @base_url || @client.base_url
|
722
|
+
|
723
|
+
options = {
|
724
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
725
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
726
|
+
query_params: {'api-version' => @client.api_version},
|
727
|
+
headers: request_headers.merge(custom_headers || {}),
|
728
|
+
base_url: request_url
|
729
|
+
}
|
730
|
+
promise = @client.make_request_async(:get, path_template, options)
|
731
|
+
|
732
|
+
promise = promise.then do |result|
|
733
|
+
http_response = result.response
|
734
|
+
status_code = http_response.status
|
735
|
+
response_content = http_response.body
|
736
|
+
unless status_code == 200
|
737
|
+
error_model = JSON.load(response_content)
|
738
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
739
|
+
end
|
740
|
+
|
741
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
742
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
743
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
744
|
+
# Deserialize Response
|
745
|
+
if status_code == 200
|
746
|
+
begin
|
747
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
748
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
749
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
750
|
+
rescue Exception => e
|
751
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
752
|
+
end
|
753
|
+
end
|
754
|
+
|
755
|
+
result
|
756
|
+
end
|
757
|
+
|
758
|
+
promise.execute
|
759
|
+
end
|
760
|
+
|
761
|
+
#
|
762
|
+
# Creates or updates a managed cluster.
|
763
|
+
#
|
764
|
+
# Creates or updates a managed cluster with the specified configuration for
|
765
|
+
# agents and Kubernetes version.
|
766
|
+
#
|
767
|
+
# @param resource_group_name [String] The name of the resource group.
|
768
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
769
|
+
# @param parameters [ManagedCluster] Parameters supplied to the Create or
|
770
|
+
# Update a Managed Cluster operation.
|
771
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
772
|
+
# will be added to the HTTP request.
|
773
|
+
#
|
774
|
+
# @return [ManagedCluster] operation results.
|
775
|
+
#
|
776
|
+
def create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
|
777
|
+
response = create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
778
|
+
response.body unless response.nil?
|
779
|
+
end
|
780
|
+
|
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 parameters [ManagedCluster] Parameters supplied to the Create or
|
785
|
+
# Update a Managed Cluster operation.
|
786
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
787
|
+
# will be added to the HTTP request.
|
788
|
+
#
|
789
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
790
|
+
# response.
|
791
|
+
#
|
792
|
+
def create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
793
|
+
# Send request
|
794
|
+
promise = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
|
795
|
+
|
796
|
+
promise = promise.then do |response|
|
797
|
+
# Defining deserialization method.
|
798
|
+
deserialize_method = lambda do |parsed_response|
|
799
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
800
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
801
|
+
end
|
802
|
+
|
803
|
+
# Waiting for response.
|
804
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
805
|
+
end
|
806
|
+
|
807
|
+
promise
|
808
|
+
end
|
809
|
+
|
810
|
+
#
|
811
|
+
# Updates tags on a managed cluster.
|
812
|
+
#
|
813
|
+
# Updates a managed cluster with the specified tags.
|
814
|
+
#
|
815
|
+
# @param resource_group_name [String] The name of the resource group.
|
816
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
817
|
+
# @param parameters [TagsObject] Parameters supplied to the Update Managed
|
818
|
+
# Cluster Tags operation.
|
819
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
820
|
+
# will be added to the HTTP request.
|
821
|
+
#
|
822
|
+
# @return [ManagedCluster] operation results.
|
823
|
+
#
|
824
|
+
def update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
|
825
|
+
response = update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
826
|
+
response.body unless response.nil?
|
827
|
+
end
|
828
|
+
|
829
|
+
#
|
830
|
+
# @param resource_group_name [String] The name of the resource group.
|
831
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
832
|
+
# @param parameters [TagsObject] Parameters supplied to the Update Managed
|
833
|
+
# Cluster Tags operation.
|
834
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
835
|
+
# will be added to the HTTP request.
|
836
|
+
#
|
837
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
838
|
+
# response.
|
839
|
+
#
|
840
|
+
def update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
841
|
+
# Send request
|
842
|
+
promise = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
|
843
|
+
|
844
|
+
promise = promise.then do |response|
|
845
|
+
# Defining deserialization method.
|
846
|
+
deserialize_method = lambda do |parsed_response|
|
847
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
848
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
849
|
+
end
|
850
|
+
|
851
|
+
# Waiting for response.
|
852
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
853
|
+
end
|
854
|
+
|
855
|
+
promise
|
856
|
+
end
|
857
|
+
|
858
|
+
#
|
859
|
+
# Deletes a managed cluster.
|
860
|
+
#
|
861
|
+
# Deletes the managed cluster with a specified resource group and name.
|
862
|
+
#
|
863
|
+
# @param resource_group_name [String] The name of the resource group.
|
864
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
865
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
866
|
+
# will be added to the HTTP request.
|
867
|
+
#
|
868
|
+
def delete(resource_group_name, resource_name, custom_headers:nil)
|
869
|
+
response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
870
|
+
nil
|
871
|
+
end
|
872
|
+
|
873
|
+
#
|
874
|
+
# @param resource_group_name [String] The name of the resource group.
|
875
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
876
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
877
|
+
# will be added to the HTTP request.
|
878
|
+
#
|
879
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
880
|
+
# response.
|
881
|
+
#
|
882
|
+
def delete_async(resource_group_name, resource_name, custom_headers:nil)
|
883
|
+
# Send request
|
884
|
+
promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
|
885
|
+
|
886
|
+
promise = promise.then do |response|
|
887
|
+
# Defining deserialization method.
|
888
|
+
deserialize_method = lambda do |parsed_response|
|
889
|
+
end
|
890
|
+
|
891
|
+
# Waiting for response.
|
892
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
893
|
+
end
|
894
|
+
|
895
|
+
promise
|
896
|
+
end
|
897
|
+
|
898
|
+
#
|
899
|
+
# Reset Service Principal Profile of a managed cluster.
|
900
|
+
#
|
901
|
+
# Update the service principal Profile for a managed cluster.
|
902
|
+
#
|
903
|
+
# @param resource_group_name [String] The name of the resource group.
|
904
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
905
|
+
# @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
|
906
|
+
# to the Reset Service Principal Profile operation for a Managed Cluster.
|
907
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
908
|
+
# will be added to the HTTP request.
|
909
|
+
#
|
910
|
+
def reset_service_principal_profile(resource_group_name, resource_name, parameters, custom_headers:nil)
|
911
|
+
response = reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
912
|
+
nil
|
913
|
+
end
|
914
|
+
|
915
|
+
#
|
916
|
+
# @param resource_group_name [String] The name of the resource group.
|
917
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
918
|
+
# @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
|
919
|
+
# to the Reset Service Principal Profile operation for a Managed Cluster.
|
920
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
921
|
+
# will be added to the HTTP request.
|
922
|
+
#
|
923
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
924
|
+
# response.
|
925
|
+
#
|
926
|
+
def reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
927
|
+
# Send request
|
928
|
+
promise = begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
|
929
|
+
|
930
|
+
promise = promise.then do |response|
|
931
|
+
# Defining deserialization method.
|
932
|
+
deserialize_method = lambda do |parsed_response|
|
933
|
+
end
|
934
|
+
|
935
|
+
# Waiting for response.
|
936
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
937
|
+
end
|
938
|
+
|
939
|
+
promise
|
940
|
+
end
|
941
|
+
|
942
|
+
#
|
943
|
+
# Reset AAD Profile of a managed cluster.
|
944
|
+
#
|
945
|
+
# Update the AAD Profile for a managed cluster.
|
946
|
+
#
|
947
|
+
# @param resource_group_name [String] The name of the resource group.
|
948
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
949
|
+
# @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
|
950
|
+
# AAD Profile operation for a Managed Cluster.
|
951
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
952
|
+
# will be added to the HTTP request.
|
953
|
+
#
|
954
|
+
def reset_aadprofile(resource_group_name, resource_name, parameters, custom_headers:nil)
|
955
|
+
response = reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
956
|
+
nil
|
957
|
+
end
|
958
|
+
|
959
|
+
#
|
960
|
+
# @param resource_group_name [String] The name of the resource group.
|
961
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
962
|
+
# @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
|
963
|
+
# AAD Profile operation for a Managed Cluster.
|
964
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
965
|
+
# will be added to the HTTP request.
|
966
|
+
#
|
967
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
968
|
+
# response.
|
969
|
+
#
|
970
|
+
def reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
971
|
+
# Send request
|
972
|
+
promise = begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers)
|
973
|
+
|
974
|
+
promise = promise.then do |response|
|
975
|
+
# Defining deserialization method.
|
976
|
+
deserialize_method = lambda do |parsed_response|
|
977
|
+
end
|
978
|
+
|
979
|
+
# Waiting for response.
|
980
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
981
|
+
end
|
982
|
+
|
983
|
+
promise
|
984
|
+
end
|
985
|
+
|
986
|
+
#
|
987
|
+
# Creates or updates a managed cluster.
|
988
|
+
#
|
989
|
+
# Creates or updates a managed cluster with the specified configuration for
|
990
|
+
# agents and Kubernetes version.
|
991
|
+
#
|
992
|
+
# @param resource_group_name [String] The name of the resource group.
|
993
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
994
|
+
# @param parameters [ManagedCluster] Parameters supplied to the Create or
|
995
|
+
# Update a Managed Cluster operation.
|
996
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
997
|
+
# will be added to the HTTP request.
|
998
|
+
#
|
999
|
+
# @return [ManagedCluster] operation results.
|
1000
|
+
#
|
1001
|
+
def begin_create_or_update(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1002
|
+
response = begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1003
|
+
response.body unless response.nil?
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
#
|
1007
|
+
# Creates or updates a managed cluster.
|
1008
|
+
#
|
1009
|
+
# Creates or updates a managed cluster with the specified configuration for
|
1010
|
+
# agents and Kubernetes version.
|
1011
|
+
#
|
1012
|
+
# @param resource_group_name [String] The name of the resource group.
|
1013
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1014
|
+
# @param parameters [ManagedCluster] Parameters supplied to the Create or
|
1015
|
+
# Update a Managed Cluster operation.
|
1016
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1017
|
+
# will be added to the HTTP request.
|
1018
|
+
#
|
1019
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1020
|
+
#
|
1021
|
+
def begin_create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1022
|
+
begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
#
|
1026
|
+
# Creates or updates a managed cluster.
|
1027
|
+
#
|
1028
|
+
# Creates or updates a managed cluster with the specified configuration for
|
1029
|
+
# agents and Kubernetes version.
|
1030
|
+
#
|
1031
|
+
# @param resource_group_name [String] The name of the resource group.
|
1032
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1033
|
+
# @param parameters [ManagedCluster] Parameters supplied to the Create or
|
1034
|
+
# Update a Managed Cluster operation.
|
1035
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1036
|
+
# to the HTTP request.
|
1037
|
+
#
|
1038
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1039
|
+
#
|
1040
|
+
def begin_create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1041
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1042
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1043
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1044
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1045
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
1046
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
1047
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
1048
|
+
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?
|
1049
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1050
|
+
|
1051
|
+
|
1052
|
+
request_headers = {}
|
1053
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1054
|
+
|
1055
|
+
# Set Headers
|
1056
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1057
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1058
|
+
|
1059
|
+
# Serialize Request
|
1060
|
+
request_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
1061
|
+
request_content = @client.serialize(request_mapper, parameters)
|
1062
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1063
|
+
|
1064
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
|
1065
|
+
|
1066
|
+
request_url = @base_url || @client.base_url
|
1067
|
+
|
1068
|
+
options = {
|
1069
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1070
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
1071
|
+
query_params: {'api-version' => @client.api_version},
|
1072
|
+
body: request_content,
|
1073
|
+
headers: request_headers.merge(custom_headers || {}),
|
1074
|
+
base_url: request_url
|
1075
|
+
}
|
1076
|
+
promise = @client.make_request_async(:put, path_template, options)
|
1077
|
+
|
1078
|
+
promise = promise.then do |result|
|
1079
|
+
http_response = result.response
|
1080
|
+
status_code = http_response.status
|
1081
|
+
response_content = http_response.body
|
1082
|
+
unless status_code == 200 || status_code == 201
|
1083
|
+
error_model = JSON.load(response_content)
|
1084
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1085
|
+
end
|
1086
|
+
|
1087
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1088
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1089
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1090
|
+
# Deserialize Response
|
1091
|
+
if status_code == 200
|
1092
|
+
begin
|
1093
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1094
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
1095
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1096
|
+
rescue Exception => e
|
1097
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1098
|
+
end
|
1099
|
+
end
|
1100
|
+
# Deserialize Response
|
1101
|
+
if status_code == 201
|
1102
|
+
begin
|
1103
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1104
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
1105
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1106
|
+
rescue Exception => e
|
1107
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1108
|
+
end
|
1109
|
+
end
|
1110
|
+
|
1111
|
+
result
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
promise.execute
|
1115
|
+
end
|
1116
|
+
|
1117
|
+
#
|
1118
|
+
# Updates tags on a managed cluster.
|
1119
|
+
#
|
1120
|
+
# Updates a managed cluster with the specified tags.
|
1121
|
+
#
|
1122
|
+
# @param resource_group_name [String] The name of the resource group.
|
1123
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1124
|
+
# @param parameters [TagsObject] Parameters supplied to the Update Managed
|
1125
|
+
# Cluster Tags operation.
|
1126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1127
|
+
# will be added to the HTTP request.
|
1128
|
+
#
|
1129
|
+
# @return [ManagedCluster] operation results.
|
1130
|
+
#
|
1131
|
+
def begin_update_tags(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1132
|
+
response = begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1133
|
+
response.body unless response.nil?
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
#
|
1137
|
+
# Updates tags on a managed cluster.
|
1138
|
+
#
|
1139
|
+
# Updates a managed cluster with the specified tags.
|
1140
|
+
#
|
1141
|
+
# @param resource_group_name [String] The name of the resource group.
|
1142
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1143
|
+
# @param parameters [TagsObject] Parameters supplied to the Update Managed
|
1144
|
+
# Cluster Tags operation.
|
1145
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1146
|
+
# will be added to the HTTP request.
|
1147
|
+
#
|
1148
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1149
|
+
#
|
1150
|
+
def begin_update_tags_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1151
|
+
begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1152
|
+
end
|
1153
|
+
|
1154
|
+
#
|
1155
|
+
# Updates tags on a managed cluster.
|
1156
|
+
#
|
1157
|
+
# Updates a managed cluster with the specified tags.
|
1158
|
+
#
|
1159
|
+
# @param resource_group_name [String] The name of the resource group.
|
1160
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1161
|
+
# @param parameters [TagsObject] Parameters supplied to the Update Managed
|
1162
|
+
# Cluster Tags operation.
|
1163
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1164
|
+
# to the HTTP request.
|
1165
|
+
#
|
1166
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1167
|
+
#
|
1168
|
+
def begin_update_tags_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1169
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1170
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1171
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1172
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1173
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
1174
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
1175
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
1176
|
+
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?
|
1177
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1178
|
+
|
1179
|
+
|
1180
|
+
request_headers = {}
|
1181
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1182
|
+
|
1183
|
+
# Set Headers
|
1184
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1185
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1186
|
+
|
1187
|
+
# Serialize Request
|
1188
|
+
request_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::TagsObject.mapper()
|
1189
|
+
request_content = @client.serialize(request_mapper, parameters)
|
1190
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1191
|
+
|
1192
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
|
1193
|
+
|
1194
|
+
request_url = @base_url || @client.base_url
|
1195
|
+
|
1196
|
+
options = {
|
1197
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1198
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
1199
|
+
query_params: {'api-version' => @client.api_version},
|
1200
|
+
body: request_content,
|
1201
|
+
headers: request_headers.merge(custom_headers || {}),
|
1202
|
+
base_url: request_url
|
1203
|
+
}
|
1204
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
1205
|
+
|
1206
|
+
promise = promise.then do |result|
|
1207
|
+
http_response = result.response
|
1208
|
+
status_code = http_response.status
|
1209
|
+
response_content = http_response.body
|
1210
|
+
unless status_code == 200
|
1211
|
+
error_model = JSON.load(response_content)
|
1212
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1216
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1217
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1218
|
+
# Deserialize Response
|
1219
|
+
if status_code == 200
|
1220
|
+
begin
|
1221
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1222
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedCluster.mapper()
|
1223
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1224
|
+
rescue Exception => e
|
1225
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1226
|
+
end
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
result
|
1230
|
+
end
|
1231
|
+
|
1232
|
+
promise.execute
|
1233
|
+
end
|
1234
|
+
|
1235
|
+
#
|
1236
|
+
# Deletes a managed cluster.
|
1237
|
+
#
|
1238
|
+
# Deletes the managed cluster with a specified resource group and name.
|
1239
|
+
#
|
1240
|
+
# @param resource_group_name [String] The name of the resource group.
|
1241
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1242
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1243
|
+
# will be added to the HTTP request.
|
1244
|
+
#
|
1245
|
+
#
|
1246
|
+
def begin_delete(resource_group_name, resource_name, custom_headers:nil)
|
1247
|
+
response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
1248
|
+
nil
|
1249
|
+
end
|
1250
|
+
|
1251
|
+
#
|
1252
|
+
# Deletes a managed cluster.
|
1253
|
+
#
|
1254
|
+
# Deletes the managed cluster with a specified resource group and name.
|
1255
|
+
#
|
1256
|
+
# @param resource_group_name [String] The name of the resource group.
|
1257
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1258
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1259
|
+
# will be added to the HTTP request.
|
1260
|
+
#
|
1261
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1262
|
+
#
|
1263
|
+
def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
|
1264
|
+
begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
1265
|
+
end
|
1266
|
+
|
1267
|
+
#
|
1268
|
+
# Deletes a managed cluster.
|
1269
|
+
#
|
1270
|
+
# Deletes the managed cluster with a specified resource group and name.
|
1271
|
+
#
|
1272
|
+
# @param resource_group_name [String] The name of the resource group.
|
1273
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1274
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1275
|
+
# to the HTTP request.
|
1276
|
+
#
|
1277
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1278
|
+
#
|
1279
|
+
def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
|
1280
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1281
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1282
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1283
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1284
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
1285
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
1286
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
1287
|
+
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?
|
1288
|
+
|
1289
|
+
|
1290
|
+
request_headers = {}
|
1291
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1292
|
+
|
1293
|
+
# Set Headers
|
1294
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1295
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1296
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'
|
1297
|
+
|
1298
|
+
request_url = @base_url || @client.base_url
|
1299
|
+
|
1300
|
+
options = {
|
1301
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1302
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
1303
|
+
query_params: {'api-version' => @client.api_version},
|
1304
|
+
headers: request_headers.merge(custom_headers || {}),
|
1305
|
+
base_url: request_url
|
1306
|
+
}
|
1307
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
1308
|
+
|
1309
|
+
promise = promise.then do |result|
|
1310
|
+
http_response = result.response
|
1311
|
+
status_code = http_response.status
|
1312
|
+
response_content = http_response.body
|
1313
|
+
unless status_code == 202 || status_code == 204
|
1314
|
+
error_model = JSON.load(response_content)
|
1315
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1316
|
+
end
|
1317
|
+
|
1318
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1319
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1320
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1321
|
+
|
1322
|
+
result
|
1323
|
+
end
|
1324
|
+
|
1325
|
+
promise.execute
|
1326
|
+
end
|
1327
|
+
|
1328
|
+
#
|
1329
|
+
# Reset Service Principal Profile of a managed cluster.
|
1330
|
+
#
|
1331
|
+
# Update the service principal Profile for a managed cluster.
|
1332
|
+
#
|
1333
|
+
# @param resource_group_name [String] The name of the resource group.
|
1334
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1335
|
+
# @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
|
1336
|
+
# to the Reset Service Principal Profile operation for a Managed Cluster.
|
1337
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1338
|
+
# will be added to the HTTP request.
|
1339
|
+
#
|
1340
|
+
#
|
1341
|
+
def begin_reset_service_principal_profile(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1342
|
+
response = begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1343
|
+
nil
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
#
|
1347
|
+
# Reset Service Principal Profile of a managed cluster.
|
1348
|
+
#
|
1349
|
+
# Update the service principal Profile for a managed cluster.
|
1350
|
+
#
|
1351
|
+
# @param resource_group_name [String] The name of the resource group.
|
1352
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1353
|
+
# @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
|
1354
|
+
# to the Reset Service Principal Profile operation for a Managed Cluster.
|
1355
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1356
|
+
# will be added to the HTTP request.
|
1357
|
+
#
|
1358
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1359
|
+
#
|
1360
|
+
def begin_reset_service_principal_profile_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1361
|
+
begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1362
|
+
end
|
1363
|
+
|
1364
|
+
#
|
1365
|
+
# Reset Service Principal Profile of a managed cluster.
|
1366
|
+
#
|
1367
|
+
# Update the service principal Profile for a managed cluster.
|
1368
|
+
#
|
1369
|
+
# @param resource_group_name [String] The name of the resource group.
|
1370
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1371
|
+
# @param parameters [ManagedClusterServicePrincipalProfile] Parameters supplied
|
1372
|
+
# to the Reset Service Principal Profile operation for a Managed Cluster.
|
1373
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1374
|
+
# to the HTTP request.
|
1375
|
+
#
|
1376
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1377
|
+
#
|
1378
|
+
def begin_reset_service_principal_profile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1379
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1380
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1381
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1382
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1383
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
1384
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
1385
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
1386
|
+
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?
|
1387
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1388
|
+
|
1389
|
+
|
1390
|
+
request_headers = {}
|
1391
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1392
|
+
|
1393
|
+
# Set Headers
|
1394
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1395
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1396
|
+
|
1397
|
+
# Serialize Request
|
1398
|
+
request_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedClusterServicePrincipalProfile.mapper()
|
1399
|
+
request_content = @client.serialize(request_mapper, parameters)
|
1400
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1401
|
+
|
1402
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'
|
1403
|
+
|
1404
|
+
request_url = @base_url || @client.base_url
|
1405
|
+
|
1406
|
+
options = {
|
1407
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1408
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
1409
|
+
query_params: {'api-version' => @client.api_version},
|
1410
|
+
body: request_content,
|
1411
|
+
headers: request_headers.merge(custom_headers || {}),
|
1412
|
+
base_url: request_url
|
1413
|
+
}
|
1414
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1415
|
+
|
1416
|
+
promise = promise.then do |result|
|
1417
|
+
http_response = result.response
|
1418
|
+
status_code = http_response.status
|
1419
|
+
response_content = http_response.body
|
1420
|
+
unless status_code == 200 || status_code == 202
|
1421
|
+
error_model = JSON.load(response_content)
|
1422
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1423
|
+
end
|
1424
|
+
|
1425
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1426
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1427
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1428
|
+
|
1429
|
+
result
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
promise.execute
|
1433
|
+
end
|
1434
|
+
|
1435
|
+
#
|
1436
|
+
# Reset AAD Profile of a managed cluster.
|
1437
|
+
#
|
1438
|
+
# Update the AAD Profile for a managed cluster.
|
1439
|
+
#
|
1440
|
+
# @param resource_group_name [String] The name of the resource group.
|
1441
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1442
|
+
# @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
|
1443
|
+
# AAD Profile operation for a Managed Cluster.
|
1444
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1445
|
+
# will be added to the HTTP request.
|
1446
|
+
#
|
1447
|
+
#
|
1448
|
+
def begin_reset_aadprofile(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1449
|
+
response = begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1450
|
+
nil
|
1451
|
+
end
|
1452
|
+
|
1453
|
+
#
|
1454
|
+
# Reset AAD Profile of a managed cluster.
|
1455
|
+
#
|
1456
|
+
# Update the AAD Profile for a managed cluster.
|
1457
|
+
#
|
1458
|
+
# @param resource_group_name [String] The name of the resource group.
|
1459
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1460
|
+
# @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
|
1461
|
+
# AAD Profile operation for a Managed Cluster.
|
1462
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1463
|
+
# will be added to the HTTP request.
|
1464
|
+
#
|
1465
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1466
|
+
#
|
1467
|
+
def begin_reset_aadprofile_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1468
|
+
begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
|
1469
|
+
end
|
1470
|
+
|
1471
|
+
#
|
1472
|
+
# Reset AAD Profile of a managed cluster.
|
1473
|
+
#
|
1474
|
+
# Update the AAD Profile for a managed cluster.
|
1475
|
+
#
|
1476
|
+
# @param resource_group_name [String] The name of the resource group.
|
1477
|
+
# @param resource_name [String] The name of the managed cluster resource.
|
1478
|
+
# @param parameters [ManagedClusterAADProfile] Parameters supplied to the Reset
|
1479
|
+
# AAD Profile operation for a Managed Cluster.
|
1480
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1481
|
+
# to the HTTP request.
|
1482
|
+
#
|
1483
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1484
|
+
#
|
1485
|
+
def begin_reset_aadprofile_async(resource_group_name, resource_name, parameters, custom_headers:nil)
|
1486
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1487
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1488
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1489
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1490
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
1491
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
|
1492
|
+
fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
|
1493
|
+
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?
|
1494
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1495
|
+
|
1496
|
+
|
1497
|
+
request_headers = {}
|
1498
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1499
|
+
|
1500
|
+
# Set Headers
|
1501
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1502
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1503
|
+
|
1504
|
+
# Serialize Request
|
1505
|
+
request_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedClusterAADProfile.mapper()
|
1506
|
+
request_content = @client.serialize(request_mapper, parameters)
|
1507
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1508
|
+
|
1509
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'
|
1510
|
+
|
1511
|
+
request_url = @base_url || @client.base_url
|
1512
|
+
|
1513
|
+
options = {
|
1514
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1515
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
1516
|
+
query_params: {'api-version' => @client.api_version},
|
1517
|
+
body: request_content,
|
1518
|
+
headers: request_headers.merge(custom_headers || {}),
|
1519
|
+
base_url: request_url
|
1520
|
+
}
|
1521
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1522
|
+
|
1523
|
+
promise = promise.then do |result|
|
1524
|
+
http_response = result.response
|
1525
|
+
status_code = http_response.status
|
1526
|
+
response_content = http_response.body
|
1527
|
+
unless status_code == 200 || status_code == 202
|
1528
|
+
error_model = JSON.load(response_content)
|
1529
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1530
|
+
end
|
1531
|
+
|
1532
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1533
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1534
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1535
|
+
|
1536
|
+
result
|
1537
|
+
end
|
1538
|
+
|
1539
|
+
promise.execute
|
1540
|
+
end
|
1541
|
+
|
1542
|
+
#
|
1543
|
+
# Gets a list of managed clusters in the specified subscription.
|
1544
|
+
#
|
1545
|
+
# Gets a list of managed clusters in the specified subscription. The operation
|
1546
|
+
# returns properties of each managed cluster.
|
1547
|
+
#
|
1548
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1549
|
+
# to List operation.
|
1550
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1551
|
+
# will be added to the HTTP request.
|
1552
|
+
#
|
1553
|
+
# @return [ManagedClusterListResult] operation results.
|
1554
|
+
#
|
1555
|
+
def list_next(next_page_link, custom_headers:nil)
|
1556
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
1557
|
+
response.body unless response.nil?
|
1558
|
+
end
|
1559
|
+
|
1560
|
+
#
|
1561
|
+
# Gets a list of managed clusters in the specified subscription.
|
1562
|
+
#
|
1563
|
+
# Gets a list of managed clusters in the specified subscription. The operation
|
1564
|
+
# returns properties of each managed cluster.
|
1565
|
+
#
|
1566
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1567
|
+
# to List operation.
|
1568
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1569
|
+
# will be added to the HTTP request.
|
1570
|
+
#
|
1571
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1572
|
+
#
|
1573
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
1574
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
1575
|
+
end
|
1576
|
+
|
1577
|
+
#
|
1578
|
+
# Gets a list of managed clusters in the specified subscription.
|
1579
|
+
#
|
1580
|
+
# Gets a list of managed clusters in the specified subscription. The operation
|
1581
|
+
# returns properties of each managed cluster.
|
1582
|
+
#
|
1583
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1584
|
+
# to List operation.
|
1585
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1586
|
+
# to the HTTP request.
|
1587
|
+
#
|
1588
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1589
|
+
#
|
1590
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
1591
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1592
|
+
|
1593
|
+
|
1594
|
+
request_headers = {}
|
1595
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1596
|
+
|
1597
|
+
# Set Headers
|
1598
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1599
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1600
|
+
path_template = '{nextLink}'
|
1601
|
+
|
1602
|
+
request_url = @base_url || @client.base_url
|
1603
|
+
|
1604
|
+
options = {
|
1605
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1606
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1607
|
+
headers: request_headers.merge(custom_headers || {}),
|
1608
|
+
base_url: request_url
|
1609
|
+
}
|
1610
|
+
promise = @client.make_request_async(:get, path_template, options)
|
1611
|
+
|
1612
|
+
promise = promise.then do |result|
|
1613
|
+
http_response = result.response
|
1614
|
+
status_code = http_response.status
|
1615
|
+
response_content = http_response.body
|
1616
|
+
unless status_code == 200
|
1617
|
+
error_model = JSON.load(response_content)
|
1618
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1619
|
+
end
|
1620
|
+
|
1621
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1622
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1623
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1624
|
+
# Deserialize Response
|
1625
|
+
if status_code == 200
|
1626
|
+
begin
|
1627
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1628
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedClusterListResult.mapper()
|
1629
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1630
|
+
rescue Exception => e
|
1631
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1632
|
+
end
|
1633
|
+
end
|
1634
|
+
|
1635
|
+
result
|
1636
|
+
end
|
1637
|
+
|
1638
|
+
promise.execute
|
1639
|
+
end
|
1640
|
+
|
1641
|
+
#
|
1642
|
+
# Lists managed clusters in the specified subscription and resource group.
|
1643
|
+
#
|
1644
|
+
# Lists managed clusters in the specified subscription and resource group. The
|
1645
|
+
# operation returns properties of each managed cluster.
|
1646
|
+
#
|
1647
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1648
|
+
# to List operation.
|
1649
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1650
|
+
# will be added to the HTTP request.
|
1651
|
+
#
|
1652
|
+
# @return [ManagedClusterListResult] operation results.
|
1653
|
+
#
|
1654
|
+
def list_by_resource_group_next(next_page_link, custom_headers:nil)
|
1655
|
+
response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
1656
|
+
response.body unless response.nil?
|
1657
|
+
end
|
1658
|
+
|
1659
|
+
#
|
1660
|
+
# Lists managed clusters in the specified subscription and resource group.
|
1661
|
+
#
|
1662
|
+
# Lists managed clusters in the specified subscription and resource group. The
|
1663
|
+
# operation returns properties of each managed cluster.
|
1664
|
+
#
|
1665
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1666
|
+
# to List operation.
|
1667
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1668
|
+
# will be added to the HTTP request.
|
1669
|
+
#
|
1670
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1671
|
+
#
|
1672
|
+
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
|
1673
|
+
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
1674
|
+
end
|
1675
|
+
|
1676
|
+
#
|
1677
|
+
# Lists managed clusters in the specified subscription and resource group.
|
1678
|
+
#
|
1679
|
+
# Lists managed clusters in the specified subscription and resource group. The
|
1680
|
+
# operation returns properties of each managed cluster.
|
1681
|
+
#
|
1682
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1683
|
+
# to List operation.
|
1684
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1685
|
+
# to the HTTP request.
|
1686
|
+
#
|
1687
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1688
|
+
#
|
1689
|
+
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
|
1690
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1691
|
+
|
1692
|
+
|
1693
|
+
request_headers = {}
|
1694
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1695
|
+
|
1696
|
+
# Set Headers
|
1697
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1698
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1699
|
+
path_template = '{nextLink}'
|
1700
|
+
|
1701
|
+
request_url = @base_url || @client.base_url
|
1702
|
+
|
1703
|
+
options = {
|
1704
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1705
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1706
|
+
headers: request_headers.merge(custom_headers || {}),
|
1707
|
+
base_url: request_url
|
1708
|
+
}
|
1709
|
+
promise = @client.make_request_async(:get, path_template, options)
|
1710
|
+
|
1711
|
+
promise = promise.then do |result|
|
1712
|
+
http_response = result.response
|
1713
|
+
status_code = http_response.status
|
1714
|
+
response_content = http_response.body
|
1715
|
+
unless status_code == 200
|
1716
|
+
error_model = JSON.load(response_content)
|
1717
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1718
|
+
end
|
1719
|
+
|
1720
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1721
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1722
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1723
|
+
# Deserialize Response
|
1724
|
+
if status_code == 200
|
1725
|
+
begin
|
1726
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1727
|
+
result_mapper = Azure::ContainerService::Mgmt::V2019_06_01::Models::ManagedClusterListResult.mapper()
|
1728
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1729
|
+
rescue Exception => e
|
1730
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1731
|
+
end
|
1732
|
+
end
|
1733
|
+
|
1734
|
+
result
|
1735
|
+
end
|
1736
|
+
|
1737
|
+
promise.execute
|
1738
|
+
end
|
1739
|
+
|
1740
|
+
#
|
1741
|
+
# Gets a list of managed clusters in the specified subscription.
|
1742
|
+
#
|
1743
|
+
# Gets a list of managed clusters in the specified subscription. The operation
|
1744
|
+
# returns properties of each managed cluster.
|
1745
|
+
#
|
1746
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1747
|
+
# will be added to the HTTP request.
|
1748
|
+
#
|
1749
|
+
# @return [ManagedClusterListResult] which provide lazy access to pages of the
|
1750
|
+
# response.
|
1751
|
+
#
|
1752
|
+
def list_as_lazy(custom_headers:nil)
|
1753
|
+
response = list_async(custom_headers:custom_headers).value!
|
1754
|
+
unless response.nil?
|
1755
|
+
page = response.body
|
1756
|
+
page.next_method = Proc.new do |next_page_link|
|
1757
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
1758
|
+
end
|
1759
|
+
page
|
1760
|
+
end
|
1761
|
+
end
|
1762
|
+
|
1763
|
+
#
|
1764
|
+
# Lists managed clusters in the specified subscription and resource group.
|
1765
|
+
#
|
1766
|
+
# Lists managed clusters in the specified subscription and resource group. The
|
1767
|
+
# operation returns properties of each managed cluster.
|
1768
|
+
#
|
1769
|
+
# @param resource_group_name [String] The name of the resource group.
|
1770
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1771
|
+
# will be added to the HTTP request.
|
1772
|
+
#
|
1773
|
+
# @return [ManagedClusterListResult] which provide lazy access to pages of the
|
1774
|
+
# response.
|
1775
|
+
#
|
1776
|
+
def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
|
1777
|
+
response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
1778
|
+
unless response.nil?
|
1779
|
+
page = response.body
|
1780
|
+
page.next_method = Proc.new do |next_page_link|
|
1781
|
+
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
|
1782
|
+
end
|
1783
|
+
page
|
1784
|
+
end
|
1785
|
+
end
|
1786
|
+
|
1787
|
+
end
|
1788
|
+
end
|