azure_mgmt_container_service 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2016-03-30/generated/azure_mgmt_container_service.rb +42 -0
  4. data/lib/2016-03-30/generated/azure_mgmt_container_service/container_service_client.rb +131 -0
  5. data/lib/2016-03-30/generated/azure_mgmt_container_service/container_services.rb +634 -0
  6. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service.rb +167 -0
  7. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb +106 -0
  8. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +47 -0
  9. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +56 -0
  10. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_list_result.rb +52 -0
  11. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +68 -0
  12. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_ochestrator_types.rb +16 -0
  13. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_orchestrator_profile.rb +47 -0
  14. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +53 -0
  15. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +46 -0
  16. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +57 -0
  17. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +61 -0
  18. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb +54 -0
  19. data/lib/2016-03-30/generated/azure_mgmt_container_service/models/resource.rb +94 -0
  20. data/lib/2016-03-30/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  21. data/lib/2016-03-30/generated/azure_mgmt_container_service/version.rb +8 -0
  22. data/lib/2016-09-30/generated/azure_mgmt_container_service.rb +44 -0
  23. data/lib/2016-09-30/generated/azure_mgmt_container_service/container_service_client.rb +131 -0
  24. data/lib/2016-09-30/generated/azure_mgmt_container_service/container_services.rb +919 -0
  25. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service.rb +190 -0
  26. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb +107 -0
  27. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_custom_profile.rb +44 -0
  28. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +47 -0
  29. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +59 -0
  30. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_list_result.rb +95 -0
  31. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +68 -0
  32. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_ochestrator_types.rb +18 -0
  33. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_orchestrator_profile.rb +48 -0
  34. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_service_principal_profile.rb +56 -0
  35. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +53 -0
  36. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +46 -0
  37. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +57 -0
  38. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +61 -0
  39. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb +60 -0
  40. data/lib/2016-09-30/generated/azure_mgmt_container_service/models/resource.rb +94 -0
  41. data/lib/2016-09-30/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  42. data/lib/2016-09-30/generated/azure_mgmt_container_service/version.rb +8 -0
  43. data/lib/2017-01-31/generated/azure_mgmt_container_service.rb +44 -0
  44. data/lib/2017-01-31/generated/azure_mgmt_container_service/compute_management_client.rb +131 -0
  45. data/lib/2017-01-31/generated/azure_mgmt_container_service/container_services.rb +919 -0
  46. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service.rb +190 -0
  47. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb +107 -0
  48. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_custom_profile.rb +44 -0
  49. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +47 -0
  50. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +59 -0
  51. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_list_result.rb +95 -0
  52. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +68 -0
  53. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_orchestrator_profile.rb +48 -0
  54. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_orchestrator_types.rb +18 -0
  55. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_service_principal_profile.rb +56 -0
  56. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +53 -0
  57. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +46 -0
  58. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +57 -0
  59. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +61 -0
  60. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb +60 -0
  61. data/lib/2017-01-31/generated/azure_mgmt_container_service/models/resource.rb +94 -0
  62. data/lib/2017-01-31/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  63. data/lib/2017-01-31/generated/azure_mgmt_container_service/version.rb +8 -0
  64. data/lib/azure_mgmt_container_service.rb +8 -0
  65. data/lib/module_definition.rb +6 -0
  66. data/lib/profiles/common/configurable.rb +73 -0
  67. data/lib/profiles/common/default.rb +68 -0
  68. data/lib/profiles/latest/containerservice_latest_profile_client.rb +33 -0
  69. data/lib/profiles/latest/containerservice_module_definition.rb +9 -0
  70. data/lib/profiles/latest/modules/containerservice_profile_module.rb +106 -0
  71. data/lib/version.rb +7 -0
  72. metadata +184 -0
