Class: MMS::Agent
- Inherits:
-
Object
- Object
- MMS::Agent
- Defined in:
- lib/mms/agent.rb
Instance Method Summary collapse
- #clusters ⇒ Object
- #findGroup(id) ⇒ Object
- #groups ⇒ Object
-
#initialize(username, apikey) ⇒ Agent
constructor
A new instance of Agent.
- #restorejobs ⇒ Object
- #restorejobs_create(group_id, cluster_id, snapshot_id) ⇒ Object
- #snapshots ⇒ Object
Constructor Details
Instance Method Details
#clusters ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/mms/agent.rb', line 17 def clusters cluster_list = [] groups.each do |group| cluster_list.concat group.clusters end cluster_list end |
#findGroup(id) ⇒ Object
45 46 47 |
# File 'lib/mms/agent.rb', line 45 def findGroup(id) MMS::Resource::Group.new id end |
#groups ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/mms/agent.rb', line 9 def groups group_list = [] MMS::Client.instance.get('/groups').each do |group| group_list.push MMS::Resource::Group.new group['id'], group end group_list end |
#restorejobs ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/mms/agent.rb', line 33 def restorejobs restorejob_list = [] clusters.each do |cluster| restorejob_list.concat cluster.restorejobs end restorejob_list end |
#restorejobs_create(group_id, cluster_id, snapshot_id) ⇒ Object
41 42 43 |
# File 'lib/mms/agent.rb', line 41 def restorejobs_create(group_id, cluster_id, snapshot_id) findGroup(group_id).cluster(cluster_id).snapshot(snapshot_id).create_restorejob end |
#snapshots ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/mms/agent.rb', line 25 def snapshots snapshot_list = [] clusters.each do |cluster| snapshot_list.concat cluster.snapshots end snapshot_list end |