azure_mgmt_container_service 0.18.2 → 0.18.3

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