azure_mgmt_kubernetes_configuration 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration.rb +47 -0
  4. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/compliance_state.rb +17 -0
  5. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/compliance_status.rb +82 -0
  6. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/enable_helm_operator.rb +16 -0
  7. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/error_definition.rb +81 -0
  8. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/error_response.rb +47 -0
  9. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/helm_operator_properties.rb +57 -0
  10. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/message_level.rb +17 -0
  11. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/operator_scope.rb +16 -0
  12. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/operator_type.rb +15 -0
  13. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/provisioning_state.rb +19 -0
  14. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/proxy_resource.rb +62 -0
  15. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/resource.rb +80 -0
  16. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation.rb +60 -0
  17. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation_display.rb +79 -0
  18. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation_list.rb +100 -0
  19. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/result.rb +46 -0
  20. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/source_control_configuration.rb +202 -0
  21. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/models/source_control_configuration_list.rb +104 -0
  22. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/module_definition.rb +9 -0
  23. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/operations.rb +231 -0
  24. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/source_control_configuration_client.rb +132 -0
  25. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/source_control_configurations.rb +737 -0
  26. data/lib/azure_mgmt_kubernetes_configuration.rb +6 -0
  27. data/lib/module_definition.rb +7 -0
  28. data/lib/profiles/latest/kubernetesconfiguration_latest_profile_client.rb +40 -0
  29. data/lib/profiles/latest/kubernetesconfiguration_module_definition.rb +8 -0
  30. data/lib/profiles/latest/modules/kubernetesconfiguration_profile_module.rb +135 -0
  31. data/lib/version.rb +7 -0
  32. metadata +147 -0
