Skip to main content
PATCH
/
v1
/
instances
/
{instance}
:updateDataSource
cURL
curl --request PATCH \
  --url https://api.example.com/v1/instances/{instance}:updateDataSource \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "<string>",
  "type": "DATA_SOURCE_UNSPECIFIED",
  "username": "<string>",
  "password": "<string>",
  "useSsl": true,
  "sslCa": "<string>",
  "sslCert": "<string>",
  "sslKey": "<string>",
  "verifyTlsCertificate": true,
  "host": "<string>",
  "port": "<string>",
  "database": "<string>",
  "srv": true,
  "authenticationDatabase": "<string>",
  "replicaSet": "<string>",
  "sid": "<string>",
  "serviceName": "<string>",
  "sshHost": "<string>",
  "sshPort": "<string>",
  "sshUser": "<string>",
  "sshPassword": "<string>",
  "sshPrivateKey": "<string>",
  "authenticationPrivateKey": "<string>",
  "authenticationPrivateKeyPassphrase": "<string>",
  "externalSecret": {
    "secretType": "SECRET_TYPE_UNSPECIFIED",
    "url": "<string>",
    "authType": "AUTH_TYPE_UNSPECIFIED",
    "appRole": {
      "roleId": "<string>",
      "secretId": "<string>",
      "type": "SECRET_TYPE_UNSPECIFIED",
      "mountPath": "<string>"
    },
    "token": "<string>",
    "engineName": "<string>",
    "secretName": "<string>",
    "passwordKeyName": "<string>",
    "skipVaultTlsVerification": true,
    "vaultSslCa": "<string>",
    "vaultSslCert": "<string>",
    "vaultSslKey": "<string>"
  },
  "authenticationType": "AUTHENTICATION_UNSPECIFIED",
  "azureCredential": {
    "tenantId": "<string>",
    "clientId": "<string>",
    "clientSecret": "<string>"
  },
  "awsCredential": {
    "accessKeyId": "<string>",
    "secretAccessKey": "<string>",
    "sessionToken": "<string>",
    "roleArn": "<string>",
    "externalId": "<string>"
  },
  "gcpCredential": {
    "content": "<string>"
  },
  "saslConfig": {
    "krbConfig": {
      "primary": "<string>",
      "instance": "<string>",
      "realm": "<string>",
      "keytab": "<string>",
      "kdcHost": "<string>",
      "kdcPort": "<string>",
      "kdcTransportProtocol": "<string>"
    }
  },
  "additionalAddresses": [
    {
      "host": "<string>",
      "port": "<string>"
    }
  ],
  "directConnection": true,
  "region": "<string>",
  "warehouseId": "<string>",
  "masterName": "<string>",
  "masterUsername": "<string>",
  "masterPassword": "<string>",
  "redisType": "REDIS_TYPE_UNSPECIFIED",
  "cluster": "<string>",
  "extraConnectionParameters": {}
}
'
{
  "name": "<string>",
  "state": "STATE_UNSPECIFIED",
  "title": "<string>",
  "engine": "ENGINE_UNSPECIFIED",
  "engineVersion": "<string>",
  "externalLink": "<string>",
  "dataSources": [
    {
      "id": "<string>",
      "type": "DATA_SOURCE_UNSPECIFIED",
      "username": "<string>",
      "useSsl": true,
      "verifyTlsCertificate": true,
      "host": "<string>",
      "port": "<string>",
      "database": "<string>",
      "srv": true,
      "authenticationDatabase": "<string>",
      "replicaSet": "<string>",
      "sid": "<string>",
      "serviceName": "<string>",
      "sshHost": "<string>",
      "sshPort": "<string>",
      "sshUser": "<string>",
      "externalSecret": {
        "secretType": "SECRET_TYPE_UNSPECIFIED",
        "url": "<string>",
        "authType": "AUTH_TYPE_UNSPECIFIED",
        "appRole": {
          "type": "SECRET_TYPE_UNSPECIFIED",
          "mountPath": "<string>"
        },
        "engineName": "<string>",
        "secretName": "<string>",
        "passwordKeyName": "<string>",
        "skipVaultTlsVerification": true
      },
      "authenticationType": "AUTHENTICATION_UNSPECIFIED",
      "azureCredential": {
        "tenantId": "<string>",
        "clientId": "<string>"
      },
      "awsCredential": {},
      "gcpCredential": {},
      "saslConfig": {
        "krbConfig": {
          "primary": "<string>",
          "instance": "<string>",
          "realm": "<string>",
          "keytab": "<string>",
          "kdcHost": "<string>",
          "kdcPort": "<string>",
          "kdcTransportProtocol": "<string>"
        }
      },
      "additionalAddresses": [
        {
          "host": "<string>",
          "port": "<string>"
        }
      ],
      "directConnection": true,
      "region": "<string>",
      "warehouseId": "<string>",
      "masterName": "<string>",
      "masterUsername": "<string>",
      "masterPassword": "<string>",
      "redisType": "REDIS_TYPE_UNSPECIFIED",
      "cluster": "<string>",
      "extraConnectionParameters": {}
    }
  ],
  "environment": "<string>",
  "activation": true,
  "roles": [
    {
      "name": "<string>",
      "roleName": "<string>",
      "connectionLimit": 123,
      "validUntil": "<string>",
      "attribute": "<string>"
    }
  ],
  "syncInterval": "<string>",
  "maximumConnections": 123,
  "syncDatabases": [
    "<string>"
  ],
  "lastSyncTime": "2023-11-07T05:31:56Z",
  "labels": {}
}

Path Parameters

instance
string
required

The instance id.

Query Parameters

updateMask
string<field-mask>

The list of fields to update.

validateOnly
boolean

Validate only also tests the data source connection.

allowMissing
boolean

If set to true, and the data source is not found, a new data source will be created. In this situation, update_mask is ignored.

Body

application/json
id
string

The unique identifier for this data source.

type
enum<string>

The type of data source (ADMIN or READ_ONLY).

Available options:
DATA_SOURCE_UNSPECIFIED,
ADMIN,
READ_ONLY
username
string

The username for database authentication.

password
string

The password for database authentication.

useSsl
boolean

Use SSL to connect to the data source. By default, we use system default SSL configuration.

sslCa
string

The SSL certificate authority certificate.

sslCert
string

The SSL client certificate.

sslKey
string

The SSL client private key.

verifyTlsCertificate
boolean

verify_tls_certificate enables TLS certificate verification for SSL connections. Default is false (no verification) for backward compatibility. Set to true for secure connections (recommended for production). Only set to false for development or when certificates cannot be properly validated (e.g., self-signed certs, VPN environments).

host
string

The hostname or IP address of the database server.

port
string

The port number of the database server.

database
string

The name of the database to connect to.

srv
boolean

srv, authentication_database and replica_set are used for MongoDB. srv is a boolean flag that indicates whether the host is a DNS SRV record.

authenticationDatabase
string

authentication_database is the database name to authenticate against, which stores the user credentials.

replicaSet
string

replica_set is used for MongoDB replica set.

sid
string

sid and service_name are used for Oracle.

serviceName
string
sshHost
string

Connection over SSH. The hostname of the SSH server agent. Required.

sshPort
string

The port of the SSH server agent. It's 22 typically. Required.

sshUser
string

The user to login the server. Required.

sshPassword
string

The password to login the server. If it's empty string, no password is required.

sshPrivateKey
string

The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").

authenticationPrivateKey
string

PKCS#8 private key in PEM format. If it's empty string, no private key is required. Used for authentication when connecting to the data source.

authenticationPrivateKeyPassphrase
string

Passphrase for the encrypted PKCS#8 private key. Only used when the private key is encrypted.

externalSecret
object
authenticationType
enum<string>
Available options:
AUTHENTICATION_UNSPECIFIED,
PASSWORD,
GOOGLE_CLOUD_SQL_IAM,
AWS_RDS_IAM,
AZURE_IAM
azureCredential
object
awsCredential
object
gcpCredential
object
saslConfig
object
additionalAddresses
object[]

additional_addresses is used for MongoDB replica set.

directConnection
boolean

direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.

region
string

region is the location of where the DB is, works for AWS RDS. For example, us-east-1.

warehouseId
string

warehouse_id is used by Databricks.

masterName
string

master_name is the master name used by connecting redis-master via redis sentinel.

masterUsername
string

master_username and master_password are master credentials used by redis sentinel mode.

masterPassword
string
redisType
enum<string>
Available options:
REDIS_TYPE_UNSPECIFIED,
STANDALONE,
SENTINEL,
CLUSTER
cluster
string

Cluster is the cluster name for the data source. Used by CockroachDB.

extraConnectionParameters
object

Extra connection parameters for the database connection. For PostgreSQL HA, this can be used to set target_session_attrs=read-write

Response

OK

name
string

The name of the instance. Format: instances/{instance}

state
enum<string>

The lifecycle state of the instance.

Available options:
STATE_UNSPECIFIED,
ACTIVE,
DELETED
title
string

The display title of the instance.

engine
enum<string>

The database engine type.

Available options:
ENGINE_UNSPECIFIED,
CLICKHOUSE,
MYSQL,
POSTGRES,
SNOWFLAKE,
SQLITE,
TIDB,
MONGODB,
REDIS,
ORACLE,
SPANNER,
MSSQL,
REDSHIFT,
MARIADB,
OCEANBASE,
STARROCKS,
DORIS,
HIVE,
ELASTICSEARCH,
BIGQUERY,
DYNAMODB,
DATABRICKS,
COCKROACHDB,
COSMOSDB,
TRINO,
CASSANDRA
engineVersion
string

The version of the database engine.

External URL to the database instance console.

dataSources
object[]

Data source configurations for connecting to the instance.

environment
string

The environment resource. Format: environments/prod where prod is the environment resource ID.

activation
boolean

Whether the instance is activated for use.

roles
object[]

Database roles available in this instance.

syncInterval
string

How often the instance is synced.

maximumConnections
integer<int32>

The maximum number of connections. The default is 10 if the value is unset or zero.

syncDatabases
string[]

Enable sync for following databases. Default empty, means sync all schemas & databases.

lastSyncTime
string<date-time>

The last time the instance was synced.

labels
object

Labels are key-value pairs that can be attached to the instance. For example, { "org_group": "infrastructure", "environment": "production" }