azure_mgmt_kubernetes_configuration 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2019-11-01-preview/generated/azure_mgmt_kubernetes_configuration/source_control_configuration_client.rb +1 -1
  3. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration.rb +50 -0
  4. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/azure_entity_resource.rb +77 -0
  5. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/compliance_state_type.rb +19 -0
  6. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/compliance_status.rb +83 -0
  7. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/created_by_type.rb +18 -0
  8. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/error_definition.rb +58 -0
  9. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/error_response.rb +47 -0
  10. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/helm_operator_properties.rb +57 -0
  11. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/message_level_type.rb +17 -0
  12. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/operator_scope_type.rb +16 -0
  13. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/operator_type.rb +15 -0
  14. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/provisioning_state_type.rb +19 -0
  15. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/proxy_resource.rb +65 -0
  16. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource.rb +86 -0
  17. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation.rb +73 -0
  18. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation_display.rb +79 -0
  19. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/resource_provider_operation_list.rb +100 -0
  20. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/result.rb +46 -0
  21. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/source_control_configuration.rb +247 -0
  22. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/source_control_configuration_list.rb +104 -0
  23. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/system_data.rb +105 -0
  24. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/models/tracked_resource.rb +95 -0
  25. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/module_definition.rb +9 -0
  26. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/operations.rb +227 -0
  27. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/source_control_configuration_client.rb +136 -0
  28. data/lib/2021-03-01/generated/azure_mgmt_kubernetes_configuration/source_control_configurations.rb +722 -0
  29. data/lib/azure_mgmt_kubernetes_configuration.rb +1 -0
  30. data/lib/profiles/latest/modules/kubernetesconfiguration_profile_module.rb +67 -55
  31. data/lib/version.rb +1 -1
  32. metadata +29 -3
