This page describes how to update a Database Connection.
You can update the password secret version, wallet secret version, and labels of a Database Connection.
When you want to rotate the database or wallet password, add a new secret version, then update the corresponding property. The service checks access to the new secret and re-validates connectivity.
Update a Database Connection
To update a Database Connection, do the following:
gcloud
Use the gcloud oracle-database database-connections update command to
update a Database Connection.
gcloud oracle-database database-connections update CONNECTION_ID \
--project=PROJECT_ID \
--location=REGION \
--password-secret-version="projects/<var>PROJECT_ID</var>/secrets/<var>SECRET_ID</var>/versions/<var>SECRET_VERSION</var>" \
--wallet-secret-version="projects/<var>PROJECT_ID</var>/secrets/<var>SECRET_ID</var>/versions/<var>SECRET_VERSION</var>" \
--update-labels=KEY=VALUE
Replace the following:
- CONNECTION_ID: the ID of the Database Connection.
- PROJECT_ID: the ID of your Google Cloud project.
- REGION: the region where your Database Connection is located.
- For
password-secret-versionproperty, replace the following:- PROJECT_ID: the ID of your Google Cloud project that contains the secret.
- SECRET_ID: the ID of the secret.
- SECRET_VERSION: the new version of the secret to use.
- For
wallet-secret-versionproperty, replace the following:- PROJECT_ID: the ID of your Google Cloud project that contains the database wallet.
- SECRET_ID: the ID of the secret.
- SECRET_VERSION: the new version of the secret to use.
- For
update-labelsproperty, replace the following:- KEY: the key of the label.
- VALUE: the value of the label.
API
To update a Database Connection, run the following curl command, and include
only the fields that you want to update.
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/databaseConnections/CONNECTION_ID?updateMask=passwordSecretVersion,walletSecretVersion,labels" \
-d \
'{
"passwordSecretVersion": "projects/PROJECT_ID/secrets/SECRET_ID/versions/SECRET_VERSION",
"walletSecretVersion": "projects/PROJECT_ID/secrets/SECRET_ID/versions/SECRET_VERSION",
"labels": {
"KEY": "VALUE"
}
}'
Replace the following:
- PROJECT_ID: the ID of your Google Cloud project.
- REGION: the region where your Database Connection is located.
- CONNECTION_ID: the ID of the Database Connection.
- For
passwordSecretVersionproperty, replace the following:- PROJECT_ID: the ID of your Google Cloud project that contains the secret.
- SECRET_ID: the ID of the secret.
- SECRET_VERSION: the new version of the secret to use.
- For
walletSecretVersionproperty, replace the following:- PROJECT_ID: the ID of your Google Cloud project that contains the database wallet.
- SECRET_ID: the ID of the secret.
- SECRET_VERSION: the new version of the secret to use.
- For
labelsproperty, replace the following:- KEY: the key of the label.
- VALUE: the value of the label.