Skip to main content

certificates

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

Overview​

Namecertificates
TypeResource
Idgoogle.certificatemanager.certificates

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. A user-defined name of the certificate. Certificate names must be unique globally and match pattern projects/*/locations/*/certificates/*.
createTimestring (google-datetime)Output only. The creation timestamp of a Certificate.
descriptionstringOptional. One or more paragraphs of text description of a certificate.
expireTimestring (google-datetime)Output only. The expiry timestamp of a Certificate.
labelsobjectOptional. Set of labels associated with a Certificate.
managedobjectIf set, contains configuration and state of a managed certificate. (id: ManagedCertificate)
managedIdentityobjectIf set, contains configuration and state of a managed identity certificate. (id: ManagedIdentityCertificate)
pemCertificatestringOutput only. The PEM-encoded certificate chain.
sanDnsnamesarrayOutput only. The list of Subject Alternative Names of dnsName type defined in the certificate (see RFC 5280 4.2.1.6). Managed certificates that haven't been provisioned yet have this field populated with a value of the managed.domains field.
scopestringOptional. Immutable. The scope of the certificate. (DEFAULT, EDGE_CACHE, ALL_REGIONS, CLIENT_AUTH)
selfManagedobjectIf set, defines data of a self-managed certificate. (id: SelfManagedCertificate)
tagsobjectOptional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"
updateTimestring (google-datetime)Output only. The last update timestamp of a Certificate.
usedByarrayOutput only. The list of resources that use this Certificate.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, certificatesIdGets details of a single Certificate.
listselectprojectsId, locationsIdfilter, orderBy, pageSize, pageTokenLists Certificates in a given project and location.
createinsertprojectsId, locationsIdcertificateIdCreates a new Certificate in a given project and location.
patchupdateprojectsId, locationsId, certificatesIdupdateMaskUpdates a Certificate.
deletedeleteprojectsId, locationsId, certificatesIdDeletes a single Certificate.

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.

NameDatatypeDescription
certificatesIdstring
locationsIdstring
projectsIdstring
certificateIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples​

Gets details of a single Certificate.

SELECT
name,
createTime,
description,
expireTime,
labels,
managed,
managedIdentity,
pemCertificate,
sanDnsnames,
scope,
selfManaged,
tags,
updateTime,
usedBy
FROM google.certificatemanager.certificates
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND certificatesId = '{{ certificatesId }}' -- required
;

INSERT examples​

Creates a new Certificate in a given project and location.

INSERT INTO google.certificatemanager.certificates (
data__description,
data__labels,
data__managed,
data__managedIdentity,
data__name,
data__scope,
data__selfManaged,
data__tags,
projectsId,
locationsId,
certificateId
)
SELECT
'{{ description }}',
'{{ labels }}',
'{{ managed }}',
'{{ managedIdentity }}',
'{{ name }}',
'{{ scope }}',
'{{ selfManaged }}',
'{{ tags }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ certificateId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples​

Updates a Certificate.

UPDATE google.certificatemanager.certificates
SET
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__managed = '{{ managed }}',
data__managedIdentity = '{{ managedIdentity }}',
data__name = '{{ name }}',
data__scope = '{{ scope }}',
data__selfManaged = '{{ selfManaged }}',
data__tags = '{{ tags }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND certificatesId = '{{ certificatesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples​

Deletes a single Certificate.

DELETE FROM google.certificatemanager.certificates
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND certificatesId = '{{ certificatesId }}' --required
;