@@ -0,0 +1,95 @@
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::V2021_03_01
7
+ module Models
8
+ #
9
+ # Tracked Resource
10
+
11
+ # The resource model definition for an Azure Resource Manager tracked top
12
+ # level resource which has 'tags' and a 'location'
13
+ #
14
+ class TrackedResource < Resource
15
+
16
+ include MsRestAzure
17
+
18
+ # @return [Hash{String => String}] Resource tags.
19
+ attr_accessor :tags
20
+
21
+ # @return [String] The geo-location where the resource lives
22
+ attr_accessor :location
23
+
24
+
25
+ #
26
+ # Mapper for TrackedResource class as Ruby Hash.
27
+ # This will be used for serialization/deserialization.
28
+ #
29
+ def self.mapper()
30
+ {
31
+ client_side_validation: true,
32
+ required: false,
33
+ serialized_name: 'TrackedResource',
34
+ type: {
35
+ name: 'Composite',
36
+ class_name: 'TrackedResource',
37
+ model_properties: {
38
+ id: {
39
+ client_side_validation: true,
40
+ required: false,
41
+ read_only: true,
42
+ serialized_name: 'id',
43
+ type: {
44
+ name: 'String'
45
+ }
46
+ },
47
+ name: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ read_only: true,
51
+ serialized_name: 'name',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ type: {
57
+ client_side_validation: true,
58
+ required: false,
59
+ read_only: true,
60
+ serialized_name: 'type',
61
+ type: {
62
+ name: 'String'
63
+ }
64
+ },
65
+ tags: {
66
+ client_side_validation: true,
67
+ required: false,
68
+ serialized_name: 'tags',
69
+ type: {
70
+ name: 'Dictionary',
71
+ value: {
72
+ client_side_validation: true,
73
+ required: false,
74
+ serialized_name: 'StringElementType',
75
+ type: {
76
+ name: 'String'
77
+ }
78
+ }
79
+ }
80
+ },
81
+ location: {
82
+ client_side_validation: true,
83
+ required: true,
84
+ serialized_name: 'location',
85
+ type: {
86
+ name: 'String'
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ end
93
+ end
94
+ end
95
+ 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::V2021_03_01 end
@@ -0,0 +1,227 @@
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::V2021_03_01
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 custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<ResourceProviderOperation>] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ first_page = list_as_lazy(custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # List all the available operations the KubernetesConfiguration resource
41
+ # provider supports.
42
+ #
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def list_with_http_info(custom_headers:nil)
49
+ list_async(custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # List all the available operations the KubernetesConfiguration resource
54
+ # provider supports.
55
+ #
56
+ # @param [Hash{String => String}] A hash of custom headers that will be added
57
+ # to the HTTP request.
58
+ #
59
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
60
+ #
61
+ def list_async(custom_headers:nil)
62
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = 'providers/Microsoft.KubernetesConfiguration/operations'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {}),
79
+ base_url: request_url
80
+ }
81
+ promise = @client.make_request_async(:get, path_template, options)
82
+
83
+ promise = promise.then do |result|
84
+ http_response = result.response
85
+ status_code = http_response.status
86
+ response_content = http_response.body
87
+ unless status_code == 200
88
+ error_model = JSON.load(response_content)
89
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
90
+ end
91
+
92
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
93
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
94
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
95
+ # Deserialize Response
96
+ if status_code == 200
97
+ begin
98
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::ResourceProviderOperationList.mapper()
100
+ result.body = @client.deserialize(result_mapper, parsed_response)
101
+ rescue Exception => e
102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
103
+ end
104
+ end
105
+
106
+ result
107
+ end
108
+
109
+ promise.execute
110
+ end
111
+
112
+ #
113
+ # List all the available operations the KubernetesConfiguration resource
114
+ # provider supports.
115
+ #
116
+ # @param next_page_link [String] The NextLink from the previous successful call
117
+ # to List operation.
118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
119
+ # will be added to the HTTP request.
120
+ #
121
+ # @return [ResourceProviderOperationList] operation results.
122
+ #
123
+ def list_next(next_page_link, custom_headers:nil)
124
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
125
+ response.body unless response.nil?
126
+ end
127
+
128
+ #
129
+ # List all the available operations the KubernetesConfiguration resource
130
+ # provider supports.
131
+ #
132
+ # @param next_page_link [String] The NextLink from the previous successful call
133
+ # to List operation.
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
138
+ #
139
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
140
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
141
+ end
142
+
143
+ #
144
+ # List all the available operations the KubernetesConfiguration resource
145
+ # provider supports.
146
+ #
147
+ # @param next_page_link [String] The NextLink from the previous successful call
148
+ # to List operation.
149
+ # @param [Hash{String => String}] A hash of custom headers that will be added
150
+ # to the HTTP request.
151
+ #
152
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
153
+ #
154
+ def list_next_async(next_page_link, custom_headers:nil)
155
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
156
+
157
+
158
+ request_headers = {}
159
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
160
+
161
+ # Set Headers
162
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
163
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
164
+ path_template = '{nextLink}'
165
+
166
+ request_url = @base_url || @client.base_url
167
+
168
+ options = {
169
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
170
+ skip_encoding_path_params: {'nextLink' => next_page_link},
171
+ headers: request_headers.merge(custom_headers || {}),
172
+ base_url: request_url
173
+ }
174
+ promise = @client.make_request_async(:get, path_template, options)
175
+
176
+ promise = promise.then do |result|
177
+ http_response = result.response
178
+ status_code = http_response.status
179
+ response_content = http_response.body
180
+ unless status_code == 200
181
+ error_model = JSON.load(response_content)
182
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
183
+ end
184
+
185
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
186
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
187
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
188
+ # Deserialize Response
189
+ if status_code == 200
190
+ begin
191
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
192
+ result_mapper = Azure::KubernetesConfiguration::Mgmt::V2021_03_01::Models::ResourceProviderOperationList.mapper()
193
+ result.body = @client.deserialize(result_mapper, parsed_response)
194
+ rescue Exception => e
195
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
196
+ end
197
+ end
198
+
199
+ result
200
+ end
201
+
202
+ promise.execute
203
+ end
204
+
205
+ #
206
+ # List all the available operations the KubernetesConfiguration resource
207
+ # provider supports.
208
+ #
209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
210
+ # will be added to the HTTP request.
211
+ #
212
+ # @return [ResourceProviderOperationList] which provide lazy access to pages of
213
+ # the response.
214
+ #
215
+ def list_as_lazy(custom_headers:nil)
216
+ response = list_async(custom_headers:custom_headers).value!
217
+ unless response.nil?
218
+ page = response.body
219
+ page.next_method = Proc.new do |next_page_link|
220
+ list_next_async(next_page_link, custom_headers:custom_headers)
221
+ end
222
+ page
223
+ end
224
+ end
225
+
226
+ end
227
+ end
@@ -0,0 +1,136 @@
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::V2021_03_01
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 API version to be used with the HTTP request.
25
+ attr_reader :api_version
26
+
27
+ # @return [String] The preferred language for the response.
28
+ attr_accessor :accept_language
29
+
30
+ # @return [Integer] The retry timeout in seconds for Long Running
31
+ # Operations. Default value is 30.
32
+ attr_accessor :long_running_operation_retry_timeout
33
+
34
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
35
+ # generated. When set to true a unique x-ms-client-request-id value is
36
+ # generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return [SourceControlConfigurations] source_control_configurations
40
+ attr_reader :source_control_configurations
41
+
42
+ # @return [Operations] operations
43
+ attr_reader :operations
44
+
45
+ #
46
+ # Creates initializes a new instance of the SourceControlConfigurationClient class.
47
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
48
+ # @param base_url [String] the base URI of the service.
49
+ # @param options [Array] filters to be applied to the HTTP requests.
50
+ #
51
+ def initialize(credentials = nil, base_url = nil, options = nil)
52
+ super(credentials, options)
53
+ @base_url = base_url || 'https://management.azure.com'
54
+
55
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
56
+ @credentials = credentials
57
+
58
+ @source_control_configurations = SourceControlConfigurations.new(self)
59
+ @operations = Operations.new(self)
60
+ @api_version = '2021-03-01'
61
+ @accept_language = 'en-US'
62
+ @long_running_operation_retry_timeout = 30
63
+ @generate_client_request_id = true
64
+ add_telemetry
65
+ end
66
+
67
+ #
68
+ # Makes a request and returns the body of the response.
69
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
70
+ # @param path [String] the path, relative to {base_url}.
71
+ # @param options [Hash{String=>String}] specifying any request options like :body.
72
+ # @return [Hash{String=>String}] containing the body of the response.
73
+ # Example:
74
+ #
75
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
76
+ # path = "/path"
77
+ # options = {
78
+ # body: request_content,
79
+ # query_params: {'api-version' => '2016-02-01'}
80
+ # }
81
+ # result = @client.make_request(:put, path, options)
82
+ #
83
+ def make_request(method, path, options = {})
84
+ result = make_request_with_http_info(method, path, options)
85
+ result.body unless result.nil?
86
+ end
87
+
88
+ #
89
+ # Makes a request and returns the operation response.
90
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
91
+ # @param path [String] the path, relative to {base_url}.
92
+ # @param options [Hash{String=>String}] specifying any request options like :body.
93
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
94
+ #
95
+ def make_request_with_http_info(method, path, options = {})
96
+ result = make_request_async(method, path, options).value!
97
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
98
+ result
99
+ end
100
+
101
+ #
102
+ # Makes a request asynchronously.
103
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
104
+ # @param path [String] the path, relative to {base_url}.
105
+ # @param options [Hash{String=>String}] specifying any request options like :body.
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def make_request_async(method, path, options = {})
109
+ fail ArgumentError, 'method is nil' if method.nil?
110
+ fail ArgumentError, 'path is nil' if path.nil?
111
+
112
+ request_url = options[:base_url] || @base_url
113
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
114
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
115
+ end
116
+
117
+ request_headers = @request_headers
118
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
119
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
120
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
121
+
122
+ super(request_url, method, path, options)
123
+ end
124
+
125
+
126
+ private
127
+ #
128
+ # Adds telemetry information.
129
+ #
130
+ def add_telemetry
131
+ sdk_information = 'azure_mgmt_kubernetes_configuration'
132
+ sdk_information = "#{sdk_information}/0.18.0"
133
+ add_user_agent_information(sdk_information)
134
+ end
135
+ end
136
+ end