Class: OneviewSDK::API500::C7000::StoragePool

Inherits:
Resource show all
Defined in:
lib/oneview-sdk/resource/api500/c7000/storage_pool.rb

Overview

Storage pool resource implementation for API500 C7000

Direct Known Subclasses

Synergy::StoragePool

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

Instance Method Summary collapse

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.

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

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

    The options for this resource (key-value pairs)

  • api_ver (Integer) (defaults to: nil)

    The api version to use when interracting with this resource.



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.

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • networks (Array<Resource>) (defaults to: [])

    The list of networks with URI to be used as a filter

Returns:

  • (Array<OneviewSDK::StoragePool>)

    the list of storage pools



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

#createObject

Method is not available

Raises:



33
34
35
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 33

def create(*)
  unavailable_method
end

#deleteObject

Method is not available

Raises:



39
40
41
# File 'lib/oneview-sdk/resource/api500/c7000/storage_pool.rb', line 39

def delete(*)
  unavailable_method
end

#manage(be_managed) ⇒ Object

Note:

Storage Pool that belongs to Storage System with family StoreVirtual can’t be changed to unmanaged

To manage/unmanage a storage pool

Parameters:

  • be_managed (Boolean)

    Set true to manage or false to unmanage



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_refreshObject

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