Class: OneviewSDK::VolumeSnapshot

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

Overview

Volume snapshot resource implementation

Constant Summary collapse

BASE_URI =
nil

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, build_query, #create!, #delete, #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) ⇒ VolumeSnapshot

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.



21
22
23
24
25
# File 'lib/oneview-sdk/resource/volume_snapshot.rb', line 21

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

Instance Method Details

#createObject

Method is not available

Raises:



29
30
31
# File 'lib/oneview-sdk/resource/volume_snapshot.rb', line 29

def create
  unavailable_method
end

#set_volume(volume) ⇒ Object

Sets the volume

Parameters:



41
42
43
44
# File 'lib/oneview-sdk/resource/volume_snapshot.rb', line 41

def set_volume(volume)
  volume.retrieve! unless volume['uri']
  @data['storageVolumeUri'] = volume['uri']
end

#updateObject

Method is not available

Raises:



35
36
37
# File 'lib/oneview-sdk/resource/volume_snapshot.rb', line 35

def update
  unavailable_method
end