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
inherited operations.
-
#delete ⇒ Object
basic operations.
-
#initialize(reference, details = nil) ⇒ Group
constructor
A new instance of Group.
Methods included from Base
#name, #reference, #refresh_details, #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
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/delphix/group.rb', line 25 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
41 42 43 44 45 46 47 48 |
# File 'lib/delphix/group.rb', line 41 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
inherited operations
19 20 21 |
# File 'lib/delphix/group.rb', line 19 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::Response.new( Delphix.delete("#{base_endpoint}/#{reference}")) end |