Class: Delphix::VDB

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

Instance Attribute Summary

Attributes included from Base

#details

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#delphix_delete, #delphix_get, #delphix_post, #name, #reference, #to_s, #type

Constructor Details

#initialize(reference, details = nil) ⇒ VDB

Returns a new instance of VDB.



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

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

Class Method Details

.create(name, source_ref, group_ref, environment_ref, mount_base, port, params = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/delphix/vdb.rb', line 25

def self.create(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'
    }
  }

  response = Delphix.post('/resources/json/delphix/database/provision', body.to_json)
  response
end

Instance Method Details

#base_endpointObject



21
22
23
# File 'lib/delphix/vdb.rb', line 21

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

#deleteObject

basic operations



11
12
13
# File 'lib/delphix/vdb.rb', line 11

def delete

end

#refresh_detailsObject

inherited operations



17
18
19
# File 'lib/delphix/vdb.rb', line 17

def refresh_details
  @details = delphix_get("#{base_endpoint}/#{reference}", nil)['result']
end