connect
Creates, updates, deletes, gets or lists a connect
resource.
Overview
Name | connect |
Type | Resource |
Id | google.sqladmin.connect |
Fields
The following fields are returned by SELECT
queries:
- get
Successful response
Name | Datatype | Description |
---|---|---|
backendType | string | SECOND_GEN : Cloud SQL database instance. EXTERNAL : A database server that is not managed by Google. This property is read-only; use the tier property in the settings object to determine the database type. |
customSubjectAlternativeNames | array | Custom subject alternative names for the server certificate. |
databaseVersion | string | The database engine type and version. The databaseVersion field cannot be changed after instance creation. MySQL instances: MYSQL_8_0 , MYSQL_5_7 (default), or MYSQL_5_6 . PostgreSQL instances: POSTGRES_9_6 , POSTGRES_10 , POSTGRES_11 , POSTGRES_12 (default), POSTGRES_13 , or POSTGRES_14 . SQL Server instances: SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE , SQLSERVER_2017_EXPRESS , SQLSERVER_2017_WEB , SQLSERVER_2019_STANDARD , SQLSERVER_2019_ENTERPRISE , SQLSERVER_2019_EXPRESS , or SQLSERVER_2019_WEB . |
dnsName | string | The dns name of the instance. |
dnsNames | array | Output only. The list of DNS names used by this instance. |
ipAddresses | array | The assigned IP addresses for the instance. |
kind | string | This is always sql#connectSettings . |
mdxProtocolSupport | array | Optional. Output only. mdx_protocol_support controls how the client uses metadata exchange when connecting to the instance. The values in the list representing parts of the MDX protocol that are supported by this instance. When the list is empty, the instance does not support MDX, so the client must not send an MDX request. The default is empty. |
nodeCount | integer (int32) | The number of read pool nodes in a read pool. |
nodes | array | Output only. Entries containing information about each read pool node of the read pool. |
pscEnabled | boolean | Whether PSC connectivity is enabled for this instance. |
region | string | The cloud region for the instance. For example, us-central1 , europe-west1 . The region cannot be changed after instance creation. |
serverCaCert | object | SslCerts Resource (id: SslCert) |
serverCaMode | string | Specify what type of CA is used for the server certificate. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , instance | readTime | Retrieves connect settings about a Cloud SQL instance. |
generate_ephemeral | exec | project , instance | Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
instance | string | |
project | string | |
readTime | string (google-datetime) |
SELECT
examples
- get
Retrieves connect settings about a Cloud SQL instance.
SELECT
backendType,
customSubjectAlternativeNames,
databaseVersion,
dnsName,
dnsNames,
ipAddresses,
kind,
mdxProtocolSupport,
nodeCount,
nodes,
pscEnabled,
region,
serverCaCert,
serverCaMode
FROM google.sqladmin.connect
WHERE project = '{{ project }}' -- required
AND instance = '{{ instance }}' -- required
AND readTime = '{{ readTime }}';
Lifecycle Methods
- generate_ephemeral
Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.
EXEC google.sqladmin.connect.generate_ephemeral
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"public_key": "{{ public_key }}",
"access_token": "{{ access_token }}",
"readTime": "{{ readTime }}",
"validDuration": "{{ validDuration }}"
}';