Class: RMC::Item::SnapshotSet
- Inherits:
-
Object
- Object
- RMC::Item::SnapshotSet
- Defined in:
- lib/rmc/item/snapshot_set.rb
Instance Attribute Summary collapse
-
#appType ⇒ Object
readonly
Returns the value of attribute appType.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#createdAt ⇒ Object
readonly
Returns the value of attribute createdAt.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#recoverySetId ⇒ Object
readonly
Returns the value of attribute recoverySetId.
-
#snapExpiry ⇒ Object
readonly
Returns the value of attribute snapExpiry.
-
#snapRetention ⇒ Object
readonly
Returns the value of attribute snapRetention.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(connection, data) ⇒ SnapshotSet
constructor
A new instance of SnapshotSet.
- #refresh ⇒ Object
- #restore(volume_list) ⇒ Object
- #update(data) ⇒ Object
Constructor Details
#initialize(connection, data) ⇒ SnapshotSet
Returns a new instance of SnapshotSet.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rmc/item/snapshot_set.rb', line 19 def initialize(connection, data) @connection = connection @id = data['id'] @name = data['name'] @status = data['status'] @createdAt = data['createdAt'] @appType = data['appType'] @recoverySetId = data['recoverySetId'] @snapExpiry = data['snapExpiry'] @snapRetention = data['snapRetention'] end |
Instance Attribute Details
#appType ⇒ Object (readonly)
Returns the value of attribute appType.
13 14 15 |
# File 'lib/rmc/item/snapshot_set.rb', line 13 def appType @appType end |
#connection ⇒ Object
Returns the value of attribute connection.
6 7 8 |
# File 'lib/rmc/item/snapshot_set.rb', line 6 def connection @connection end |
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
11 12 13 |
# File 'lib/rmc/item/snapshot_set.rb', line 11 def createdAt @createdAt end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/rmc/item/snapshot_set.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/rmc/item/snapshot_set.rb', line 9 def name @name end |
#recoverySetId ⇒ Object (readonly)
Returns the value of attribute recoverySetId.
14 15 16 |
# File 'lib/rmc/item/snapshot_set.rb', line 14 def recoverySetId @recoverySetId end |
#snapExpiry ⇒ Object (readonly)
Returns the value of attribute snapExpiry.
16 17 18 |
# File 'lib/rmc/item/snapshot_set.rb', line 16 def snapExpiry @snapExpiry end |
#snapRetention ⇒ Object (readonly)
Returns the value of attribute snapRetention.
17 18 19 |
# File 'lib/rmc/item/snapshot_set.rb', line 17 def snapRetention @snapRetention end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/rmc/item/snapshot_set.rb', line 10 def status @status end |
Instance Method Details
#delete ⇒ Object
72 73 74 75 76 77 |
# File 'lib/rmc/item/snapshot_set.rb', line 72 def delete @connection.request( :url => "/snapshot-sets/#{@id}", :method => :delete, ) end |
#refresh ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rmc/item/snapshot_set.rb', line 44 def refresh response = @connection.request( url: "/snapshot-sets/#{@id}/refresh", method: :put, payload: { snapshotSet: {} } ) @connection.wait_for_task(response['taskUri'].split('/').last) true end |
#restore(volume_list) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rmc/item/snapshot_set.rb', line 56 def restore(volume_list) response = @connection.request( :url => "/snapshot-sets/#{@id}/restore", :method => :post, :payload => { snapshotSet: { online: true, volumelist: [volume_list.join(", ")] } } ) @connection.wait_for_task(response['taskUri'].split('/').last) true end |
#update(data) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/rmc/item/snapshot_set.rb', line 34 def update(data) @connection.request( :url => "/snapshot-sets/#{@id}", :method => :put, :payload => { snapshotSet: data } ) end |