Class: OneviewSDK::StoragePool

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

Overview

Storage pool resource implementation

Constant Summary collapse

BASE_URI =
'/rest/storage-pools'.freeze

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, build_query, #create!, #each, #eql?, #exists?, find_by, from_file, get_all, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file

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.



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

def initialize(client, params = {}, api_ver = nil)
  super
  # Default values:
  @data['type'] ||= 'StoragePoolV2'
end

Instance Method Details

#addOneviewSDK::StoragePool

Note:

Calls the refresh method to set additional data

Add the resource on OneView using the current data

Returns:

Raises:



22
# File 'lib/oneview-sdk/resource/storage_pool.rb', line 22

alias add create

#createObject

Method is not available

Raises:



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

def create
  unavailable_method
end

#deleteObject

Method is not available

Raises:



46
47
48
# File 'lib/oneview-sdk/resource/storage_pool.rb', line 46

def delete
  unavailable_method
end

#removetrue

Remove resource from OneView

Returns:

  • (true)

    if resource was removed successfully



26
# File 'lib/oneview-sdk/resource/storage_pool.rb', line 26

alias remove delete

#set_storage_system(storage_system) ⇒ Object

Sets the storage system

Parameters:



58
59
60
61
# File 'lib/oneview-sdk/resource/storage_pool.rb', line 58

def set_storage_system(storage_system)
  fail IncompleteResource, 'Please set the storage system\'s uri attribute!' unless storage_system['uri']
  set('storageSystemUri', storage_system['uri'])
end

#updateObject

Method is not available

Raises:



52
53
54
# File 'lib/oneview-sdk/resource/storage_pool.rb', line 52

def update
  unavailable_method
end