Class: Delphix::Group
Instance Attribute Summary
Attributes included from Base
Class Method Summary collapse
-
.create(name) ⇒ Object
class methods.
- .list ⇒ Object
Instance Method Summary collapse
- #base_endpoint ⇒ Object
-
#delete ⇒ Object
basic operations.
-
#initialize(reference, details = nil) ⇒ Group
constructor
A new instance of Group.
-
#refresh_details ⇒ Object
inherited operations.
Methods included from Base
#name, #reference, #to_s, #type
Constructor Details
#initialize(reference, details = nil) ⇒ Group
Returns a new instance of Group.
5 6 7 |
# File 'lib/delphix/group.rb', line 5 def initialize(reference, details=nil) super(reference, details) end |
Class Method Details
.create(name) ⇒ Object
class methods
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/delphix/group.rb', line 29 def self.create(name) body = { :type => 'Group', :name => name } ref = Delphix.post('/resources/json/delphix/group', body.to_json)['result'] # create a new skeleton group object group = Delphix::Group.new ref # refresh the object from DE group.refresh_details group end |
.list ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/delphix/group.rb', line 45 def self.list groups = Delphix::BaseArray.new result = Delphix.get('/resources/json/delphix/group')['result'] result.each do |group| groups << Delphix::Group.new(group['reference'],group) end groups end |
Instance Method Details
#base_endpoint ⇒ Object
23 24 25 |
# File 'lib/delphix/group.rb', line 23 def base_endpoint '/resources/json/delphix/group' end |
#delete ⇒ Object
basic operations
11 12 13 |
# File 'lib/delphix/group.rb', line 11 def delete Delphix.delete("#{base_endpoint}/#{reference}")['result'] end |
#refresh_details ⇒ Object
inherited operations
19 20 21 |
# File 'lib/delphix/group.rb', line 19 def refresh_details @details = Delphix.get("#{base_endpoint}/#{reference}")['result'] end |