Class: OneviewSDK::API500::C7000::StoragePool
- Inherits:
-
Resource
- Object
- Resource
- OneviewSDK::API300::C7000::Resource
- Resource
- OneviewSDK::API500::C7000::StoragePool
- Defined in:
- lib/oneview-sdk/resource/api500/c7000/storage_pool.rb
Overview
Storage pool resource implementation for API500 C7000
Direct Known Subclasses
Constant Summary collapse
- BASE_URI =
'/rest/storage-pools'.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
-
.reachable(client, networks = []) ⇒ Array<OneviewSDK::StoragePool>
Gets the storage pools that are connected on the specified networks based on the storage system port’s expected network connectivity.
Instance Method Summary collapse
-
#create ⇒ Object
Method is not available.
-
#delete ⇒ Object
Method is not available.
-
#initialize(client, params = {}, api_ver = nil) ⇒ StoragePool
constructor
Create a resource object, associate it with a client, and set its properties.
-
#manage(be_managed) ⇒ Object
To manage/unmanage a storage pool.
-
#request_refresh ⇒ Object
To request a refresh of a storage pool.
Methods inherited from Resource
#==, #[], #[]=, build_query, #create!, #deep_merge!, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file, #update
Constructor Details
#initialize(client, params = {}, api_ver = nil) ⇒ StoragePool
Create a resource object, associate it with a client, and set its properties.
25 26 27 28 29 |
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 25 def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] ||= 'StoragePoolV3' end |
Class Method Details
.reachable(client, networks = []) ⇒ Array<OneviewSDK::StoragePool>
Gets the storage pools that are connected on the specified networks based on the storage system port’s expected network connectivity.
47 48 49 50 51 52 53 54 |
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 47 def self.reachable(client, networks = []) uri = self::BASE_URI + '/reachable-storage-pools' unless networks.empty? network_uris = networks.map { |item| item['uri'] } uri += "?networks='#{network_uris.join(',')}'" end find_with_pagination(client, uri) end |
Instance Method Details
#create ⇒ Object
Method is not available
33 34 35 |
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 33 def create(*) unavailable_method end |
#delete ⇒ Object
Method is not available
39 40 41 |
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 39 def delete(*) unavailable_method end |
#manage(be_managed) ⇒ Object
Storage Pool that belongs to Storage System with family StoreVirtual can’t be changed to unmanaged
To manage/unmanage a storage pool
59 60 61 62 63 64 65 66 |
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 59 def manage(be_managed) if !be_managed && self['family'] == 'StoreVirtual' raise ArgumentError, 'Attempting to unmanage a StoreVirtual pool is not allowed' end self['isManaged'] = be_managed update refresh end |
#request_refresh ⇒ Object
To request a refresh of a storage pool
69 70 71 72 73 |
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 69 def request_refresh self['requestingRefresh'] = true update refresh end |