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
#delphix_delete, #delphix_get, #delphix_post, #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
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/delphix/group.rb', line 27 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
43 44 45 46 47 48 49 50 |
# File 'lib/delphix/group.rb', line 43 def self.list groups = Delphix::BaseArray.new result = Delphix.get('/resources/json/delphix/group', nil)['result'] result.each do |group| groups << Delphix::Group.new(group['reference'],group) end groups end |
Instance Method Details
#base_endpoint ⇒ Object
21 22 23 |
# File 'lib/delphix/group.rb', line 21 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}", nil)['result'] end |
#refresh_details ⇒ Object
inherited operations
17 18 19 |
# File 'lib/delphix/group.rb', line 17 def refresh_details @details = delphix_get("#{base_endpoint}/#{reference}", nil)['result'] end |