Class: Delphix::Database
- Inherits:
-
Object
- Object
- Delphix::Database
- Includes:
- Base
- Defined in:
- lib/delphix/database.rb
Instance Attribute Summary
Attributes included from Base
Class Method Summary collapse
- .create_vdb(name, source_ref, group_ref, environment_ref, mount_base, port, params = {}) ⇒ Object
-
.list ⇒ Object
class methods.
Instance Method Summary collapse
-
#base_endpoint ⇒ Object
inherited operations.
-
#delete ⇒ Object
basic operations.
-
#initialize(reference, details = nil) ⇒ Database
constructor
A new instance of Database.
-
#start ⇒ Object
specific operations.
- #stop ⇒ Object
Methods included from Base
#name, #reference, #refresh_details, #to_s, #type
Constructor Details
#initialize(reference, details = nil) ⇒ Database
Returns a new instance of Database.
5 6 7 |
# File 'lib/delphix/database.rb', line 5 def initialize(reference, details=nil) super(reference, details) end |
Class Method Details
.create_vdb(name, source_ref, group_ref, environment_ref, mount_base, port, params = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/delphix/database.rb', line 42 def self.create_vdb(name, source_ref, group_ref, environment_ref, mount_base, port, params={}) body = { :type => 'MySQLProvisionParameters', :container => { :type => 'MySQLDatabaseContainer', :name => name, :group => group_ref, :sourcingPolicy => { :type => 'SourcingPolicy' } }, :source => { :type => 'MySQLVirtualSource', :mountBase => mount_base }, :sourceConfig => { :type => 'MySQLServerConfig', :port => port, :repository => environment_ref }, :timeflowPointParameters => { :type => 'TimeflowPointSemantic', :container => source_ref, :location => 'LATEST_SNAPSHOT' } } Delphix::Response.new( Delphix.post('/resources/json/delphix/database/provision', body.to_json)) end |
.list ⇒ Object
class methods
33 34 35 36 37 38 39 40 |
# File 'lib/delphix/database.rb', line 33 def self.list databases = Delphix::BaseArray.new result = Delphix.get('/resources/json/delphix/database')['result'] result.each do |db| databases << Delphix::Database.new(db['reference'],db) end databases end |
Instance Method Details
#base_endpoint ⇒ Object
inherited operations
27 28 29 |
# File 'lib/delphix/database.rb', line 27 def base_endpoint '/resources/json/delphix/database' end |
#delete ⇒ Object
basic operations
11 12 13 |
# File 'lib/delphix/database.rb', line 11 def delete Delphix::Response.new( Delphix.delete("#{base_endpoint}/#{reference}")) end |