Class: RMC::Item::ExpressProtect
- Inherits:
-
Object
- Object
- RMC::Item::ExpressProtect
- Defined in:
- lib/rmc/item/express_protect.rb
Instance Attribute Summary collapse
-
#backups ⇒ Object
readonly
Returns the value of attribute backups.
-
#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.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(connection, data) ⇒ ExpressProtect
constructor
A new instance of ExpressProtect.
- #restore_to_parent_volumes ⇒ Object
- #restore_to_recovery_set(id) ⇒ Object
- #update(data) ⇒ Object
Constructor Details
#initialize(connection, data) ⇒ ExpressProtect
Returns a new instance of ExpressProtect.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rmc/item/express_protect.rb', line 15 def initialize(connection, data) @connection = connection @id = data['id'] @name = data['name'] @status = data['status'] @backups = data['backups'] @createdAt = data['createdAt'] @recoverySetId = data['recoverySetId'] end |
Instance Attribute Details
#backups ⇒ Object (readonly)
Returns the value of attribute backups.
11 12 13 |
# File 'lib/rmc/item/express_protect.rb', line 11 def backups @backups end |
#connection ⇒ Object
Returns the value of attribute connection.
6 7 8 |
# File 'lib/rmc/item/express_protect.rb', line 6 def connection @connection end |
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
12 13 14 |
# File 'lib/rmc/item/express_protect.rb', line 12 def createdAt @createdAt end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/rmc/item/express_protect.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/rmc/item/express_protect.rb', line 9 def name @name end |
#recoverySetId ⇒ Object (readonly)
Returns the value of attribute recoverySetId.
13 14 15 |
# File 'lib/rmc/item/express_protect.rb', line 13 def recoverySetId @recoverySetId end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/rmc/item/express_protect.rb', line 10 def status @status end |
Instance Method Details
#delete ⇒ Object
37 38 39 40 41 42 |
# File 'lib/rmc/item/express_protect.rb', line 37 def delete @connection.request( :url => "/backup-sets/#{@id}", :method => :delete, ) end |
#restore_to_parent_volumes ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/rmc/item/express_protect.rb', line 44 def restore_to_parent_volumes response = @connection.request( :url => "/backup-sets/#{@id}/restore", :method => :post ) @connection.wait_for_task(response['taskUri'].split('/').last) end |
#restore_to_recovery_set(id) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/rmc/item/express_protect.rb', line 53 def restore_to_recovery_set(id) response = @connection.request( :url => "/backup-sets/#{@id}/restore", :payload => { backupSet: { restoreRecoverysetId: id } }, :method => :post ) @connection.wait_for_task(response['taskUri'].split('/').last) end |
#update(data) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/rmc/item/express_protect.rb', line 27 def update(data) @connection.request( :url => "/backup-sets/#{@id}", :method => :put, :payload => { backupSet: data } ) end |