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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fd6c6fcc19e7382126ec333ba34fefcd4f1ef394
4
+ data.tar.gz: 2adcb4fadacfc464e5624ffdcf2ed0baceec85c3
5
+ SHA512:
6
+ metadata.gz: 24dbb4731d8d4fc1a0b95fd75b65663061d14ccf9588fdfdc03d087e53f2ce3a9f740b1acbfff42d0d96eda86c0c8d59fceee47059775f13d29a3774180721e6
7
+ data.tar.gz: 5c8e57d06e9ff99f0ec4806d6bbdd67b467bb93557d8f1ddf2336b442c82b12cad2178db5c7726b0e29ec7ae0e7482f7b8f1f93159ccacfcb177aee124a3560c
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,42 @@
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-03-30/generated/azure_mgmt_container_service/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ContainerService::Mgmt::V2016_03_30
23
+ autoload :ContainerServices, '2016-03-30/generated/azure_mgmt_container_service/container_services.rb'
24
+ autoload :ContainerServiceClient, '2016-03-30/generated/azure_mgmt_container_service/container_service_client.rb'
25
+
26
+ module Models
27
+ autoload :ContainerServiceSshConfiguration, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb'
28
+ autoload :Resource, '2016-03-30/generated/azure_mgmt_container_service/models/resource.rb'
29
+ autoload :ContainerServiceLinuxProfile, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb'
30
+ autoload :ContainerServiceMasterProfile, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_master_profile.rb'
31
+ autoload :ContainerServiceVMDiagnostics, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb'
32
+ autoload :ContainerServiceWindowsProfile, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_windows_profile.rb'
33
+ autoload :ContainerServiceDiagnosticsProfile, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb'
34
+ autoload :ContainerServiceOrchestratorProfile, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_orchestrator_profile.rb'
35
+ autoload :ContainerServiceAgentPoolProfile, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_agent_pool_profile.rb'
36
+ autoload :ContainerServiceSshPublicKey, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb'
37
+ autoload :ContainerServiceListResult, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_list_result.rb'
38
+ autoload :ContainerService, '2016-03-30/generated/azure_mgmt_container_service/models/container_service.rb'
39
+ autoload :ContainerServiceOchestratorTypes, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_ochestrator_types.rb'
40
+ autoload :ContainerServiceVMSizeTypes, '2016-03-30/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb'
41
+ end
42
+ 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_03_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-03-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_03_30::VERSION
126
+ sdk_information = "#{sdk_information}/#{Azure::ContainerService::Mgmt::V2016_03_30::VERSION}"
127
+ end
128
+ add_user_agent_information(sdk_information)
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,634 @@
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
+ #
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. The
26
+ # operation returns properties of each container service including state,
27
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [ContainerServiceListResult] operation results.
33
+ #
34
+ def list(custom_headers = nil)
35
+ response = list_async(custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Gets a list of container services in the specified subscription. The
41
+ # operation returns properties of each container service including state,
42
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers = nil)
50
+ list_async(custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets a list of container services in the specified subscription. The
55
+ # operation returns properties of each container service including state,
56
+ # orchestrator, number of masters and agents, and FQDNs of masters and agents.
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(custom_headers = nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+
67
+
68
+ request_headers = {}
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ path_params: {'subscriptionId' => @client.subscription_id},
80
+ query_params: {'api-version' => @client.api_version},
81
+ headers: request_headers.merge(custom_headers || {}),
82
+ base_url: request_url
83
+ }
84
+ promise = @client.make_request_async(:get, path_template, options)
85
+
86
+ promise = promise.then do |result|
87
+ http_response = result.response
88
+ status_code = http_response.status
89
+ response_content = http_response.body
90
+ unless status_code == 200
91
+ error_model = JSON.load(response_content)
92
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
93
+ end
94
+
95
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
96
+ # Deserialize Response
97
+ if status_code == 200
98
+ begin
99
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
100
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerServiceListResult.mapper()
101
+ result.body = @client.deserialize(result_mapper, parsed_response)
102
+ rescue Exception => e
103
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
104
+ end
105
+ end
106
+
107
+ result
108
+ end
109
+
110
+ promise.execute
111
+ end
112
+
113
+ #
114
+ # Creates or updates a container service with the specified configuration of
115
+ # orchestrator, masters, and agents.
116
+ #
117
+ # @param resource_group_name [String] The name of the resource group.
118
+ # @param container_service_name [String] The name of the container service in
119
+ # the specified subscription and resource group.
120
+ # @param parameters [ContainerService] Parameters supplied to the Create or
121
+ # Update a Container Service operation.
122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
123
+ # will be added to the HTTP request.
124
+ #
125
+ # @return [ContainerService] operation results.
126
+ #
127
+ def create_or_update(resource_group_name, container_service_name, parameters, custom_headers = nil)
128
+ response = create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers).value!
129
+ response.body unless response.nil?
130
+ end
131
+
132
+ #
133
+ # @param resource_group_name [String] The name of the resource group.
134
+ # @param container_service_name [String] The name of the container service in
135
+ # the specified subscription and resource group.
136
+ # @param parameters [ContainerService] Parameters supplied to the Create or
137
+ # Update a Container Service operation.
138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
139
+ # will be added to the HTTP request.
140
+ #
141
+ # @return [Concurrent::Promise] promise which provides async access to http
142
+ # response.
143
+ #
144
+ def create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers = nil)
145
+ # Send request
146
+ promise = begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers)
147
+
148
+ promise = promise.then do |response|
149
+ # Defining deserialization method.
150
+ deserialize_method = lambda do |parsed_response|
151
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerService.mapper()
152
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
153
+ end
154
+
155
+ # Waiting for response.
156
+ @client.get_long_running_operation_result(response, deserialize_method)
157
+ end
158
+
159
+ promise
160
+ end
161
+
162
+ #
163
+ # Gets the properties of the specified container service in the specified
164
+ # subscription and resource group. The operation returns the properties
165
+ # including state, orchestrator, number of masters and agents, and FQDNs of
166
+ # masters and agents.
167
+ #
168
+ # @param resource_group_name [String] The name of the resource group.
169
+ # @param container_service_name [String] The name of the container service in
170
+ # the specified subscription and resource group.
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [ContainerService] operation results.
175
+ #
176
+ def get(resource_group_name, container_service_name, custom_headers = nil)
177
+ response = get_async(resource_group_name, container_service_name, custom_headers).value!
178
+ response.body unless response.nil?
179
+ end
180
+
181
+ #
182
+ # Gets the properties of the specified container service in the specified
183
+ # subscription and resource group. The operation returns the properties
184
+ # including state, orchestrator, number of masters and agents, and FQDNs of
185
+ # masters and agents.
186
+ #
187
+ # @param resource_group_name [String] The name of the resource group.
188
+ # @param container_service_name [String] The name of the container service in
189
+ # the specified subscription and resource group.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
194
+ #
195
+ def get_with_http_info(resource_group_name, container_service_name, custom_headers = nil)
196
+ get_async(resource_group_name, container_service_name, custom_headers).value!
197
+ end
198
+
199
+ #
200
+ # Gets the properties of the specified container service in the specified
201
+ # subscription and resource group. The operation returns the properties
202
+ # including state, orchestrator, number of masters and agents, and FQDNs of
203
+ # masters and agents.
204
+ #
205
+ # @param resource_group_name [String] The name of the resource group.
206
+ # @param container_service_name [String] The name of the container service in
207
+ # the specified subscription and resource group.
208
+ # @param [Hash{String => String}] A hash of custom headers that will be added
209
+ # to the HTTP request.
210
+ #
211
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
212
+ #
213
+ def get_async(resource_group_name, container_service_name, custom_headers = nil)
214
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
215
+ fail ArgumentError, 'container_service_name is nil' if container_service_name.nil?
216
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
217
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
218
+
219
+
220
+ request_headers = {}
221
+
222
+ # Set Headers
223
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
224
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
225
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
226
+
227
+ request_url = @base_url || @client.base_url
228
+
229
+ options = {
230
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
231
+ path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
232
+ query_params: {'api-version' => @client.api_version},
233
+ headers: request_headers.merge(custom_headers || {}),
234
+ base_url: request_url
235
+ }
236
+ promise = @client.make_request_async(:get, path_template, options)
237
+
238
+ promise = promise.then do |result|
239
+ http_response = result.response
240
+ status_code = http_response.status
241
+ response_content = http_response.body
242
+ unless status_code == 200
243
+ error_model = JSON.load(response_content)
244
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
245
+ end
246
+
247
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
248
+ # Deserialize Response
249
+ if status_code == 200
250
+ begin
251
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
252
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerService.mapper()
253
+ result.body = @client.deserialize(result_mapper, parsed_response)
254
+ rescue Exception => e
255
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
256
+ end
257
+ end
258
+
259
+ result
260
+ end
261
+
262
+ promise.execute
263
+ end
264
+
265
+ #
266
+ # Deletes the specified container service in the specified subscription and
267
+ # resource group. The operation does not delete other resources created as part
268
+ # of creating a container service, including storage accounts, VMs, and
269
+ # availability sets. All the other resources created with the container service
270
+ # are part of the same resource group and can be deleted individually.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group.
273
+ # @param container_service_name [String] The name of the container service in
274
+ # the specified subscription and resource group.
275
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
276
+ # will be added to the HTTP request.
277
+ #
278
+ def delete(resource_group_name, container_service_name, custom_headers = nil)
279
+ response = delete_async(resource_group_name, container_service_name, custom_headers).value!
280
+ nil
281
+ end
282
+
283
+ #
284
+ # @param resource_group_name [String] The name of the resource group.
285
+ # @param container_service_name [String] The name of the container service in
286
+ # the specified subscription and resource group.
287
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
288
+ # will be added to the HTTP request.
289
+ #
290
+ # @return [Concurrent::Promise] promise which provides async access to http
291
+ # response.
292
+ #
293
+ def delete_async(resource_group_name, container_service_name, custom_headers = nil)
294
+ # Send request
295
+ promise = begin_delete_async(resource_group_name, container_service_name, custom_headers)
296
+
297
+ promise = promise.then do |response|
298
+ # Defining deserialization method.
299
+ deserialize_method = lambda do |parsed_response|
300
+ end
301
+
302
+ # Waiting for response.
303
+ @client.get_long_running_operation_result(response, deserialize_method)
304
+ end
305
+
306
+ promise
307
+ end
308
+
309
+ #
310
+ # Gets a list of container services in the specified subscription and resource
311
+ # group. The operation returns properties of each container service including
312
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
313
+ # agents.
314
+ #
315
+ # @param resource_group_name [String] The name of the resource group.
316
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
317
+ # will be added to the HTTP request.
318
+ #
319
+ # @return [ContainerServiceListResult] operation results.
320
+ #
321
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
322
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
323
+ response.body unless response.nil?
324
+ end
325
+
326
+ #
327
+ # Gets a list of container services in the specified subscription and resource
328
+ # group. The operation returns properties of each container service including
329
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
330
+ # agents.
331
+ #
332
+ # @param resource_group_name [String] The name of the resource group.
333
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
334
+ # will be added to the HTTP request.
335
+ #
336
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
337
+ #
338
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
339
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
340
+ end
341
+
342
+ #
343
+ # Gets a list of container services in the specified subscription and resource
344
+ # group. The operation returns properties of each container service including
345
+ # state, orchestrator, number of masters and agents, and FQDNs of masters and
346
+ # agents.
347
+ #
348
+ # @param resource_group_name [String] The name of the resource group.
349
+ # @param [Hash{String => String}] A hash of custom headers that will be added
350
+ # to the HTTP request.
351
+ #
352
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
353
+ #
354
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
355
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
356
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
357
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
358
+
359
+
360
+ request_headers = {}
361
+
362
+ # Set Headers
363
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
364
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
365
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'
366
+
367
+ request_url = @base_url || @client.base_url
368
+
369
+ options = {
370
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
371
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
372
+ query_params: {'api-version' => @client.api_version},
373
+ headers: request_headers.merge(custom_headers || {}),
374
+ base_url: request_url
375
+ }
376
+ promise = @client.make_request_async(:get, path_template, options)
377
+
378
+ promise = promise.then do |result|
379
+ http_response = result.response
380
+ status_code = http_response.status
381
+ response_content = http_response.body
382
+ unless status_code == 200
383
+ error_model = JSON.load(response_content)
384
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
385
+ end
386
+
387
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
388
+ # Deserialize Response
389
+ if status_code == 200
390
+ begin
391
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
392
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerServiceListResult.mapper()
393
+ result.body = @client.deserialize(result_mapper, parsed_response)
394
+ rescue Exception => e
395
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
396
+ end
397
+ end
398
+
399
+ result
400
+ end
401
+
402
+ promise.execute
403
+ end
404
+
405
+ #
406
+ # Creates or updates a container service with the specified configuration of
407
+ # orchestrator, masters, and agents.
408
+ #
409
+ # @param resource_group_name [String] The name of the resource group.
410
+ # @param container_service_name [String] The name of the container service in
411
+ # the specified subscription and resource group.
412
+ # @param parameters [ContainerService] Parameters supplied to the Create or
413
+ # Update a Container Service operation.
414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
+ # will be added to the HTTP request.
416
+ #
417
+ # @return [ContainerService] operation results.
418
+ #
419
+ def begin_create_or_update(resource_group_name, container_service_name, parameters, custom_headers = nil)
420
+ response = begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers).value!
421
+ response.body unless response.nil?
422
+ end
423
+
424
+ #
425
+ # Creates or updates a container service with the specified configuration of
426
+ # orchestrator, masters, and agents.
427
+ #
428
+ # @param resource_group_name [String] The name of the resource group.
429
+ # @param container_service_name [String] The name of the container service in
430
+ # the specified subscription and resource group.
431
+ # @param parameters [ContainerService] Parameters supplied to the Create or
432
+ # Update a Container Service operation.
433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
434
+ # will be added to the HTTP request.
435
+ #
436
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
437
+ #
438
+ def begin_create_or_update_with_http_info(resource_group_name, container_service_name, parameters, custom_headers = nil)
439
+ begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers).value!
440
+ end
441
+
442
+ #
443
+ # Creates or updates a container service with the specified configuration of
444
+ # orchestrator, masters, and agents.
445
+ #
446
+ # @param resource_group_name [String] The name of the resource group.
447
+ # @param container_service_name [String] The name of the container service in
448
+ # the specified subscription and resource group.
449
+ # @param parameters [ContainerService] Parameters supplied to the Create or
450
+ # Update a Container Service operation.
451
+ # @param [Hash{String => String}] A hash of custom headers that will be added
452
+ # to the HTTP request.
453
+ #
454
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
455
+ #
456
+ def begin_create_or_update_async(resource_group_name, container_service_name, parameters, custom_headers = nil)
457
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
458
+ fail ArgumentError, 'container_service_name is nil' if container_service_name.nil?
459
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
460
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
461
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
462
+
463
+
464
+ request_headers = {}
465
+
466
+ # Set Headers
467
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
468
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
469
+
470
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
471
+
472
+ # Serialize Request
473
+ request_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerService.mapper()
474
+ request_content = @client.serialize(request_mapper, parameters)
475
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
476
+
477
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
478
+
479
+ request_url = @base_url || @client.base_url
480
+
481
+ options = {
482
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
483
+ path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
484
+ query_params: {'api-version' => @client.api_version},
485
+ body: request_content,
486
+ headers: request_headers.merge(custom_headers || {}),
487
+ base_url: request_url
488
+ }
489
+ promise = @client.make_request_async(:put, path_template, options)
490
+
491
+ promise = promise.then do |result|
492
+ http_response = result.response
493
+ status_code = http_response.status
494
+ response_content = http_response.body
495
+ unless status_code == 200 || status_code == 201 || status_code == 202
496
+ error_model = JSON.load(response_content)
497
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
498
+ end
499
+
500
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
501
+ # Deserialize Response
502
+ if status_code == 200
503
+ begin
504
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
505
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerService.mapper()
506
+ result.body = @client.deserialize(result_mapper, parsed_response)
507
+ rescue Exception => e
508
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
509
+ end
510
+ end
511
+ # Deserialize Response
512
+ if status_code == 201
513
+ begin
514
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
515
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerService.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
+ # Deserialize Response
522
+ if status_code == 202
523
+ begin
524
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
525
+ result_mapper = Azure::ContainerService::Mgmt::V2016_03_30::Models::ContainerService.mapper()
526
+ result.body = @client.deserialize(result_mapper, parsed_response)
527
+ rescue Exception => e
528
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
529
+ end
530
+ end
531
+
532
+ result
533
+ end
534
+
535
+ promise.execute
536
+ end
537
+
538
+ #
539
+ # Deletes the specified container service in the specified subscription and
540
+ # resource group. The operation does not delete other resources created as part
541
+ # of creating a container service, including storage accounts, VMs, and
542
+ # availability sets. All the other resources created with the container service
543
+ # are part of the same resource group and can be deleted individually.
544
+ #
545
+ # @param resource_group_name [String] The name of the resource group.
546
+ # @param container_service_name [String] The name of the container service in
547
+ # the specified subscription and resource group.
548
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
549
+ # will be added to the HTTP request.
550
+ #
551
+ #
552
+ def begin_delete(resource_group_name, container_service_name, custom_headers = nil)
553
+ response = begin_delete_async(resource_group_name, container_service_name, custom_headers).value!
554
+ nil
555
+ end
556
+
557
+ #
558
+ # Deletes the specified container service in the specified subscription and
559
+ # resource group. The operation does not delete other resources created as part
560
+ # of creating a container service, including storage accounts, VMs, and
561
+ # availability sets. All the other resources created with the container service
562
+ # are part of the same resource group and can be deleted individually.
563
+ #
564
+ # @param resource_group_name [String] The name of the resource group.
565
+ # @param container_service_name [String] The name of the container service in
566
+ # the specified subscription and resource group.
567
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
568
+ # will be added to the HTTP request.
569
+ #
570
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
571
+ #
572
+ def begin_delete_with_http_info(resource_group_name, container_service_name, custom_headers = nil)
573
+ begin_delete_async(resource_group_name, container_service_name, custom_headers).value!
574
+ end
575
+
576
+ #
577
+ # Deletes the specified container service in the specified subscription and
578
+ # resource group. The operation does not delete other resources created as part
579
+ # of creating a container service, including storage accounts, VMs, and
580
+ # availability sets. All the other resources created with the container service
581
+ # are part of the same resource group and can be deleted individually.
582
+ #
583
+ # @param resource_group_name [String] The name of the resource group.
584
+ # @param container_service_name [String] The name of the container service in
585
+ # the specified subscription and resource group.
586
+ # @param [Hash{String => String}] A hash of custom headers that will be added
587
+ # to the HTTP request.
588
+ #
589
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
590
+ #
591
+ def begin_delete_async(resource_group_name, container_service_name, custom_headers = nil)
592
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
593
+ fail ArgumentError, 'container_service_name is nil' if container_service_name.nil?
594
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
595
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
596
+
597
+
598
+ request_headers = {}
599
+
600
+ # Set Headers
601
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
602
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
603
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
604
+
605
+ request_url = @base_url || @client.base_url
606
+
607
+ options = {
608
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
609
+ path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
610
+ query_params: {'api-version' => @client.api_version},
611
+ headers: request_headers.merge(custom_headers || {}),
612
+ base_url: request_url
613
+ }
614
+ promise = @client.make_request_async(:delete, path_template, options)
615
+
616
+ promise = promise.then do |result|
617
+ http_response = result.response
618
+ status_code = http_response.status
619
+ response_content = http_response.body
620
+ unless status_code == 202 || status_code == 204
621
+ error_model = JSON.load(response_content)
622
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
623
+ end
624
+
625
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
626
+
627
+ result
628
+ end
629
+
630
+ promise.execute
631
+ end
632
+
633
+ end
634
+ end