Class: NutanixClustermgmt::DisksApi
- Inherits:
-
Object
- Object
- NutanixClustermgmt::DisksApi
- Defined in:
- lib/nutanix_clustermgmt/api/disks_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_disk(ext_id, clustermgmt_v40_config_disk_addition_spec, opts = {}) ⇒ AddDisk202Response
Adds Disk to a cluster Repartitions and adds the Disk to a cluster, or adds an old Disk again to a cluster that is marked for removal.
-
#add_disk_with_http_info(ext_id, clustermgmt_v40_config_disk_addition_spec, opts = {}) ⇒ Array<(AddDisk202Response, Integer, Hash)>
Adds Disk to a cluster Repartitions and adds the Disk to a cluster, or adds an old Disk again to a cluster that is marked for removal.
-
#delete_disk_by_id(ext_id, opts = {}) ⇒ DeleteDiskById202Response
Removes Disk from a cluster Marks Disk identified by external identifier for removal.
-
#delete_disk_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(DeleteDiskById202Response, Integer, Hash)>
Removes Disk from a cluster Marks Disk identified by external identifier for removal.
-
#get_disk_by_id(ext_id, opts = {}) ⇒ GetDiskById200Response
Get Disk by its external identifier Fetch the details of the Disk identified by external identifier.
-
#get_disk_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetDiskById200Response, Integer, Hash)>
Get Disk by its external identifier Fetch the details of the Disk identified by external identifier.
-
#get_disk_stats(ext_id, start_time, end_time, opts = {}) ⇒ GetDiskStats200Response
Get stats for the existing Disk Fetch the stats information of the Disk identified by external identifier.
-
#get_disk_stats_with_http_info(ext_id, start_time, end_time, opts = {}) ⇒ Array<(GetDiskStats200Response, Integer, Hash)>
Get stats for the existing Disk Fetch the stats information of the Disk identified by external identifier.
-
#initialize(api_client = ApiClient.default) ⇒ DisksApi
constructor
A new instance of DisksApi.
-
#list_disks(opts = {}) ⇒ ListDisks200Response
Get Disks for all the clusters Fetches Disk details from all clusters registered with Prism Central.
-
#list_disks_with_http_info(opts = {}) ⇒ Array<(ListDisks200Response, Integer, Hash)>
Get Disks for all the clusters Fetches Disk details from all clusters registered with Prism Central.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_disk(ext_id, clustermgmt_v40_config_disk_addition_spec, opts = {}) ⇒ AddDisk202Response
Adds Disk to a cluster Repartitions and adds the Disk to a cluster, or adds an old Disk again to a cluster that is marked for removal.
28 29 30 31 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 28 def add_disk(ext_id, clustermgmt_v40_config_disk_addition_spec, opts = {}) data, _status_code, _headers = add_disk_with_http_info(ext_id, clustermgmt_v40_config_disk_addition_spec, opts) data end |
#add_disk_with_http_info(ext_id, clustermgmt_v40_config_disk_addition_spec, opts = {}) ⇒ Array<(AddDisk202Response, Integer, Hash)>
Adds Disk to a cluster Repartitions and adds the Disk to a cluster, or adds an old Disk again to a cluster that is marked for removal.
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 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 39 def add_disk_with_http_info(ext_id, clustermgmt_v40_config_disk_addition_spec, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisksApi.add_disk ...' 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 DisksApi.add_disk" 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 DisksApi.add_disk, must conform to the pattern #{pattern}." end # verify the required parameter 'clustermgmt_v40_config_disk_addition_spec' is set if @api_client.config.client_side_validation && clustermgmt_v40_config_disk_addition_spec.nil? fail ArgumentError, "Missing the required parameter 'clustermgmt_v40_config_disk_addition_spec' when calling DisksApi.add_disk" end # resource path local_var_path = '/clustermgmt/v4.0/config/clusters/{extId}/$actions/add-disk'.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_disk_addition_spec) # return_type return_type = opts[:debug_return_type] || 'AddDisk202Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"DisksApi.add_disk", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisksApi#add_disk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_disk_by_id(ext_id, opts = {}) ⇒ DeleteDiskById202Response
Removes Disk from a cluster Marks Disk identified by external identifier for removal.
106 107 108 109 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 106 def delete_disk_by_id(ext_id, opts = {}) data, _status_code, _headers = delete_disk_by_id_with_http_info(ext_id, opts) data end |
#delete_disk_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(DeleteDiskById202Response, Integer, Hash)>
Removes Disk from a cluster Marks Disk identified by external identifier for removal.
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 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 116 def delete_disk_by_id_with_http_info(ext_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisksApi.delete_disk_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 DisksApi.delete_disk_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 DisksApi.delete_disk_by_id, must conform to the pattern #{pattern}." end # resource path local_var_path = '/clustermgmt/v4.0/config/disks/{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] || 'DeleteDiskById202Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"DisksApi.delete_disk_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisksApi#delete_disk_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_disk_by_id(ext_id, opts = {}) ⇒ GetDiskById200Response
Get Disk by its external identifier Fetch the details of the Disk identified by external identifier.
174 175 176 177 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 174 def get_disk_by_id(ext_id, opts = {}) data, _status_code, _headers = get_disk_by_id_with_http_info(ext_id, opts) data end |
#get_disk_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetDiskById200Response, Integer, Hash)>
Get Disk by its external identifier Fetch the details of the Disk identified by external identifier.
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 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 184 def get_disk_by_id_with_http_info(ext_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisksApi.get_disk_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 DisksApi.get_disk_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 DisksApi.get_disk_by_id, must conform to the pattern #{pattern}." end # resource path local_var_path = '/clustermgmt/v4.0/config/disks/{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] || 'GetDiskById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"DisksApi.get_disk_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisksApi#get_disk_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_disk_stats(ext_id, start_time, end_time, opts = {}) ⇒ GetDiskStats200Response
Get stats for the existing Disk Fetch the stats information of the Disk identified by external identifier.
246 247 248 249 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 246 def get_disk_stats(ext_id, start_time, end_time, opts = {}) data, _status_code, _headers = get_disk_stats_with_http_info(ext_id, start_time, end_time, opts) data end |
#get_disk_stats_with_http_info(ext_id, start_time, end_time, opts = {}) ⇒ Array<(GetDiskStats200Response, Integer, Hash)>
Get stats for the existing Disk Fetch the stats information of the Disk identified by external identifier.
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 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 260 def get_disk_stats_with_http_info(ext_id, start_time, end_time, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisksApi.get_disk_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 DisksApi.get_disk_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 DisksApi.get_disk_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 DisksApi.get_disk_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 DisksApi.get_disk_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 DisksApi.get_disk_stats, must be greater than or equal to 1.' end # resource path local_var_path = '/clustermgmt/v4.0/stats/disks/{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] || 'GetDiskStats200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"DisksApi.get_disk_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisksApi#get_disk_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_disks(opts = {}) ⇒ ListDisks200Response
Get Disks for all the clusters Fetches Disk details from all clusters registered with Prism Central.
339 340 341 342 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 339 def list_disks(opts = {}) data, _status_code, _headers = list_disks_with_http_info(opts) data end |
#list_disks_with_http_info(opts = {}) ⇒ Array<(ListDisks200Response, Integer, Hash)>
Get Disks for all the clusters Fetches Disk details from all clusters registered with Prism Central.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 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 |
# File 'lib/nutanix_clustermgmt/api/disks_api.rb', line 354 def list_disks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisksApi.list_disks ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DisksApi.list_disks, 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 DisksApi.list_disks, 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 DisksApi.list_disks, must be greater than or equal to 1.' end # resource path local_var_path = '/clustermgmt/v4.0/config/disks' # 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[:'$apply'] = opts[:'apply'] if !opts[:'apply'].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] || 'ListDisks200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"DisksApi.list_disks", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisksApi#list_disks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |