Skip to main content

certificate_templates

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

Overview

Namecertificate_templates
TypeResource
Idgoogle.privateca.certificate_templates

Fields

NameDatatypeDescription
namestringOutput only. The resource name for this CertificateTemplate in the format projects/*/locations/*/certificateTemplates/*.
descriptionstringOptional. A human-readable description of scenarios this template is intended for.
createTimestringOutput only. The time at which this CertificateTemplate was created.
identityConstraintsobjectDescribes constraints on a Certificate's Subject and SubjectAltNames.
labelsobjectOptional. Labels with user-defined metadata.
maximumLifetimestringOptional. The maximum lifetime allowed for issued Certificates that use this template. If the issuing CaPool resource's IssuancePolicy specifies a maximum_lifetime the minimum of the two durations will be the maximum lifetime for issued Certificates. Note that if the issuing CertificateAuthority expires before a Certificate's requested maximum_lifetime, the effective lifetime will be explicitly truncated to match it.
passthroughExtensionsobjectDescribes a set of X.509 extensions that may be part of some certificate issuance controls.
predefinedValuesobjectAn X509Parameters is used to describe certain fields of an X.509 certificate, such as the key usage fields, fields specific to CA certificates, certificate policy extensions and custom extensions.
updateTimestringOutput only. The time at which this CertificateTemplate was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTcertificateTemplatesId, locationsId, projectsIdReturns a CertificateTemplate.
listSELECTlocationsId, projectsIdLists CertificateTemplates.
createINSERTlocationsId, projectsIdCreate a new CertificateTemplate in a given Project and Location.
deleteDELETEcertificateTemplatesId, locationsId, projectsIdDeleteCertificateTemplate deletes a CertificateTemplate.
patchUPDATEcertificateTemplatesId, locationsId, projectsIdUpdate a CertificateTemplate.

SELECT examples

Lists CertificateTemplates.

SELECT
name,
description,
createTime,
identityConstraints,
labels,
maximumLifetime,
passthroughExtensions,
predefinedValues,
updateTime
FROM google.privateca.certificate_templates
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.privateca.certificate_templates (
locationsId,
projectsId,
maximumLifetime,
predefinedValues,
identityConstraints,
passthroughExtensions,
description,
labels
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ maximumLifetime }}',
'{{ predefinedValues }}',
'{{ identityConstraints }}',
'{{ passthroughExtensions }}',
'{{ description }}',
'{{ labels }}'
;

UPDATE example

Updates a certificate_templates resource.

/*+ update */
UPDATE google.privateca.certificate_templates
SET
maximumLifetime = '{{ maximumLifetime }}',
predefinedValues = '{{ predefinedValues }}',
identityConstraints = '{{ identityConstraints }}',
passthroughExtensions = '{{ passthroughExtensions }}',
description = '{{ description }}',
labels = '{{ labels }}'
WHERE
certificateTemplatesId = '{{ certificateTemplatesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified certificate_templates resource.

/*+ delete */
DELETE FROM google.privateca.certificate_templates
WHERE certificateTemplatesId = '{{ certificateTemplatesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';