ssl_certs
Creates, updates, deletes, gets or lists a ssl_certs
resource.
Overview
Name | ssl_certs |
Type | Resource |
Id | google.sqladmin.ssl_certs |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
cert | string | PEM representation. |
certSerialNumber | string | Serial number, as extracted from the certificate. |
commonName | string | User supplied name. Constrained to [a-zA-Z.-_ ]+. |
createTime | string (google-datetime) | The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
expirationTime | string (google-datetime) | The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
instance | string | Name of the database instance. |
kind | string | This is always sql#sslCert . |
selfLink | string | The URI of this resource. |
sha1Fingerprint | string | Sha1 Fingerprint. |
Successful response
Name | Datatype | Description |
---|---|---|
items | array | List of client certificates for the instance. |
kind | string | This is always sql#sslCertsList . |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , instance , sha1Fingerprint | Retrieves 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. | |
list | select | project , instance | Lists all of the current SSL certificates for the instance. | |
insert | insert | project , instance | Creates 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. | |
delete | delete | project , instance , sha1Fingerprint | Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted. |
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 | |
sha1Fingerprint | string |
SELECT
examples
- get
- list
Retrieves 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.
SELECT
cert,
certSerialNumber,
commonName,
createTime,
expirationTime,
instance,
kind,
selfLink,
sha1Fingerprint
FROM google.sqladmin.ssl_certs
WHERE project = '{{ project }}' -- required
AND instance = '{{ instance }}' -- required
AND sha1Fingerprint = '{{ sha1Fingerprint }}' -- required;
Lists all of the current SSL certificates for the instance.
SELECT
items,
kind
FROM google.sqladmin.ssl_certs
WHERE project = '{{ project }}' -- required
AND instance = '{{ instance }}' -- required;
INSERT
examples
- insert
- Manifest
Creates 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.
INSERT INTO google.sqladmin.ssl_certs (
data__commonName,
project,
instance
)
SELECT
'{{ commonName }}',
'{{ project }}',
'{{ instance }}'
RETURNING
clientCert,
kind,
operation,
serverCaCert
;
# Description fields are for documentation purposes
- name: ssl_certs
props:
- name: project
value: string
description: Required parameter for the ssl_certs resource.
- name: instance
value: string
description: Required parameter for the ssl_certs resource.
- name: commonName
value: string
description: >
User supplied name. Must be a distinct name from the other certificates for this instance.
DELETE
examples
- delete
Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.
DELETE FROM google.sqladmin.ssl_certs
WHERE project = '{{ project }}' --required
AND instance = '{{ instance }}' --required
AND sha1Fingerprint = '{{ sha1Fingerprint }}' --required;