Class: Delphix::Source

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/delphix/source.rb

Instance Attribute Summary

Attributes included from Base

#details

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#name, #reference, #refresh_details, #to_s, #type

Constructor Details

#initialize(reference, details = nil) ⇒ Source

Returns a new instance of Source.



5
6
7
# File 'lib/delphix/source.rb', line 5

def initialize(reference, details=nil)
  super(reference, details)
end

Class Method Details

.listObject

class methods



40
41
42
43
44
45
46
47
# File 'lib/delphix/source.rb', line 40

def self.list
  sources = Delphix::BaseArray.new
  result = Delphix.get('/resources/json/delphix/source')['result']
  result.each do |src|
    sources << Delphix::Source.new(src['reference'],src)
  end
  sources
end

Instance Method Details

#base_endpointObject

inherited operations



34
35
36
# File 'lib/delphix/source.rb', line 34

def base_endpoint
  '/resources/json/delphix/source'
end

#disableObject



24
25
26
# File 'lib/delphix/source.rb', line 24

def disable
  Delphix::Response.new( Delphix.post("#{base_endpoint}/#{reference}/disable"))
end

#enableObject



20
21
22
# File 'lib/delphix/source.rb', line 20

def enable
  Delphix::Response.new( Delphix.post("#{base_endpoint}/#{reference}/enable"))
end

#startObject

specific operations



12
13
14
# File 'lib/delphix/source.rb', line 12

def start
  Delphix::Response.new( Delphix.post("#{base_endpoint}/#{reference}/start"))
end

#stopObject



16
17
18
# File 'lib/delphix/source.rb', line 16

def stop
  Delphix::Response.new( Delphix.post("#{base_endpoint}/#{reference}/stop"))
end

#virtual?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/delphix/source.rb', line 28

def virtual?
  @details['virtual'] == true
end