Database Configuration

3 minute readReference

getDatabaseConfiguration

Retrieves the current database configuration.

Arguments Descriptions

None

Positional arguments

None

Response

Returns a databaseConfiguration element, which includes the database name, user name, database dialect, driver, URL, along with the host name and port number.

ec-perl

syntax: $cmdr->getDatabaseConfiguration();

Example

$cmdr->getDatabaseConfiguration();

ectool

syntax: ectool getDatabaseConfiguration

Example

ectool getDatabaseConfiguration

setDatabaseConfiguration

Sets the database configuration on the server. If the server is in bootstrap mode, these changes take effect immediately and the server attempts to start. If the server is already running, these changes have no effect until the server is restarted.

If you are replacing the database you are currently using, you must restart the CloudBees CD/RO server after configuring the new database you want to use.

CloudBees CD/RO assigns default values to the following three arguments that are derived from information you enter for the arguments below. The values for these arguments can be viewed in the XML response for getDatabaseConfiguration. You should not need to change these values, but "customDatabase" arguments may be used to override CloudBees CD/RO default values. Contact CloudBees Customer Support for assistance with using these arguments: customDatabaseDialect customDatabaseDriver customDatabaseUrl.

Arguments Descriptions

customDatabaseDialect

Class name of the Hibernate dialect (advanced use only . The server chooses an appropriate dialect based on the databaseType ).

Argument Type: String

customDatabaseDriver

Class name of the JDBC driver ( advanced use only . The server chooses an appropriate driver based on the databaseType ).

Argument Type: String

customDatabaseUrl

The JDBC to use ( advanced use only . The server composes an appropriate URL).

Argument Type: String

databaseName

The name of the database that you want the CloudBees CD/RO server to use. The default is commander .

Argument Type: String

databaseType

The type of database that you want the CloudBees CD/RO server to use. Supported database types are: <builtin|mysql|sqlserver|oracle>.

The default is builtin .

Argument Type: DatabaseType

hostName

The domain name or IP address of the host server machine where the database is running.

Argument Type: String

ignorePasskeyMismatch

< Boolean flag— 0|1|true|false > If true, ignore a passkey fingerprint mismatch between the current passkey file and the database configuration and discard the stored credentials.

This action discards all saved passwords.

Argument Type: Boolean

ignoreServerMismatch

< Boolean flag— 0|1|true|false > If true, ignore a host name mismatch between the current server and the database configuration where the server previously started.

Argument Type: Boolean

password

The password required to access the database.

setDatabaseConfiguration does not allow a passwordless database user. Make sure the database user has a password.

Argument Type: String

port

The port number used to access the database. The default is the server port default.

Argument Type: String

preserveSessions

< Boolean flag— 0|1|true|false > When a host name mismatch between the current server and the database configuration occurs, the default behavior is to invalidate all sessions. If this argument is set to true, all sessions are preserved and the server can reconnect to running jobs. This option is used in combination with ignoreServerMismatch.

Argument Type: Boolean

userName

The name of the user required to access the database.

Argument Type: String

Positional arguments

None

Response

None or a status OK message.

ec-perl

syntax: $cmdr->setDatabaseConfiguration({<optionals>});

Example

$cmdr->setDatabaseConfiguration({hostName => "localhost", port => 3306}); # If the database type is set to the mysql, sqlserver, or oracle and # you want to use the builtin database $cmdr->setDatabaseConfiguration({databaseType => "builtin", databaseName => "builtin"});

ectool

syntax: ectool setDatabaseConfiguration <specify configuration values> [optionals]

Example

ectool setDatabaseConfiguration --hostName localhost --port 3306 # If the database type is set to the mysql, sqlserver, or oracle and # you want to use the builtin database ectool setDatabaseConfiguration --databaseType builtin --databaseName builtin

validateDatabase

Performs consistency checks on the database.

Arguments Descriptions

options

Comma-separated list of options that specify the aspects of the database to validate.

Argument Type: String

Positional arguments

None

Response

None or a status OK message.

ec-perl

syntax: $cmdr->validateDatabase( {<optionals>});

Example

$cmdr->validateDatabase();

ectool

syntax: `ectool validateDatabase [optionals] `

Example

ectool validateDatabase