Class: OneviewSDK::API200::VolumeAttachment
- Defined in:
- lib/oneview-sdk/resource/api200/volume_attachment.rb
Overview
Storage volume attachment resource implementation
Direct Known Subclasses
OneviewSDK::API300::C7000::VolumeAttachment, OneviewSDK::API300::Synergy::VolumeAttachment
Constant Summary collapse
- BASE_URI =
'/rest/storage-volume-attachments'.freeze
Constants inherited from Resource
Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS
Instance Attribute Summary
Attributes inherited from Resource
#api_version, #client, #data, #logger
Class Method Summary collapse
-
.get_extra_unmanaged_volumes(client) ⇒ Array
Gets the list of extra unmanaged storage volumes.
-
.remove_extra_unmanaged_volume(client, resource) ⇒ Object
Removes extra presentations from a specific server profile.
Instance Method Summary collapse
-
#create ⇒ Object
Method is not available.
-
#delete ⇒ Object
Method is not available.
-
#get_path(id) ⇒ OneviewSDK::VolumeAttachmentPath
Gets a volume attachment path by id.
-
#get_paths ⇒ Array
Gets all volume attachment paths.
-
#initialize(client, params = {}, api_ver = nil) ⇒ VolumeAttachment
constructor
Create a resource object, associate it with a client, and set its properties.
-
#update ⇒ Object
Method is not available.
Methods inherited from Resource
#==, #[], #[]=, build_query, #create!, #deep_merge!, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, get_all_with_query, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file
Constructor Details
#initialize(client, params = {}, api_ver = nil) ⇒ VolumeAttachment
Create a resource object, associate it with a client, and set its properties.
24 25 26 27 28 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 24 def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] ||= 'StorageVolumeAttachment' end |
Class Method Details
.get_extra_unmanaged_volumes(client) ⇒ Array
Gets the list of extra unmanaged storage volumes
51 52 53 54 55 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 51 def self.get_extra_unmanaged_volumes(client) response = client.rest_get(BASE_URI + '/repair?alertFixType=ExtraUnmanagedStorageVolumes') body = client.response_handler(response) body['members'].map { |data| new(client, data) } end |
.remove_extra_unmanaged_volume(client, resource) ⇒ Object
Removes extra presentations from a specific server profile
60 61 62 63 64 65 66 67 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 60 def self.remove_extra_unmanaged_volume(client, resource) requestBody = { type: 'ExtraUnmanagedStorageVolumes', resourceUri: resource['uri'] } response = client.rest_post(BASE_URI + '/repair', { 'Accept-Language' => 'en_US', 'body' => requestBody }, client.api_version) client.response_handler(response) end |
Instance Method Details
#create ⇒ Object
Method is not available
32 33 34 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 32 def create(*) unavailable_method end |
#delete ⇒ Object
Method is not available
44 45 46 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 44 def delete(*) unavailable_method end |
#get_path(id) ⇒ OneviewSDK::VolumeAttachmentPath
Gets a volume attachment path by id
79 80 81 82 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 79 def get_path(id) response = @client.rest_get("#{@data['uri']}/paths/#{id}") @client.response_handler(response) end |
#get_paths ⇒ Array
Gets all volume attachment paths
71 72 73 74 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 71 def get_paths response = @client.rest_get(@data['uri'] + '/paths') @client.response_handler(response) end |
#update ⇒ Object
Method is not available
38 39 40 |
# File 'lib/oneview-sdk/resource/api200/volume_attachment.rb', line 38 def update(*) unavailable_method end |