Class: Delphix::Repository
- Inherits:
-
Object
- Object
- Delphix::Repository
- Includes:
- Base
- Defined in:
- lib/delphix/repository.rb
Instance Attribute Summary
Attributes included from Base
Class Method Summary collapse
-
.list ⇒ Object
class methods.
Instance Method Summary collapse
- #base_endpoint ⇒ Object
-
#initialize(reference, details = nil) ⇒ Repository
constructor
A new instance of Repository.
- #provisioning!(provisioning) ⇒ Object
-
#provisioning? ⇒ Boolean
specific operations.
-
#refresh_details ⇒ Object
inherited operations.
- #staging!(staging) ⇒ Object
- #staging? ⇒ Boolean
Methods included from Base
#name, #reference, #to_s, #type
Constructor Details
#initialize(reference, details = nil) ⇒ Repository
Returns a new instance of Repository.
5 6 7 |
# File 'lib/delphix/repository.rb', line 5 def initialize(reference, details=nil) super(reference, details) end |
Class Method Details
.list ⇒ Object
class methods
54 55 56 57 58 59 60 61 |
# File 'lib/delphix/repository.rb', line 54 def self.list repos = Delphix::BaseArray.new result = Delphix.get('/resources/json/delphix/repository')['result'] result.each do |repo| repos << Delphix::Repository.new(repo['reference'],repo) end repos end |
Instance Method Details
#base_endpoint ⇒ Object
48 49 50 |
# File 'lib/delphix/repository.rb', line 48 def base_endpoint '/resources/json/delphix/repository' end |
#provisioning!(provisioning) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/delphix/repository.rb', line 16 def provisioning!(provisioning) return if provisioning? == provisioning body = { :type => type, :provisioningEnabled => provisioning } Delphix.post("#{base_endpoint}/#{reference}", body.to_json) # TODO error handling on wait for completion! refresh_details end |
#provisioning? ⇒ Boolean
specific operations
12 13 14 |
# File 'lib/delphix/repository.rb', line 12 def provisioning? @details['provisioningEnabled'] == true end |
#refresh_details ⇒ Object
inherited operations
44 45 46 |
# File 'lib/delphix/repository.rb', line 44 def refresh_details @details = Delphix.get("#{base_endpoint}/#{reference}")['result'] end |
#staging!(staging) ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/delphix/repository.rb', line 31 def staging!(staging) return if staging? == staging body = { :type => type, :staging => staging } Delphix.post("#{base_endpoint}/#{reference}", body.to_json) # TODO error handling on wait for completion! refresh_details end |
#staging? ⇒ Boolean
27 28 29 |
# File 'lib/delphix/repository.rb', line 27 def staging? @details['staging'] == true end |