Class: Kitchen::Driver::Oci::Models::Dbaas
- Inherits:
-
Instance
- Object
- Base
- Kitchen::Driver::Oci
- Instance
- Kitchen::Driver::Oci::Models::Dbaas
- Includes:
- DbaasLaunchDetails
- Defined in:
- lib/kitchen/driver/oci/models/dbaas.rb
Overview
dbaas model
Instance Attribute Summary collapse
-
#database_details ⇒ OCI::Database::Models::CreateDatabaseDetails
The details model that describes the database.
-
#db_home_details ⇒ OCI::Database::Models::CreateDbHomeDetails
The details model that describes the database home.
-
#launch_details ⇒ OCI::Database::Models::LaunchDbSystemDetails
The details model that describes the db system.
Attributes inherited from Instance
Instance Method Summary collapse
-
#initialize(config, state, oci, api, action) ⇒ Dbaas
constructor
A new instance of Dbaas.
- #launch ⇒ Object
- #reboot ⇒ Object
- #terminate ⇒ Object
Methods inherited from Instance
Methods included from Instance::CommonLaunchDetails
#availability_domain, #compartment_id, #defined_tags, #freeform_tags, #shape
Methods inherited from Kitchen::Driver::Oci
#create, #destroy, validation_error
Methods included from Kitchen::Driver::Oci::Models
#instance_class, #volume_class
Constructor Details
#initialize(config, state, oci, api, action) ⇒ Dbaas
Returns a new instance of Dbaas.
29 30 31 32 33 34 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 29 def initialize(config, state, oci, api, action) super @launch_details = OCI::Database::Models::LaunchDbSystemDetails.new @database_details = OCI::Database::Models::CreateDatabaseDetails.new @db_home_details = OCI::Database::Models::CreateDbHomeDetails.new end |
Instance Attribute Details
#database_details ⇒ OCI::Database::Models::CreateDatabaseDetails
The details model that describes the database
48 49 50 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 48 def database_details @database_details end |
#db_home_details ⇒ OCI::Database::Models::CreateDbHomeDetails
The details model that describes the database home
55 56 57 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 55 def db_home_details @db_home_details end |
#launch_details ⇒ OCI::Database::Models::LaunchDbSystemDetails
The details model that describes the db system
41 42 43 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 41 def launch_details @launch_details end |
Instance Method Details
#launch ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 57 def launch response = api.dbaas.launch_db_system(launch_instance_details) instance_id = response.data.id api.dbaas.get_db_system(instance_id).wait_until(:lifecycle_state, OCI::Database::Models::DbSystem::LIFECYCLE_STATE_AVAILABLE, max_interval_seconds: 900, max_wait_seconds: 21_600) final_state(state, instance_id) end |
#reboot ⇒ Object
72 73 74 75 76 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 72 def reboot db_node_id = dbaas_node(state[:server_id]).first.id api.dbaas.db_node_action(db_node_id, "SOFTRESET") api.dbaas.get_db_node(db_node_id).wait_until(:lifecycle_state, OCI::Database::Models::DbNode::LIFECYCLE_STATE_AVAILABLE) end |
#terminate ⇒ Object
66 67 68 69 70 |
# File 'lib/kitchen/driver/oci/models/dbaas.rb', line 66 def terminate api.dbaas.terminate_db_system(state[:server_id]) api.dbaas.get_db_system(state[:server_id]).wait_until(:lifecycle_state, OCI::Database::Models::DbSystem::LIFECYCLE_STATE_TERMINATING, max_interval_seconds: 900, max_wait_seconds: 21_600) end |