forked from ManageIQ/nutanix_clustermgmt-sdk-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvcenter_extensions_api.rb
More file actions
343 lines (291 loc) · 21.6 KB
/
vcenter_extensions_api.rb
File metadata and controls
343 lines (291 loc) · 21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
=begin
#Nutanix Cluster Management APIs
#Manage Hosts, Clusters and other Infrastructure.
The version of the OpenAPI document: 4.0.2
Generated by: https://openapi-generator.tech
Generator version: 7.16.0
=end
require 'cgi'
module NutanixClustermgmt
class VcenterExtensionsApi
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Get vCenter server extension.
# Fetches vCenter server extension information for the given VcenterExtensionExtId.
# @param ext_id [String] The globally unique identifier of vCenter Server extension instance. It should be of type UUID.
# @param [Hash] opts the optional parameters
# @return [GetVcenterExtensionById200Response]
def get_vcenter_extension_by_id(ext_id, opts = {})
data, _status_code, _headers = get_vcenter_extension_by_id_with_http_info(ext_id, opts)
data
end
# Get vCenter server extension.
# Fetches vCenter server extension information for the given VcenterExtensionExtId.
# @param ext_id [String] The globally unique identifier of vCenter Server extension instance. It should be of type UUID.
# @param [Hash] opts the optional parameters
# @return [Array<(GetVcenterExtensionById200Response, Integer, Hash)>] GetVcenterExtensionById200Response data, response status code and response headers
def get_vcenter_extension_by_id_with_http_info(ext_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: VcenterExtensionsApi.get_vcenter_extension_by_id ...'
end
# verify the required parameter 'ext_id' is set
if @api_client.config.client_side_validation && ext_id.nil?
fail ArgumentError, "Missing the required parameter 'ext_id' when calling VcenterExtensionsApi.get_vcenter_extension_by_id"
end
pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
if @api_client.config.client_side_validation && ext_id !~ pattern
fail ArgumentError, "invalid value for 'ext_id' when calling VcenterExtensionsApi.get_vcenter_extension_by_id, must conform to the pattern #{pattern}."
end
# resource path
local_var_path = '/clustermgmt/v4.0/config/vcenter-extensions/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'GetVcenterExtensionById200Response'
# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']
new_options = opts.merge(
:operation => :"VcenterExtensionsApi.get_vcenter_extension_by_id",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: VcenterExtensionsApi#get_vcenter_extension_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List vCenter server extensions.
# List of vCenter server extensions for the clusters registered under a Prism Central server.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results. (default to 0)
# @option opts [Integer] :limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set. (default to 50)
# @option opts [String] :filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields: - clusterExtId - ipAddress - isRegistered
# @option opts [String] :select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. - clusterExtId - extId - ipAddress - isRegistered - links - tenantId
# @return [ListVcenterExtensions200Response]
def list_vcenter_extensions(opts = {})
data, _status_code, _headers = list_vcenter_extensions_with_http_info(opts)
data
end
# List vCenter server extensions.
# List of vCenter server extensions for the clusters registered under a Prism Central server.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results. (default to 0)
# @option opts [Integer] :limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set. (default to 50)
# @option opts [String] :filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields: - clusterExtId - ipAddress - isRegistered
# @option opts [String] :select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. - clusterExtId - extId - ipAddress - isRegistered - links - tenantId
# @return [Array<(ListVcenterExtensions200Response, Integer, Hash)>] ListVcenterExtensions200Response data, response status code and response headers
def list_vcenter_extensions_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: VcenterExtensionsApi.list_vcenter_extensions ...'
end
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VcenterExtensionsApi.list_vcenter_extensions, must be greater than or equal to 0.'
end
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VcenterExtensionsApi.list_vcenter_extensions, must be smaller than or equal to 100.'
end
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VcenterExtensionsApi.list_vcenter_extensions, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/clustermgmt/v4.0/config/vcenter-extensions'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'$page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'$limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?
query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'ListVcenterExtensions200Response'
# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']
new_options = opts.merge(
:operation => :"VcenterExtensionsApi.list_vcenter_extensions",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: VcenterExtensionsApi#list_vcenter_extensions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Register vCenter server extension.
# Registers Nutanix cluster as a vCenter server extension.
# @param ext_id [String] The globally unique identifier of vCenter Server extension instance. It should be of type UUID.
# @param ntnx_request_id [String] A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.
# @param clustermgmt_v40_config_vcenter_credentials [ClustermgmtV40ConfigVcenterCredentials]
# @param [Hash] opts the optional parameters
# @return [RegisterVcenterExtension202Response]
def register_vcenter_extension(ext_id, ntnx_request_id, clustermgmt_v40_config_vcenter_credentials, opts = {})
data, _status_code, _headers = register_vcenter_extension_with_http_info(ext_id, ntnx_request_id, clustermgmt_v40_config_vcenter_credentials, opts)
data
end
# Register vCenter server extension.
# Registers Nutanix cluster as a vCenter server extension.
# @param ext_id [String] The globally unique identifier of vCenter Server extension instance. It should be of type UUID.
# @param ntnx_request_id [String] A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.
# @param clustermgmt_v40_config_vcenter_credentials [ClustermgmtV40ConfigVcenterCredentials]
# @param [Hash] opts the optional parameters
# @return [Array<(RegisterVcenterExtension202Response, Integer, Hash)>] RegisterVcenterExtension202Response data, response status code and response headers
def register_vcenter_extension_with_http_info(ext_id, ntnx_request_id, clustermgmt_v40_config_vcenter_credentials, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: VcenterExtensionsApi.register_vcenter_extension ...'
end
# verify the required parameter 'ext_id' is set
if @api_client.config.client_side_validation && ext_id.nil?
fail ArgumentError, "Missing the required parameter 'ext_id' when calling VcenterExtensionsApi.register_vcenter_extension"
end
pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
if @api_client.config.client_side_validation && ext_id !~ pattern
fail ArgumentError, "invalid value for 'ext_id' when calling VcenterExtensionsApi.register_vcenter_extension, must conform to the pattern #{pattern}."
end
# verify the required parameter 'ntnx_request_id' is set
if @api_client.config.client_side_validation && ntnx_request_id.nil?
fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling VcenterExtensionsApi.register_vcenter_extension"
end
# verify the required parameter 'clustermgmt_v40_config_vcenter_credentials' is set
if @api_client.config.client_side_validation && clustermgmt_v40_config_vcenter_credentials.nil?
fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_vcenter_credentials' when calling VcenterExtensionsApi.register_vcenter_extension"
end
# resource path
local_var_path = '/clustermgmt/v4.0/config/vcenter-extensions/{extId}/$actions/register'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
header_params[:'NTNX-Request-Id'] = ntnx_request_id
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(clustermgmt_v40_config_vcenter_credentials)
# return_type
return_type = opts[:debug_return_type] || 'RegisterVcenterExtension202Response'
# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']
new_options = opts.merge(
:operation => :"VcenterExtensionsApi.register_vcenter_extension",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: VcenterExtensionsApi#register_vcenter_extension\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Unregister vCenter server extension.
# Unregisters Nutanix cluster as a vCenter server extension.
# @param ext_id [String] The globally unique identifier of vCenter Server extension instance. It should be of type UUID.
# @param ntnx_request_id [String] A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.
# @param clustermgmt_v40_config_vcenter_credentials [ClustermgmtV40ConfigVcenterCredentials]
# @param [Hash] opts the optional parameters
# @return [UnregisterVcenterExtension202Response]
def unregister_vcenter_extension(ext_id, ntnx_request_id, clustermgmt_v40_config_vcenter_credentials, opts = {})
data, _status_code, _headers = unregister_vcenter_extension_with_http_info(ext_id, ntnx_request_id, clustermgmt_v40_config_vcenter_credentials, opts)
data
end
# Unregister vCenter server extension.
# Unregisters Nutanix cluster as a vCenter server extension.
# @param ext_id [String] The globally unique identifier of vCenter Server extension instance. It should be of type UUID.
# @param ntnx_request_id [String] A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.
# @param clustermgmt_v40_config_vcenter_credentials [ClustermgmtV40ConfigVcenterCredentials]
# @param [Hash] opts the optional parameters
# @return [Array<(UnregisterVcenterExtension202Response, Integer, Hash)>] UnregisterVcenterExtension202Response data, response status code and response headers
def unregister_vcenter_extension_with_http_info(ext_id, ntnx_request_id, clustermgmt_v40_config_vcenter_credentials, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: VcenterExtensionsApi.unregister_vcenter_extension ...'
end
# verify the required parameter 'ext_id' is set
if @api_client.config.client_side_validation && ext_id.nil?
fail ArgumentError, "Missing the required parameter 'ext_id' when calling VcenterExtensionsApi.unregister_vcenter_extension"
end
pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
if @api_client.config.client_side_validation && ext_id !~ pattern
fail ArgumentError, "invalid value for 'ext_id' when calling VcenterExtensionsApi.unregister_vcenter_extension, must conform to the pattern #{pattern}."
end
# verify the required parameter 'ntnx_request_id' is set
if @api_client.config.client_side_validation && ntnx_request_id.nil?
fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling VcenterExtensionsApi.unregister_vcenter_extension"
end
# verify the required parameter 'clustermgmt_v40_config_vcenter_credentials' is set
if @api_client.config.client_side_validation && clustermgmt_v40_config_vcenter_credentials.nil?
fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_vcenter_credentials' when calling VcenterExtensionsApi.unregister_vcenter_extension"
end
# resource path
local_var_path = '/clustermgmt/v4.0/config/vcenter-extensions/{extId}/$actions/unregister'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
header_params[:'NTNX-Request-Id'] = ntnx_request_id
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(clustermgmt_v40_config_vcenter_credentials)
# return_type
return_type = opts[:debug_return_type] || 'UnregisterVcenterExtension202Response'
# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']
new_options = opts.merge(
:operation => :"VcenterExtensionsApi.unregister_vcenter_extension",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: VcenterExtensionsApi#unregister_vcenter_extension\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end