@@ -0,0 +1,8 @@
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::V2016_03_30
7
+ VERSION = '0.15.0'
8
+ end
@@ -0,0 +1,44 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2016-09-30/generated/azure_mgmt_container_service/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ContainerService::Mgmt::V2016_09_30
23
+ autoload :ContainerServices, '2016-09-30/generated/azure_mgmt_container_service/container_services.rb'
24
+ autoload :ContainerServiceClient, '2016-09-30/generated/azure_mgmt_container_service/container_service_client.rb'
25
+
26
+ module Models
27
+ autoload :ContainerServiceSshPublicKey, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb'
28
+ autoload :Resource, '2016-09-30/generated/azure_mgmt_container_service/models/resource.rb'
29
+ autoload :ContainerServiceSshConfiguration, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb'
30
+ autoload :ContainerServiceServicePrincipalProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_service_principal_profile.rb'
31
+ autoload :ContainerServiceLinuxProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb'
32
+ autoload :ContainerServiceMasterProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_master_profile.rb'
33
+ autoload :ContainerServiceVMDiagnostics, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb'
34
+ autoload :ContainerServiceWindowsProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb'
35
+ autoload :ContainerServiceDiagnosticsProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb'
36
+ autoload :ContainerServiceOrchestratorProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_orchestrator_profile.rb'
37
+ autoload :ContainerServiceAgentPoolProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb'
38
+ autoload :ContainerServiceCustomProfile, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_custom_profile.rb'
39
+ autoload :ContainerServiceListResult, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_list_result.rb'
40
+ autoload :ContainerService, '2016-09-30/generated/azure_mgmt_container_service/models/container_service.rb'
41
+ autoload :ContainerServiceOchestratorTypes, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_ochestrator_types.rb'
42
+ autoload :ContainerServiceVMSizeTypes, '2016-09-30/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb'
43
+ end
44
+ end
@@ -0,0 +1,131 @@
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::V2016_09_30
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ContainerServiceClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client Api Version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] Gets or sets the preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
+ # Running Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
+ # is generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return [ContainerServices] container_services
40
+ attr_reader :container_services
41
+
42
+ #
43
+ # Creates initializes a new instance of the ContainerServiceClient class.
44
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
45
+ # @param base_url [String] the base URI of the service.
46
+ # @param options [Array] filters to be applied to the HTTP requests.
47
+ #
48
+ def initialize(credentials = nil, base_url = nil, options = nil)
49
+ super(credentials, options)
50
+ @base_url = base_url || 'https://management.azure.com'
51
+
52
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
53
+ @credentials = credentials
54
+
55
+ @container_services = ContainerServices.new(self)
56
+ @api_version = '2016-09-30'
57
+ @accept_language = 'en-US'
58
+ @long_running_operation_retry_timeout = 30
59
+ @generate_client_request_id = true
60
+ add_telemetry
61
+ end
62
+
63
+ #
64
+ # Makes a request and returns the body of the response.
65
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
66
+ # @param path [String] the path, relative to {base_url}.
67
+ # @param options [Hash{String=>String}] specifying any request options like :body.
68
+ # @return [Hash{String=>String}] containing the body of the response.
69
+ # Example:
70
+ #
71
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
72
+ # path = "/path"
73
+ # options = {
74
+ # body: request_content,
75
+ # query_params: {'api-version' => '2016-02-01'}
76
+ # }
77
+ # result = @client.make_request(:put, path, options)
78
+ #
79
+ def make_request(method, path, options = {})
80
+ result = make_request_with_http_info(method, path, options)
81
+ result.body unless result.nil?
82
+ end
83
+
84
+ #
85
+ # Makes a request and returns the operation response.
86
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
87
+ # @param path [String] the path, relative to {base_url}.
88
+ # @param options [Hash{String=>String}] specifying any request options like :body.
89
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
90
+ #
91
+ def make_request_with_http_info(method, path, options = {})
92
+ result = make_request_async(method, path, options).value!
93
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
94
+ result
95
+ end
96
+
97
+ #
98
+ # Makes a request asynchronously.
99
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
100
+ # @param path [String] the path, relative to {base_url}.
101
+ # @param options [Hash{String=>String}] specifying any request options like :body.
102
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
103
+ #
104
+ def make_request_async(method, path, options = {})
105
+ fail ArgumentError, 'method is nil' if method.nil?
106
+ fail ArgumentError, 'path is nil' if path.nil?
107
+
108
+ request_url = options[:base_url] || @base_url
109
+
110
+ request_headers = @request_headers
111
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
112
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
113
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
114
+
115
+ super(request_url, method, path, options)
116
+ end
117
+
118
+
119
+ private
120
+ #
121
+ # Adds telemetry information.
122
+ #
123
+ def add_telemetry
124
+ sdk_information = 'azure_mgmt_container_service'
125
+ if defined? Azure::ContainerService::Mgmt::V2016_09_30::VERSION
126
+ sdk_information = "#{sdk_information}/#{Azure::ContainerService::Mgmt::V2016_09_30::VERSION}"
127
+ end
128
+ add_user_agent_information(sdk_information)
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,919 @@
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::V2016_09_30
7
+ #
8
+ # The Container Service Client.
9
+ #
10
+ class ContainerServices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ContainerServices class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ContainerServiceClient] reference to the ContainerServiceClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a list of container services in the specified subscription.
26
+ #
27
+ # Gets a list of container services in the specified subscription. The
28
+ # operation returns properties of each container service including state,
29
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
30
+ #
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<ContainerService>] operation results.
35
+ #
36
+ def list(custom_headers = nil)
37
+ first_page = list_as_lazy(custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Gets a list of container services in the specified subscription.
43
+ #
44
+ # Gets a list of container services in the specified subscription. The
45
+ # operation returns properties of each container service including state,
46
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
47
+ #
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_with_http_info(custom_headers = nil)
54
+ list_async(custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets a list of container services in the specified subscription.
59
+ #
60
+ # Gets a list of container services in the specified subscription. The
61
+ # operation returns properties of each container service including state,
62
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
63
+ #
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_async(custom_headers = nil)
70
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
71
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
72
+
73
+
74
+ request_headers = {}
75
+
76
+ # Set Headers
77
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
79
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ path_params: {'subscriptionId' => @client.subscription_id},
86
+ query_params: {'api-version' => @client.api_version},
87
+ headers: request_headers.merge(custom_headers || {}),
88
+ base_url: request_url
89
+ }
90
+ promise = @client.make_request_async(:get, path_template, options)
91
+
92
+ promise = promise.then do |result|
93
+ http_response = result.response
94
+ status_code = http_response.status
95
+ response_content = http_response.body
96
+ unless status_code == 200
97
+ error_model = JSON.load(response_content)
98
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
99
+ end
100
+
101
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
102
+ # Deserialize Response
103
+ if status_code == 200
104
+ begin
105
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
106
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerServiceListResult.mapper()
107
+ result.body = @client.deserialize(result_mapper, parsed_response)
108
+ rescue Exception => e
109
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
110
+ end
111
+ end
112
+
113
+ result
114
+ end
115
+
116
+ promise.execute
117
+ end
118
+
119
+ #
120
+ # Creates or updates a container service.
121
+ #
122
+ # Creates or updates a container service with the specified configuration of
123
+ # orchestrator, masters, and agents.
124
+ #
125
+ # @param resource_group_name [String] The name of the resource group.
126
+ # @param container_service_name [String] The name of the container service in
127
+ # the specified subscription and resource group.
128
+ # @param parameters [ContainerService] Parameters supplied to the Create or
129
+ # Update a Container Service operation.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [ContainerService] operation results.
134
+ #
135
+ def create_or_update(resource_group_name, container_service_name, parameters, custom_headers = nil)
136
+ response = create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers).value!
137
+ response.body unless response.nil?
138
+ end
139
+
140
+ #
141
+ # @param resource_group_name [String] The name of the resource group.
142
+ # @param container_service_name [String] The name of the container service in
143
+ # the specified subscription and resource group.
144
+ # @param parameters [ContainerService] Parameters supplied to the Create or
145
+ # Update a Container Service operation.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [Concurrent::Promise] promise which provides async access to http
150
+ # response.
151
+ #
152
+ def create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers = nil)
153
+ # Send request
154
+ promise = begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers)
155
+
156
+ promise = promise.then do |response|
157
+ # Defining deserialization method.
158
+ deserialize_method = lambda do |parsed_response|
159
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerService.mapper()
160
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
161
+ end
162
+
163
+ # Waiting for response.
164
+ @client.get_long_running_operation_result(response, deserialize_method)
165
+ end
166
+
167
+ promise
168
+ end
169
+
170
+ #
171
+ # Gets the properties of the specified container service.
172
+ #
173
+ # Gets the properties of the specified container service in the specified
174
+ # subscription and resource group. The operation returns the properties
175
+ # including state, orchestrator, number of masters and agents, and FQDNs of
176
+ # masters and agents.
177
+ #
178
+ # @param resource_group_name [String] The name of the resource group.
179
+ # @param container_service_name [String] The name of the container service in
180
+ # the specified subscription and resource group.
181
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
182
+ # will be added to the HTTP request.
183
+ #
184
+ # @return [ContainerService] operation results.
185
+ #
186
+ def get(resource_group_name, container_service_name, custom_headers = nil)
187
+ response = get_async(resource_group_name, container_service_name, custom_headers).value!
188
+ response.body unless response.nil?
189
+ end
190
+
191
+ #
192
+ # Gets the properties of the specified container service.
193
+ #
194
+ # Gets the properties of the specified container service in the specified
195
+ # subscription and resource group. The operation returns the properties
196
+ # including state, orchestrator, number of masters and agents, and FQDNs of
197
+ # masters and agents.
198
+ #
199
+ # @param resource_group_name [String] The name of the resource group.
200
+ # @param container_service_name [String] The name of the container service in
201
+ # the specified subscription and resource group.
202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
203
+ # will be added to the HTTP request.
204
+ #
205
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
206
+ #
207
+ def get_with_http_info(resource_group_name, container_service_name, custom_headers = nil)
208
+ get_async(resource_group_name, container_service_name, custom_headers).value!
209
+ end
210
+
211
+ #
212
+ # Gets the properties of the specified container service.
213
+ #
214
+ # Gets the properties of the specified container service in the specified
215
+ # subscription and resource group. The operation returns the properties
216
+ # including state, orchestrator, number of masters and agents, and FQDNs of
217
+ # masters and agents.
218
+ #
219
+ # @param resource_group_name [String] The name of the resource group.
220
+ # @param container_service_name [String] The name of the container service in
221
+ # the specified subscription and resource group.
222
+ # @param [Hash{String => String}] A hash of custom headers that will be added
223
+ # to the HTTP request.
224
+ #
225
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
226
+ #
227
+ def get_async(resource_group_name, container_service_name, custom_headers = nil)
228
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
229
+ fail ArgumentError, 'container_service_name is nil' if container_service_name.nil?
230
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
231
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
232
+
233
+
234
+ request_headers = {}
235
+
236
+ # Set Headers
237
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
238
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
239
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
240
+
241
+ request_url = @base_url || @client.base_url
242
+
243
+ options = {
244
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
245
+ path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
246
+ query_params: {'api-version' => @client.api_version},
247
+ headers: request_headers.merge(custom_headers || {}),
248
+ base_url: request_url
249
+ }
250
+ promise = @client.make_request_async(:get, path_template, options)
251
+
252
+ promise = promise.then do |result|
253
+ http_response = result.response
254
+ status_code = http_response.status
255
+ response_content = http_response.body
256
+ unless status_code == 200
257
+ error_model = JSON.load(response_content)
258
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
259
+ end
260
+
261
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
262
+ # Deserialize Response
263
+ if status_code == 200
264
+ begin
265
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
266
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerService.mapper()
267
+ result.body = @client.deserialize(result_mapper, parsed_response)
268
+ rescue Exception => e
269
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
270
+ end
271
+ end
272
+
273
+ result
274
+ end
275
+
276
+ promise.execute
277
+ end
278
+
279
+ #
280
+ # Deletes the specified container service.
281
+ #
282
+ # Deletes the specified container service in the specified subscription and
283
+ # resource group. The operation does not delete other resources created as part
284
+ # of creating a container service, including storage accounts, VMs, and
285
+ # availability sets. All the other resources created with the container service
286
+ # are part of the same resource group and can be deleted individually.
287
+ #
288
+ # @param resource_group_name [String] The name of the resource group.
289
+ # @param container_service_name [String] The name of the container service in
290
+ # the specified subscription and resource group.
291
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
+ # will be added to the HTTP request.
293
+ #
294
+ def delete(resource_group_name, container_service_name, custom_headers = nil)
295
+ response = delete_async(resource_group_name, container_service_name, custom_headers).value!
296
+ nil
297
+ end
298
+
299
+ #
300
+ # @param resource_group_name [String] The name of the resource group.
301
+ # @param container_service_name [String] The name of the container service in
302
+ # the specified subscription and resource group.
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ # @return [Concurrent::Promise] promise which provides async access to http
307
+ # response.
308
+ #
309
+ def delete_async(resource_group_name, container_service_name, custom_headers = nil)
310
+ # Send request
311
+ promise = begin_delete_async(resource_group_name, container_service_name, custom_headers)
312
+
313
+ promise = promise.then do |response|
314
+ # Defining deserialization method.
315
+ deserialize_method = lambda do |parsed_response|
316
+ end
317
+
318
+ # Waiting for response.
319
+ @client.get_long_running_operation_result(response, deserialize_method)
320
+ end
321
+
322
+ promise
323
+ end
324
+
325
+ #
326
+ # Gets a list of container services in the specified resource group.
327
+ #
328
+ # Gets a list of container services in the specified subscription and resource
329
+ # group. The operation returns properties of each container service including
330
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
331
+ # agents.
332
+ #
333
+ # @param resource_group_name [String] The name of the resource group.
334
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
335
+ # will be added to the HTTP request.
336
+ #
337
+ # @return [Array<ContainerService>] operation results.
338
+ #
339
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
340
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
341
+ first_page.get_all_items
342
+ end
343
+
344
+ #
345
+ # Gets a list of container services in the specified resource group.
346
+ #
347
+ # Gets a list of container services in the specified subscription and resource
348
+ # group. The operation returns properties of each container service including
349
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
350
+ # agents.
351
+ #
352
+ # @param resource_group_name [String] The name of the resource group.
353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
354
+ # will be added to the HTTP request.
355
+ #
356
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
357
+ #
358
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
359
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
360
+ end
361
+
362
+ #
363
+ # Gets a list of container services in the specified resource group.
364
+ #
365
+ # Gets a list of container services in the specified subscription and resource
366
+ # group. The operation returns properties of each container service including
367
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
368
+ # agents.
369
+ #
370
+ # @param resource_group_name [String] The name of the resource group.
371
+ # @param [Hash{String => String}] A hash of custom headers that will be added
372
+ # to the HTTP request.
373
+ #
374
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
375
+ #
376
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
377
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
378
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
379
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
380
+
381
+
382
+ request_headers = {}
383
+
384
+ # Set Headers
385
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
386
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
387
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'
388
+
389
+ request_url = @base_url || @client.base_url
390
+
391
+ options = {
392
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
393
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
394
+ query_params: {'api-version' => @client.api_version},
395
+ headers: request_headers.merge(custom_headers || {}),
396
+ base_url: request_url
397
+ }
398
+ promise = @client.make_request_async(:get, path_template, options)
399
+
400
+ promise = promise.then do |result|
401
+ http_response = result.response
402
+ status_code = http_response.status
403
+ response_content = http_response.body
404
+ unless status_code == 200
405
+ error_model = JSON.load(response_content)
406
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
407
+ end
408
+
409
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
410
+ # Deserialize Response
411
+ if status_code == 200
412
+ begin
413
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
414
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerServiceListResult.mapper()
415
+ result.body = @client.deserialize(result_mapper, parsed_response)
416
+ rescue Exception => e
417
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
418
+ end
419
+ end
420
+
421
+ result
422
+ end
423
+
424
+ promise.execute
425
+ end
426
+
427
+ #
428
+ # Creates or updates a container service.
429
+ #
430
+ # Creates or updates a container service with the specified configuration of
431
+ # orchestrator, masters, and agents.
432
+ #
433
+ # @param resource_group_name [String] The name of the resource group.
434
+ # @param container_service_name [String] The name of the container service in
435
+ # the specified subscription and resource group.
436
+ # @param parameters [ContainerService] Parameters supplied to the Create or
437
+ # Update a Container Service operation.
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [ContainerService] operation results.
442
+ #
443
+ def begin_create_or_update(resource_group_name, container_service_name, parameters, custom_headers = nil)
444
+ response = begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers).value!
445
+ response.body unless response.nil?
446
+ end
447
+
448
+ #
449
+ # Creates or updates a container service.
450
+ #
451
+ # Creates or updates a container service with the specified configuration of
452
+ # orchestrator, masters, and agents.
453
+ #
454
+ # @param resource_group_name [String] The name of the resource group.
455
+ # @param container_service_name [String] The name of the container service in
456
+ # the specified subscription and resource group.
457
+ # @param parameters [ContainerService] Parameters supplied to the Create or
458
+ # Update a Container Service operation.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
463
+ #
464
+ def begin_create_or_update_with_http_info(resource_group_name, container_service_name, parameters, custom_headers = nil)
465
+ begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers).value!
466
+ end
467
+
468
+ #
469
+ # Creates or updates a container service.
470
+ #
471
+ # Creates or updates a container service with the specified configuration of
472
+ # orchestrator, masters, and agents.
473
+ #
474
+ # @param resource_group_name [String] The name of the resource group.
475
+ # @param container_service_name [String] The name of the container service in
476
+ # the specified subscription and resource group.
477
+ # @param parameters [ContainerService] Parameters supplied to the Create or
478
+ # Update a Container Service operation.
479
+ # @param [Hash{String => String}] A hash of custom headers that will be added
480
+ # to the HTTP request.
481
+ #
482
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
483
+ #
484
+ def begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers = nil)
485
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
486
+ fail ArgumentError, 'container_service_name is nil' if container_service_name.nil?
487
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
488
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
489
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
490
+
491
+
492
+ request_headers = {}
493
+
494
+ # Set Headers
495
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
496
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
497
+
498
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
499
+
500
+ # Serialize Request
501
+ request_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerService.mapper()
502
+ request_content = @client.serialize(request_mapper, parameters)
503
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
504
+
505
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
506
+
507
+ request_url = @base_url || @client.base_url
508
+
509
+ options = {
510
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
511
+ path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
512
+ query_params: {'api-version' => @client.api_version},
513
+ body: request_content,
514
+ headers: request_headers.merge(custom_headers || {}),
515
+ base_url: request_url
516
+ }
517
+ promise = @client.make_request_async(:put, path_template, options)
518
+
519
+ promise = promise.then do |result|
520
+ http_response = result.response
521
+ status_code = http_response.status
522
+ response_content = http_response.body
523
+ unless status_code == 200 || status_code == 201 || status_code == 202
524
+ error_model = JSON.load(response_content)
525
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
526
+ end
527
+
528
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
529
+ # Deserialize Response
530
+ if status_code == 200
531
+ begin
532
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
533
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerService.mapper()
534
+ result.body = @client.deserialize(result_mapper, parsed_response)
535
+ rescue Exception => e
536
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
537
+ end
538
+ end
539
+ # Deserialize Response
540
+ if status_code == 201
541
+ begin
542
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
543
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerService.mapper()
544
+ result.body = @client.deserialize(result_mapper, parsed_response)
545
+ rescue Exception => e
546
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
547
+ end
548
+ end
549
+ # Deserialize Response
550
+ if status_code == 202
551
+ begin
552
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
553
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerService.mapper()
554
+ result.body = @client.deserialize(result_mapper, parsed_response)
555
+ rescue Exception => e
556
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
557
+ end
558
+ end
559
+
560
+ result
561
+ end
562
+
563
+ promise.execute
564
+ end
565
+
566
+ #
567
+ # Deletes the specified container service.
568
+ #
569
+ # Deletes the specified container service in the specified subscription and
570
+ # resource group. The operation does not delete other resources created as part
571
+ # of creating a container service, including storage accounts, VMs, and
572
+ # availability sets. All the other resources created with the container service
573
+ # are part of the same resource group and can be deleted individually.
574
+ #
575
+ # @param resource_group_name [String] The name of the resource group.
576
+ # @param container_service_name [String] The name of the container service in
577
+ # the specified subscription and resource group.
578
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
579
+ # will be added to the HTTP request.
580
+ #
581
+ #
582
+ def begin_delete(resource_group_name, container_service_name, custom_headers = nil)
583
+ response = begin_delete_async(resource_group_name, container_service_name, custom_headers).value!
584
+ nil
585
+ end
586
+
587
+ #
588
+ # Deletes the specified container service.
589
+ #
590
+ # Deletes the specified container service in the specified subscription and
591
+ # resource group. The operation does not delete other resources created as part
592
+ # of creating a container service, including storage accounts, VMs, and
593
+ # availability sets. All the other resources created with the container service
594
+ # are part of the same resource group and can be deleted individually.
595
+ #
596
+ # @param resource_group_name [String] The name of the resource group.
597
+ # @param container_service_name [String] The name of the container service in
598
+ # the specified subscription and resource group.
599
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
600
+ # will be added to the HTTP request.
601
+ #
602
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
603
+ #
604
+ def begin_delete_with_http_info(resource_group_name, container_service_name, custom_headers = nil)
605
+ begin_delete_async(resource_group_name, container_service_name, custom_headers).value!
606
+ end
607
+
608
+ #
609
+ # Deletes the specified container service.
610
+ #
611
+ # Deletes the specified container service in the specified subscription and
612
+ # resource group. The operation does not delete other resources created as part
613
+ # of creating a container service, including storage accounts, VMs, and
614
+ # availability sets. All the other resources created with the container service
615
+ # are part of the same resource group and can be deleted individually.
616
+ #
617
+ # @param resource_group_name [String] The name of the resource group.
618
+ # @param container_service_name [String] The name of the container service in
619
+ # the specified subscription and resource group.
620
+ # @param [Hash{String => String}] A hash of custom headers that will be added
621
+ # to the HTTP request.
622
+ #
623
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
624
+ #
625
+ def begin_delete_async(resource_group_name, container_service_name, custom_headers = nil)
626
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
627
+ fail ArgumentError, 'container_service_name is nil' if container_service_name.nil?
628
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
629
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
630
+
631
+
632
+ request_headers = {}
633
+
634
+ # Set Headers
635
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
636
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
637
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
638
+
639
+ request_url = @base_url || @client.base_url
640
+
641
+ options = {
642
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
643
+ path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
644
+ query_params: {'api-version' => @client.api_version},
645
+ headers: request_headers.merge(custom_headers || {}),
646
+ base_url: request_url
647
+ }
648
+ promise = @client.make_request_async(:delete, path_template, options)
649
+
650
+ promise = promise.then do |result|
651
+ http_response = result.response
652
+ status_code = http_response.status
653
+ response_content = http_response.body
654
+ unless status_code == 202 || status_code == 204
655
+ error_model = JSON.load(response_content)
656
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
657
+ end
658
+
659
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
660
+
661
+ result
662
+ end
663
+
664
+ promise.execute
665
+ end
666
+
667
+ #
668
+ # Gets a list of container services in the specified subscription.
669
+ #
670
+ # Gets a list of container services in the specified subscription. The
671
+ # operation returns properties of each container service including state,
672
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
673
+ #
674
+ # @param next_page_link [String] The NextLink from the previous successful call
675
+ # to List operation.
676
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
677
+ # will be added to the HTTP request.
678
+ #
679
+ # @return [ContainerServiceListResult] operation results.
680
+ #
681
+ def list_next(next_page_link, custom_headers = nil)
682
+ response = list_next_async(next_page_link, custom_headers).value!
683
+ response.body unless response.nil?
684
+ end
685
+
686
+ #
687
+ # Gets a list of container services in the specified subscription.
688
+ #
689
+ # Gets a list of container services in the specified subscription. The
690
+ # operation returns properties of each container service including state,
691
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
692
+ #
693
+ # @param next_page_link [String] The NextLink from the previous successful call
694
+ # to List operation.
695
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
696
+ # will be added to the HTTP request.
697
+ #
698
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
699
+ #
700
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
701
+ list_next_async(next_page_link, custom_headers).value!
702
+ end
703
+
704
+ #
705
+ # Gets a list of container services in the specified subscription.
706
+ #
707
+ # Gets a list of container services in the specified subscription. The
708
+ # operation returns properties of each container service including state,
709
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
710
+ #
711
+ # @param next_page_link [String] The NextLink from the previous successful call
712
+ # to List operation.
713
+ # @param [Hash{String => String}] A hash of custom headers that will be added
714
+ # to the HTTP request.
715
+ #
716
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
717
+ #
718
+ def list_next_async(next_page_link, custom_headers = nil)
719
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
720
+
721
+
722
+ request_headers = {}
723
+
724
+ # Set Headers
725
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
726
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
727
+ path_template = '{nextLink}'
728
+
729
+ request_url = @base_url || @client.base_url
730
+
731
+ options = {
732
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
733
+ skip_encoding_path_params: {'nextLink' => next_page_link},
734
+ headers: request_headers.merge(custom_headers || {}),
735
+ base_url: request_url
736
+ }
737
+ promise = @client.make_request_async(:get, path_template, options)
738
+
739
+ promise = promise.then do |result|
740
+ http_response = result.response
741
+ status_code = http_response.status
742
+ response_content = http_response.body
743
+ unless status_code == 200
744
+ error_model = JSON.load(response_content)
745
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
746
+ end
747
+
748
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
749
+ # Deserialize Response
750
+ if status_code == 200
751
+ begin
752
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
753
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerServiceListResult.mapper()
754
+ result.body = @client.deserialize(result_mapper, parsed_response)
755
+ rescue Exception => e
756
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
757
+ end
758
+ end
759
+
760
+ result
761
+ end
762
+
763
+ promise.execute
764
+ end
765
+
766
+ #
767
+ # Gets a list of container services in the specified resource group.
768
+ #
769
+ # Gets a list of container services in the specified subscription and resource
770
+ # group. The operation returns properties of each container service including
771
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
772
+ # agents.
773
+ #
774
+ # @param next_page_link [String] The NextLink from the previous successful call
775
+ # to List operation.
776
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
777
+ # will be added to the HTTP request.
778
+ #
779
+ # @return [ContainerServiceListResult] operation results.
780
+ #
781
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
782
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
783
+ response.body unless response.nil?
784
+ end
785
+
786
+ #
787
+ # Gets a list of container services in the specified resource group.
788
+ #
789
+ # Gets a list of container services in the specified subscription and resource
790
+ # group. The operation returns properties of each container service including
791
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
792
+ # agents.
793
+ #
794
+ # @param next_page_link [String] The NextLink from the previous successful call
795
+ # to List operation.
796
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
797
+ # will be added to the HTTP request.
798
+ #
799
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
800
+ #
801
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
802
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
803
+ end
804
+
805
+ #
806
+ # Gets a list of container services in the specified resource group.
807
+ #
808
+ # Gets a list of container services in the specified subscription and resource
809
+ # group. The operation returns properties of each container service including
810
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
811
+ # agents.
812
+ #
813
+ # @param next_page_link [String] The NextLink from the previous successful call
814
+ # to List operation.
815
+ # @param [Hash{String => String}] A hash of custom headers that will be added
816
+ # to the HTTP request.
817
+ #
818
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
819
+ #
820
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
821
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
822
+
823
+
824
+ request_headers = {}
825
+
826
+ # Set Headers
827
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
828
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
829
+ path_template = '{nextLink}'
830
+
831
+ request_url = @base_url || @client.base_url
832
+
833
+ options = {
834
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
835
+ skip_encoding_path_params: {'nextLink' => next_page_link},
836
+ headers: request_headers.merge(custom_headers || {}),
837
+ base_url: request_url
838
+ }
839
+ promise = @client.make_request_async(:get, path_template, options)
840
+
841
+ promise = promise.then do |result|
842
+ http_response = result.response
843
+ status_code = http_response.status
844
+ response_content = http_response.body
845
+ unless status_code == 200
846
+ error_model = JSON.load(response_content)
847
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
848
+ end
849
+
850
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
851
+ # Deserialize Response
852
+ if status_code == 200
853
+ begin
854
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
855
+ result_mapper = Azure::ContainerService::Mgmt::V2016_09_30::Models::ContainerServiceListResult.mapper()
856
+ result.body = @client.deserialize(result_mapper, parsed_response)
857
+ rescue Exception => e
858
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
859
+ end
860
+ end
861
+
862
+ result
863
+ end
864
+
865
+ promise.execute
866
+ end
867
+
868
+ #
869
+ # Gets a list of container services in the specified subscription.
870
+ #
871
+ # Gets a list of container services in the specified subscription. The
872
+ # operation returns properties of each container service including state,
873
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
874
+ #
875
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
876
+ # will be added to the HTTP request.
877
+ #
878
+ # @return [ContainerServiceListResult] which provide lazy access to pages of
879
+ # the response.
880
+ #
881
+ def list_as_lazy(custom_headers = nil)
882
+ response = list_async(custom_headers).value!
883
+ unless response.nil?
884
+ page = response.body
885
+ page.next_method = Proc.new do |next_page_link|
886
+ list_next_async(next_page_link, custom_headers)
887
+ end
888
+ page
889
+ end
890
+ end
891
+
892
+ #
893
+ # Gets a list of container services in the specified resource group.
894
+ #
895
+ # Gets a list of container services in the specified subscription and resource
896
+ # group. The operation returns properties of each container service including
897
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
898
+ # agents.
899
+ #
900
+ # @param resource_group_name [String] The name of the resource group.
901
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
902
+ # will be added to the HTTP request.
903
+ #
904
+ # @return [ContainerServiceListResult] which provide lazy access to pages of
905
+ # the response.
906
+ #
907
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
908
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
909
+ unless response.nil?
910
+ page = response.body
911
+ page.next_method = Proc.new do |next_page_link|
912
+ list_by_resource_group_next_async(next_page_link, custom_headers)
913
+ end
914
+ page
915
+ end
916
+ end
917
+
918
+ end
919
+ end