Skip to main content

ssl_certs

Creates, updates, deletes, gets or lists a ssl_certs resource.

Overview

Namessl_certs
TypeResource
Idgoogle.sqladmin.ssl_certs

Fields

NameDatatypeDescription
certstringPEM representation.
certSerialNumberstringSerial number, as extracted from the certificate.
commonNamestringUser supplied name. Constrained to [a-zA-Z.-_ ]+.
createTimestringThe time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
expirationTimestringThe time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
instancestringName of the database instance.
kindstringThis is always sql#sslCert.
selfLinkstringThe URI of this resource.
sha1FingerprintstringSha1 Fingerprint.

Methods

NameAccessible byRequired ParamsDescription
getSELECTinstance, project, sha1FingerprintRetrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.
listSELECTinstance, projectLists all of the current SSL certificates for the instance.
insertINSERTinstance, projectCreates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.
deleteDELETEinstance, project, sha1FingerprintDeletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.

SELECT examples

Lists all of the current SSL certificates for the instance.

SELECT
cert,
certSerialNumber,
commonName,
createTime,
expirationTime,
instance,
kind,
selfLink,
sha1Fingerprint
FROM google.sqladmin.ssl_certs
WHERE instance = '{{ instance }}'
AND project = '{{ project }}';

INSERT example

Use the following StackQL query and manifest file to create a new ssl_certs resource.

/*+ create */
INSERT INTO google.sqladmin.ssl_certs (
instance,
project,
commonName
)
SELECT
'{{ instance }}',
'{{ project }}',
'{{ commonName }}'
;

DELETE example

Deletes the specified ssl_certs resource.

/*+ delete */
DELETE FROM google.sqladmin.ssl_certs
WHERE instance = '{{ instance }}'
AND project = '{{ project }}'
AND sha1Fingerprint = '{{ sha1Fingerprint }}';