Class: NutanixClustermgmt::StorageContainersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/nutanix_clustermgmt/api/storage_containers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StorageContainersApi

Returns a new instance of StorageContainersApi.



19
20
21
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_storage_container(x_cluster_id, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {}) ⇒ CreateStorageContainer202Response

Create a Storage Container Creates a new Storage Container with the specified configuration on the cluster identified by cluster’s external identifier. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • x_cluster_id (String)

    The external identifier of the remote cluster to forward the request.

  • 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.

  • clustermgmt_v40_config_storage_container (ClustermgmtV40ConfigStorageContainer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 29

def create_storage_container(x_cluster_id, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {})
  data, _status_code, _headers = create_storage_container_with_http_info(x_cluster_id, ntnx_request_id, clustermgmt_v40_config_storage_container, opts)
  data
end

#create_storage_container_with_http_info(x_cluster_id, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {}) ⇒ Array<(CreateStorageContainer202Response, Integer, Hash)>

Create a Storage Container Creates a new Storage Container with the specified configuration on the cluster identified by cluster’s external identifier. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • x_cluster_id (String)

    The external identifier of the remote cluster to forward the request.

  • 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.

  • clustermgmt_v40_config_storage_container (ClustermgmtV40ConfigStorageContainer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 41

def create_storage_container_with_http_info(x_cluster_id, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.create_storage_container ...'
  end
  # verify the required parameter 'x_cluster_id' is set
  if @api_client.config.client_side_validation && x_cluster_id.nil?
    fail ArgumentError, "Missing the required parameter 'x_cluster_id' when calling StorageContainersApi.create_storage_container"
  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 && x_cluster_id !~ pattern
    fail ArgumentError, "invalid value for 'x_cluster_id' when calling StorageContainersApi.create_storage_container, 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 StorageContainersApi.create_storage_container"
  end
  # verify the required parameter 'clustermgmt_v40_config_storage_container' is set
  if @api_client.config.client_side_validation && clustermgmt_v40_config_storage_container.nil?
    fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_storage_container' when calling StorageContainersApi.create_storage_container"
  end
  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers'

  # 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[:'X-Cluster-Id'] = x_cluster_id
  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_storage_container)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateStorageContainer202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.create_storage_container",
    :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: StorageContainersApi#create_storage_container\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_storage_container_by_id(ext_id, ntnx_request_id, opts = {}) ⇒ DeleteStorageContainerById202Response

Delete a Storage Container Deletes an existing Storage Container identified by external identifier. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • 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.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ignore_small_files (Boolean) — default: default to true

Returns:



116
117
118
119
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 116

def delete_storage_container_by_id(ext_id, ntnx_request_id, opts = {})
  data, _status_code, _headers = delete_storage_container_by_id_with_http_info(ext_id, ntnx_request_id, opts)
  data
end

#delete_storage_container_by_id_with_http_info(ext_id, ntnx_request_id, opts = {}) ⇒ Array<(DeleteStorageContainerById202Response, Integer, Hash)>

Delete a Storage Container Deletes an existing Storage Container identified by external identifier. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • 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.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ignore_small_files (Boolean) — default: default to true

Returns:



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
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 128

def delete_storage_container_by_id_with_http_info(ext_id, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.delete_storage_container_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 StorageContainersApi.delete_storage_container_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 StorageContainersApi.delete_storage_container_by_id, 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 StorageContainersApi.delete_storage_container_by_id"
  end
  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ignoreSmallFiles'] = opts[:'ignore_small_files'] if !opts[:'ignore_small_files'].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']
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteStorageContainerById202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.delete_storage_container_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageContainersApi#delete_storage_container_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_storage_container_by_id(ext_id, opts = {}) ⇒ GetStorageContainerById200Response

Get Storage Container configuration Fetches the configuration details of an existing storage container identified by the external identifier. Note: The Storage Containers of PEs with versions prior to AOS 6.5 might have missing attribute data, and the PEs under the self-owned RBAC category might not be visible to non-admin users.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



192
193
194
195
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 192

def get_storage_container_by_id(ext_id, opts = {})
  data, _status_code, _headers = get_storage_container_by_id_with_http_info(ext_id, opts)
  data
end

#get_storage_container_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetStorageContainerById200Response, Integer, Hash)>

Get Storage Container configuration Fetches the configuration details of an existing storage container identified by the external identifier. Note: The Storage Containers of PEs with versions prior to AOS 6.5 might have missing attribute data, and the PEs under the self-owned RBAC category might not be visible to non-admin users.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 202

def get_storage_container_by_id_with_http_info(ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.get_storage_container_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 StorageContainersApi.get_storage_container_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 StorageContainersApi.get_storage_container_by_id, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers/{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] || 'GetStorageContainerById200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.get_storage_container_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: StorageContainersApi#get_storage_container_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_storage_container_stats(ext_id, start_time, end_time, opts = {}) ⇒ GetStorageContainerStats200Response

Get Stats for a Storage Container Fetches the statistical information for the Storage Container identified by external identifier..

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • start_time (Time)

    The start time of the period for which stats should be reported. The value should be in extended ISO-8601 format. For example, start time of 2022-04-23T01:23:45.678+09:00 would consider all stats starting at 1:23:45.678 on the 23rd of April 2022. Details around ISO-8601 format can be found at www.iso.org/standard/70907.html

  • end_time (Time)

    The end time of the period for which stats should be reported. The value should be in extended ISO-8601 format. For example, end time of 2022-04-23T013:23:45.678+09:00 would consider all stats till 13:23:45 .678 on the 23rd of April 2022. Details around ISO-8601 format can be found at www.iso.org/standard/70907.html

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sampling_interval (Integer)

    The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30.

  • :stat_type (CommonV10StatsDownSamplingOperator)

Returns:



264
265
266
267
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 264

def get_storage_container_stats(ext_id, start_time, end_time, opts = {})
  data, _status_code, _headers = get_storage_container_stats_with_http_info(ext_id, start_time, end_time, opts)
  data
end

#get_storage_container_stats_with_http_info(ext_id, start_time, end_time, opts = {}) ⇒ Array<(GetStorageContainerStats200Response, Integer, Hash)>

Get Stats for a Storage Container Fetches the statistical information for the Storage Container identified by external identifier..

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • start_time (Time)

    The start time of the period for which stats should be reported. The value should be in extended ISO-8601 format. For example, start time of 2022-04-23T01:23:45.678+09:00 would consider all stats starting at 1:23:45.678 on the 23rd of April 2022. Details around ISO-8601 format can be found at www.iso.org/standard/70907.html

  • end_time (Time)

    The end time of the period for which stats should be reported. The value should be in extended ISO-8601 format. For example, end time of 2022-04-23T013:23:45.678+09:00 would consider all stats till 13:23:45 .678 on the 23rd of April 2022. Details around ISO-8601 format can be found at www.iso.org/standard/70907.html

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sampling_interval (Integer)

    The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30.

  • :stat_type (CommonV10StatsDownSamplingOperator)

Returns:



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
344
345
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 278

def get_storage_container_stats_with_http_info(ext_id, start_time, end_time, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.get_storage_container_stats ...'
  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 StorageContainersApi.get_storage_container_stats"
  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 StorageContainersApi.get_storage_container_stats, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'start_time' is set
  if @api_client.config.client_side_validation && start_time.nil?
    fail ArgumentError, "Missing the required parameter 'start_time' when calling StorageContainersApi.get_storage_container_stats"
  end
  # verify the required parameter 'end_time' is set
  if @api_client.config.client_side_validation && end_time.nil?
    fail ArgumentError, "Missing the required parameter 'end_time' when calling StorageContainersApi.get_storage_container_stats"
  end
  if @api_client.config.client_side_validation && !opts[:'sampling_interval'].nil? && opts[:'sampling_interval'] < 1
    fail ArgumentError, 'invalid value for "opts[:"sampling_interval"]" when calling StorageContainersApi.get_storage_container_stats, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/clustermgmt/v4.0/stats/storage-containers/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'$startTime'] = start_time
  query_params[:'$endTime'] = end_time
  query_params[:'$samplingInterval'] = opts[:'sampling_interval'] if !opts[:'sampling_interval'].nil?
  query_params[:'$statType'] = opts[:'stat_type'] if !opts[:'stat_type'].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] || 'GetStorageContainerStats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.get_storage_container_stats",
    :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: StorageContainersApi#get_storage_container_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_data_stores_by_cluster_id(cluster_ext_id, opts = {}) ⇒ ListDataStoresByClusterId200Response

List datastores of a cluster Lists all the datastores associated with Storage Containers from a cluster.

Parameters:

  • cluster_ext_id (String)

    The cluster from which the datastores needs to be listed.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    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)

  • :limit (Integer)

    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)

  • :filter (String)

    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](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter &#39;$filter&#x3D;name eq &#39;karbon-ntnx-1.0&#39; would filter the result on cluster name &#39;karbon-ntnx1.0&#39;, filter &#39;$filter&#x3D;startswith(name, &#39;C&#39;)&#39; would filter on cluster name starting with &#39;C&#39;. The filter can be applied to the following fields: - containerExtId

Returns:



355
356
357
358
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 355

def list_data_stores_by_cluster_id(cluster_ext_id, opts = {})
  data, _status_code, _headers = list_data_stores_by_cluster_id_with_http_info(cluster_ext_id, opts)
  data
end

#list_data_stores_by_cluster_id_with_http_info(cluster_ext_id, opts = {}) ⇒ Array<(ListDataStoresByClusterId200Response, Integer, Hash)>

List datastores of a cluster Lists all the datastores associated with Storage Containers from a cluster.

Parameters:

  • cluster_ext_id (String)

    The cluster from which the datastores needs to be listed.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    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)

  • :limit (Integer)

    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)

  • :filter (String)

    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](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter &#39;$filter&#x3D;name eq &#39;karbon-ntnx-1.0&#39; would filter the result on cluster name &#39;karbon-ntnx1.0&#39;, filter &#39;$filter&#x3D;startswith(name, &#39;C&#39;)&#39; would filter on cluster name starting with &#39;C&#39;. The filter can be applied to the following fields: - containerExtId

Returns:



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 368

def list_data_stores_by_cluster_id_with_http_info(cluster_ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.list_data_stores_by_cluster_id ...'
  end
  # verify the required parameter 'cluster_ext_id' is set
  if @api_client.config.client_side_validation && cluster_ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'cluster_ext_id' when calling StorageContainersApi.list_data_stores_by_cluster_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 && cluster_ext_id !~ pattern
    fail ArgumentError, "invalid value for 'cluster_ext_id' when calling StorageContainersApi.list_data_stores_by_cluster_id, must conform to the pattern #{pattern}."
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling StorageContainersApi.list_data_stores_by_cluster_id, 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 StorageContainersApi.list_data_stores_by_cluster_id, 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 StorageContainersApi.list_data_stores_by_cluster_id, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/clustermgmt/v4.0/config/clusters/{clusterExtId}/storage-containers/datastores'.sub('{' + 'clusterExtId' + '}', CGI.escape(cluster_ext_id.to_s))

  # 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?

  # 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] || 'ListDataStoresByClusterId200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.list_data_stores_by_cluster_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: StorageContainersApi#list_data_stores_by_cluster_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_storage_containers(opts = {}) ⇒ ListStorageContainers200Response

List Storage Containers Lists the Storage Containers available in the cluster. Note: The Storage Containers of PEs with versions prior to AOS 6.5 might have missing attribute data, and the PEs under the self-owned RBAC category might not be visible to non-admin users.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    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)

  • :limit (Integer)

    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)

  • :filter (String)

    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](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter &#39;$filter&#x3D;name eq &#39;karbon-ntnx-1.0&#39; would filter the result on cluster name &#39;karbon-ntnx1.0&#39;, filter &#39;$filter&#x3D;startswith(name, &#39;C&#39;)&#39; would filter on cluster name starting with &#39;C&#39;. The filter can be applied to the following fields: - affinityHostExtId - clusterExtId - clusterName - compressionDelaySecs - containerExtId - name - ownerExtId - replicationFactor - storagePoolExtId

  • :orderby (String)

    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, &#39;$orderby&#x3D;templateName desc&#39; would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields: - affinityHostExtId - clusterName - compressionDelaySecs - containerExtId - erasureCode - name - replicationFactor

  • :select (String)

    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](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. - affinityHostExtId - cacheDeduplication - clusterExtId - clusterName - compressionDelaySecs - containerExtId - erasureCode - erasureCodeDelaySecs - extId - hasHigherEcFaultDomainPreference - isCompressionEnabled - isEncrypted - isInlineEcEnabled - isInternal - isMarkedForRemoval - isNfsWhitelistInherited - isSoftwareEncryptionEnabled - links - logicalAdvertisedCapacityBytes - logicalExplicitReservedCapacityBytes - logicalImplicitReservedCapacityBytes - markedForRemoval - maxCapacityBytes - name - nfsWhitelistAddress - onDiskDedup - ownerExtId - replicationFactor - storagePoolExtId - tenantId

Returns:



445
446
447
448
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 445

def list_storage_containers(opts = {})
  data, _status_code, _headers = list_storage_containers_with_http_info(opts)
  data
end

#list_storage_containers_with_http_info(opts = {}) ⇒ Array<(ListStorageContainers200Response, Integer, Hash)>

List Storage Containers Lists the Storage Containers available in the cluster. Note: The Storage Containers of PEs with versions prior to AOS 6.5 might have missing attribute data, and the PEs under the self-owned RBAC category might not be visible to non-admin users.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    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)

  • :limit (Integer)

    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)

  • :filter (String)

    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](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter &#39;$filter&#x3D;name eq &#39;karbon-ntnx-1.0&#39; would filter the result on cluster name &#39;karbon-ntnx1.0&#39;, filter &#39;$filter&#x3D;startswith(name, &#39;C&#39;)&#39; would filter on cluster name starting with &#39;C&#39;. The filter can be applied to the following fields: - affinityHostExtId - clusterExtId - clusterName - compressionDelaySecs - containerExtId - name - ownerExtId - replicationFactor - storagePoolExtId

  • :orderby (String)

    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, &#39;$orderby&#x3D;templateName desc&#39; would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields: - affinityHostExtId - clusterName - compressionDelaySecs - containerExtId - erasureCode - name - replicationFactor

  • :select (String)

    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](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. - affinityHostExtId - cacheDeduplication - clusterExtId - clusterName - compressionDelaySecs - containerExtId - erasureCode - erasureCodeDelaySecs - extId - hasHigherEcFaultDomainPreference - isCompressionEnabled - isEncrypted - isInlineEcEnabled - isInternal - isMarkedForRemoval - isNfsWhitelistInherited - isSoftwareEncryptionEnabled - links - logicalAdvertisedCapacityBytes - logicalExplicitReservedCapacityBytes - logicalImplicitReservedCapacityBytes - markedForRemoval - maxCapacityBytes - name - nfsWhitelistAddress - onDiskDedup - ownerExtId - replicationFactor - storagePoolExtId - tenantId

Returns:



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 459

def list_storage_containers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.list_storage_containers ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling StorageContainersApi.list_storage_containers, 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 StorageContainersApi.list_storage_containers, 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 StorageContainersApi.list_storage_containers, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers'

  # 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[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].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] || 'ListStorageContainers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.list_storage_containers",
    :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: StorageContainersApi#list_storage_containers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mount_storage_container(ext_id, clustermgmt_v40_config_data_store_mount, opts = {}) ⇒ MountStorageContainer202Response

Mount Storage Container on ESX datastore Mounts the Storage Container identified by external identifier on an ESX datastore. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • clustermgmt_v40_config_data_store_mount (ClustermgmtV40ConfigDataStoreMount)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



526
527
528
529
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 526

def mount_storage_container(ext_id, clustermgmt_v40_config_data_store_mount, opts = {})
  data, _status_code, _headers = mount_storage_container_with_http_info(ext_id, clustermgmt_v40_config_data_store_mount, opts)
  data
end

#mount_storage_container_with_http_info(ext_id, clustermgmt_v40_config_data_store_mount, opts = {}) ⇒ Array<(MountStorageContainer202Response, Integer, Hash)>

Mount Storage Container on ESX datastore Mounts the Storage Container identified by external identifier on an ESX datastore. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • clustermgmt_v40_config_data_store_mount (ClustermgmtV40ConfigDataStoreMount)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 537

def mount_storage_container_with_http_info(ext_id, clustermgmt_v40_config_data_store_mount, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.mount_storage_container ...'
  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 StorageContainersApi.mount_storage_container"
  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 StorageContainersApi.mount_storage_container, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'clustermgmt_v40_config_data_store_mount' is set
  if @api_client.config.client_side_validation && clustermgmt_v40_config_data_store_mount.nil?
    fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_data_store_mount' when calling StorageContainersApi.mount_storage_container"
  end
  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers/{extId}/$actions/mount'.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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(clustermgmt_v40_config_data_store_mount)

  # return_type
  return_type = opts[:debug_return_type] || 'MountStorageContainer202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.mount_storage_container",
    :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: StorageContainersApi#mount_storage_container\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unmount_storage_container(ext_id, clustermgmt_v40_config_data_store_unmount, opts = {}) ⇒ UnmountStorageContainer202Response

Unmount Storage Container from ESX datastore Unmounts the Storage Container identified by external identifier from the ESX datastore. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • clustermgmt_v40_config_data_store_unmount (ClustermgmtV40ConfigDataStoreUnmount)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



605
606
607
608
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 605

def unmount_storage_container(ext_id, clustermgmt_v40_config_data_store_unmount, opts = {})
  data, _status_code, _headers = unmount_storage_container_with_http_info(ext_id, clustermgmt_v40_config_data_store_unmount, opts)
  data
end

#unmount_storage_container_with_http_info(ext_id, clustermgmt_v40_config_data_store_unmount, opts = {}) ⇒ Array<(UnmountStorageContainer202Response, Integer, Hash)>

Unmount Storage Container from ESX datastore Unmounts the Storage Container identified by external identifier from the ESX datastore. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • clustermgmt_v40_config_data_store_unmount (ClustermgmtV40ConfigDataStoreUnmount)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 616

def unmount_storage_container_with_http_info(ext_id, clustermgmt_v40_config_data_store_unmount, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.unmount_storage_container ...'
  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 StorageContainersApi.unmount_storage_container"
  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 StorageContainersApi.unmount_storage_container, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'clustermgmt_v40_config_data_store_unmount' is set
  if @api_client.config.client_side_validation && clustermgmt_v40_config_data_store_unmount.nil?
    fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_data_store_unmount' when calling StorageContainersApi.unmount_storage_container"
  end
  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers/{extId}/$actions/unmount'.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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(clustermgmt_v40_config_data_store_unmount)

  # return_type
  return_type = opts[:debug_return_type] || 'UnmountStorageContainer202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.unmount_storage_container",
    :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: StorageContainersApi#unmount_storage_container\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_storage_container_by_id(ext_id, if_match, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {}) ⇒ UpdateStorageContainerById202Response

Update a Storage Container Updates the configuration of an existing Storage Container identified by external identifier. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided, the server will respond with an HTTP-428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow the successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP-412 (Precondition Failed) response will be returned.

  • 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.

  • clustermgmt_v40_config_storage_container (ClustermgmtV40ConfigStorageContainer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



686
687
688
689
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 686

def update_storage_container_by_id(ext_id, if_match, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {})
  data, _status_code, _headers = update_storage_container_by_id_with_http_info(ext_id, if_match, ntnx_request_id, clustermgmt_v40_config_storage_container, opts)
  data
end

#update_storage_container_by_id_with_http_info(ext_id, if_match, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {}) ⇒ Array<(UpdateStorageContainerById202Response, Integer, Hash)>

Update a Storage Container Updates the configuration of an existing Storage Container identified by external identifier. The location header received in the API response contains the URL of the task object, which can be used to further track the status of the request.

Parameters:

  • ext_id (String)

    The external identifier of the Storage Container.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided, the server will respond with an HTTP-428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow the successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP-412 (Precondition Failed) response will be returned.

  • 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.

  • clustermgmt_v40_config_storage_container (ClustermgmtV40ConfigStorageContainer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/nutanix_clustermgmt/api/storage_containers_api.rb', line 699

def update_storage_container_by_id_with_http_info(ext_id, if_match, ntnx_request_id, clustermgmt_v40_config_storage_container, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageContainersApi.update_storage_container_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 StorageContainersApi.update_storage_container_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 StorageContainersApi.update_storage_container_by_id, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling StorageContainersApi.update_storage_container_by_id"
  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 StorageContainersApi.update_storage_container_by_id"
  end
  # verify the required parameter 'clustermgmt_v40_config_storage_container' is set
  if @api_client.config.client_side_validation && clustermgmt_v40_config_storage_container.nil?
    fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_storage_container' when calling StorageContainersApi.update_storage_container_by_id"
  end
  # resource path
  local_var_path = '/clustermgmt/v4.0/config/storage-containers/{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']
  # 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[:'If-Match'] = if_match
  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_storage_container)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateStorageContainerById202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"StorageContainersApi.update_storage_container_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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageContainersApi#update_storage_container_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end