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:

Successful response

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)
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.
selfManagedobjectIf set, defines data of a self-managed certificate. (id: SelfManagedCertificate)
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, locationsIdpageSize, pageToken, filter, orderByLists 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,
pemCertificate,
sanDnsnames,
scope,
selfManaged,
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__name,
data__description,
data__labels,
data__selfManaged,
data__managed,
data__scope,
projectsId,
locationsId,
certificateId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ selfManaged }}',
'{{ managed }}',
'{{ scope }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ certificateId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a Certificate.

UPDATE google.certificatemanager.certificates
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__selfManaged = '{{ selfManaged }}',
data__managed = '{{ managed }}',
data__scope = '{{ scope }}'
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;