@@ -0,0 +1,104 @@
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::KubernetesConfiguration::Mgmt::V2019_11_01_preview
7
+ module Models
8
+ #
9
+ # Result of the request to list Source Control Configurations. It contains
10
+ # a list of SourceControlConfiguration objects and a URL link to get the
11
+ # next set of results.
12
+ #
13
+ class SourceControlConfigurationList
14
+
15
+ include MsRestAzure
16
+
17
+ include MsRest::JSONable
18
+ # @return [Array<SourceControlConfiguration>] List of Source Control
19
+ # Configurations within a Kubernetes cluster.
20
+ attr_accessor :value
21
+
22
+ # @return [String] URL to get the next set of configuration objects, if
23
+ # any.
24
+ attr_accessor :next_link
25
+
26
+ # return [Proc] with next page method call.
27
+ attr_accessor :next_method
28
+
29
+ #
30
+ # Gets the rest of the items for the request, enabling auto-pagination.
31
+ #
32
+ # @return [Array<SourceControlConfiguration>] operation results.
33
+ #
34
+ def get_all_items
35
+ items = @value
36
+ page = self
37
+ while page.next_link != nil && !page.next_link.strip.empty? do
38
+ page = page.get_next_page
39
+ items.concat(page.value)
40
+ end
41
+ items
42
+ end
43
+
44
+ #
45
+ # Gets the next page of results.
46
+ #
47
+ # @return [SourceControlConfigurationList] with next page content.
48
+ #
49
+ def get_next_page
50
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
51
+ unless response.nil?
52
+ @next_link = response.body.next_link
53
+ @value = response.body.value
54
+ self
55
+ end
56
+ end
57
+
58
+ #
59
+ # Mapper for SourceControlConfigurationList class as Ruby Hash.
60
+ # This will be used for serialization/deserialization.
61
+ #
62
+ def self.mapper()
63
+ {
64
+ client_side_validation: true,
65
+ required: false,
66
+ serialized_name: 'SourceControlConfigurationList',
67
+ type: {
68
+ name: 'Composite',
69
+ class_name: 'SourceControlConfigurationList',
70
+ model_properties: {
71
+ value: {
72
+ client_side_validation: true,
73
+ required: false,
74
+ read_only: true,
75
+ serialized_name: 'value',
76
+ type: {
77
+ name: 'Sequence',
78
+ element: {
79
+ client_side_validation: true,
80
+ required: false,
81
+ serialized_name: 'SourceControlConfigurationElementType',
82
+ type: {
83
+ name: 'Composite',
84
+ class_name: 'SourceControlConfiguration'
85
+ }
86
+ }
87
+ }
88
+ },
89
+ next_link: {
90
+ client_side_validation: true,
91
+ required: false,
92
+ read_only: true,
93
+ serialized_name: 'nextLink',
94
+ type: {
95
+ name: 'String'
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::KubernetesConfiguration end
8
+ module Azure::KubernetesConfiguration::Mgmt end
9
+ module Azure::KubernetesConfiguration::Mgmt::V2019_11_01_preview end
@@ -0,0 +1,231 @@
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::KubernetesConfiguration::Mgmt::V2019_11_01_preview
7
+ #
8
+ # Use these APIs to create Source Control Configuration resources through
9
+ # ARM, for Kubernetes Clusters.
10
+ #
11
+ class Operations
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Operations class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [SourceControlConfigurationClient] reference to the SourceControlConfigurationClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # List all the available operations the KubernetesConfiguration resource
27
+ # provider supports.
28
+ #
29
+ # @param api_version [String] The API version to be used with the HTTP request.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<ResourceProviderOperation>] operation results.
34
+ #
35
+ def list(api_version, custom_headers:nil)
36
+ first_page = list_as_lazy(api_version, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # List all the available operations the KubernetesConfiguration resource
42
+ # provider supports.
43
+ #
44
+ # @param api_version [String] The API version to be used with the HTTP request.
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
49
+ #
50
+ def list_with_http_info(api_version, custom_headers:nil)
51
+ list_async(api_version, custom_headers:custom_headers).value!
52
+ end
53
+
54
+ #
55
+ # List all the available operations the KubernetesConfiguration resource
56
+ # provider supports.
57
+ #
58
+ # @param api_version [String] The API version to be used with the HTTP request.
59
+ # @param [Hash{String => String}] A hash of custom headers that will be added
60
+ # to the HTTP request.
61
+ #
62
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
63
+ #
64
+ def list_async(api_version, custom_headers:nil)
65
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
66
+
67
+
68
+ request_headers = {}
69
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
70
+
71
+ # Set Headers
72
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
73
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
74
+ path_template = 'providers/Microsoft.KubernetesConfiguration/operations'
75
+
76
+ request_url = @base_url || @client.base_url
77
+
78
+ options = {
79
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
80
+ query_params: {'api-version' => 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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
97
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
98
+ # Deserialize Response
99
+ if status_code == 200
100
+ begin
101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
102
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2019_11_01_preview::Models::ResourceProviderOperationList.mapper()
103
+ result.body = @client.deserialize(result_mapper, parsed_response)
104
+ rescue Exception => e
105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
+ end
107
+ end
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ #
116
+ # List all the available operations the KubernetesConfiguration resource
117
+ # provider supports.
118
+ #
119
+ # @param next_page_link [String] The NextLink from the previous successful call
120
+ # to List operation.
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ # @return [ResourceProviderOperationList] operation results.
125
+ #
126
+ def list_next(next_page_link, custom_headers:nil)
127
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
128
+ response.body unless response.nil?
129
+ end
130
+
131
+ #
132
+ # List all the available operations the KubernetesConfiguration resource
133
+ # provider supports.
134
+ #
135
+ # @param next_page_link [String] The NextLink from the previous successful call
136
+ # to List operation.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
141
+ #
142
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
143
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
144
+ end
145
+
146
+ #
147
+ # List all the available operations the KubernetesConfiguration resource
148
+ # provider supports.
149
+ #
150
+ # @param next_page_link [String] The NextLink from the previous successful call
151
+ # to List operation.
152
+ # @param [Hash{String => String}] A hash of custom headers that will be added
153
+ # to the HTTP request.
154
+ #
155
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
156
+ #
157
+ def list_next_async(next_page_link, custom_headers:nil)
158
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
159
+
160
+
161
+ request_headers = {}
162
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
163
+
164
+ # Set Headers
165
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
166
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
167
+ path_template = '{nextLink}'
168
+
169
+ request_url = @base_url || @client.base_url
170
+
171
+ options = {
172
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
173
+ skip_encoding_path_params: {'nextLink' => next_page_link},
174
+ headers: request_headers.merge(custom_headers || {}),
175
+ base_url: request_url
176
+ }
177
+ promise = @client.make_request_async(:get, path_template, options)
178
+
179
+ promise = promise.then do |result|
180
+ http_response = result.response
181
+ status_code = http_response.status
182
+ response_content = http_response.body
183
+ unless status_code == 200
184
+ error_model = JSON.load(response_content)
185
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
186
+ end
187
+
188
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
189
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
190
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
191
+ # Deserialize Response
192
+ if status_code == 200
193
+ begin
194
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
195
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2019_11_01_preview::Models::ResourceProviderOperationList.mapper()
196
+ result.body = @client.deserialize(result_mapper, parsed_response)
197
+ rescue Exception => e
198
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
199
+ end
200
+ end
201
+
202
+ result
203
+ end
204
+
205
+ promise.execute
206
+ end
207
+
208
+ #
209
+ # List all the available operations the KubernetesConfiguration resource
210
+ # provider supports.
211
+ #
212
+ # @param api_version [String] The API version to be used with the HTTP request.
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [ResourceProviderOperationList] which provide lazy access to pages of
217
+ # the response.
218
+ #
219
+ def list_as_lazy(api_version, custom_headers:nil)
220
+ response = list_async(api_version, custom_headers:custom_headers).value!
221
+ unless response.nil?
222
+ page = response.body
223
+ page.next_method = Proc.new do |next_page_link|
224
+ list_next_async(next_page_link, custom_headers:custom_headers)
225
+ end
226
+ page
227
+ end
228
+ end
229
+
230
+ end
231
+ end
@@ -0,0 +1,132 @@
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::KubernetesConfiguration::Mgmt::V2019_11_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class SourceControlConfigurationClient < 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] The Azure subscription ID. This is a GUID-formatted
21
+ # string (e.g. 00000000-0000-0000-0000-000000000000)
22
+ attr_accessor :subscription_id
23
+
24
+ # @return [String] The preferred language for the response.
25
+ attr_accessor :accept_language
26
+
27
+ # @return [Integer] The retry timeout in seconds for Long Running
28
+ # Operations. Default value is 30.
29
+ attr_accessor :long_running_operation_retry_timeout
30
+
31
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
32
+ # generated. When set to true a unique x-ms-client-request-id value is
33
+ # generated and included in each request. Default is true.
34
+ attr_accessor :generate_client_request_id
35
+
36
+ # @return [SourceControlConfigurations] source_control_configurations
37
+ attr_reader :source_control_configurations
38
+
39
+ # @return [Operations] operations
40
+ attr_reader :operations
41
+
42
+ #
43
+ # Creates initializes a new instance of the SourceControlConfigurationClient 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
+ @source_control_configurations = SourceControlConfigurations.new(self)
56
+ @operations = Operations.new(self)
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
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
110
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
111
+ end
112
+
113
+ request_headers = @request_headers
114
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
115
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
116
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
117
+
118
+ super(request_url, method, path, options)
119
+ end
120
+
121
+
122
+ private
123
+ #
124
+ # Adds telemetry information.
125
+ #
126
+ def add_telemetry
127
+ sdk_information = 'azure_mgmt_kubernetes_configuration'
128
+ sdk_information = "#{sdk_information}/0.17.0"
129
+ add_user_agent_information(sdk_information)
130
+ end
131
+ end
132
+ end