Module: Kitchen::Driver::Oci::Instance::DbaasLaunchDetails
Overview
setter methods that populate the details of OCI::Database::Models::LaunchDbSystemDetails
Instance Method Summary
collapse
#database, #db_home_display_name, #db_version
#admin_password, #character_set, #db_backup_config, #db_name, #db_workload, #ncharacter_set, #pdb_name
Instance Method Details
#cluster_name ⇒ Object
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 87
def cluster_name
prefix = config[:hostname_prefix].split("-")[0]
cn = if prefix.length >= 11
prefix[0, 11]
else
[prefix, random_string(10 - prefix.length)].compact.join("-")
end
launch_details.cluster_name = cn
end
|
#cpu_core_count ⇒ Object
69
70
71
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 69
def cpu_core_count
launch_details.cpu_core_count = config[:dbaas][:cpu_core_count] ||= 2
end
|
#database_edition ⇒ Object
82
83
84
85
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 82
def database_edition
db_edition = config[:dbaas][:database_edition] ||= OCI::Database::Models::DbSystem::DATABASE_EDITION_ENTERPRISE_EDITION
launch_details.database_edition = db_edition
end
|
#db_home ⇒ Object
TODO: add support for the #domain property
add support for #database_software_image_id property
34
35
36
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 34
def db_home
launch_details.db_home = db_home_details
end
|
#display_name ⇒ Object
54
55
56
57
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 54
def display_name
launch_details.display_name = [config[:hostname_prefix], random_string(4), random_number(2)].compact.join("-")
end
|
#hostname ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 46
def hostname
long_name = [hostname_prefix, long_hostname_suffix].compact.join("-")
trimmed_name = [hostname_prefix[0, 12], random_string(3)].compact.join("-")
launch_details.hostname = [long_name, trimmed_name].min { |l, t| l.size <=> t.size }
end
|
#initial_data_storage_size_in_gb ⇒ Object
78
79
80
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 78
def initial_data_storage_size_in_gb
launch_details.initial_data_storage_size_in_gb = config[:dbaas][:initial_data_storage_size_in_gb] ||= 256
end
|
#license_model ⇒ Object
73
74
75
76
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 73
def license_model
license = config[:dbaas][:license_model] ||= OCI::Database::Models::DbSystem::LICENSE_MODEL_BRING_YOUR_OWN_LICENSE
launch_details.license_model = license
end
|
#node_count ⇒ Object
59
60
61
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 59
def node_count
launch_details.node_count = 1
end
|
#nsg_ids ⇒ Object
42
43
44
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 42
def nsg_ids
launch_details.nsg_ids = config[:nsg_ids]
end
|
#pubkey ⇒ Object
63
64
65
66
67
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 63
def pubkey
result = []
result << File.readlines(config[:ssh_keypath]).first.chomp
launch_details.ssh_public_keys = result
end
|
#subnet_id ⇒ Object
38
39
40
|
# File 'lib/kitchen/driver/oci/instance/dbaas.rb', line 38
def subnet_id
launch_details.subnet_id = config[:subnet_id]
end
|