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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name for this CertificateTemplate in the format projects/*/locations/*/certificateTemplates/*.
createTimestring (google-datetime)Output only. The time at which this CertificateTemplate was created.
descriptionstringOptional. A human-readable description of scenarios this template is intended for.
identityConstraintsobjectOptional. Describes constraints on identities that may be appear in Certificates issued using this template. If this is omitted, then this template will not add restrictions on a certificate's identity. (id: CertificateIdentityConstraints)
labelsobjectOptional. Labels with user-defined metadata.
maximumLifetimestring (google-duration)Optional. 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.
passthroughExtensionsobjectOptional. Describes the set of X.509 extensions that may appear in a Certificate issued using this CertificateTemplate. If a certificate request sets extensions that don't appear in the passthrough_extensions, those extensions will be dropped. If the issuing CaPool's IssuancePolicy defines baseline_values that don't appear here, the certificate issuance request will fail. If this is omitted, then this template will not add restrictions on a certificate's X.509 extensions. These constraints do not apply to X.509 extensions set in this CertificateTemplate's predefined_values. (id: CertificateExtensionConstraints)
predefinedValuesobjectOptional. A set of X.509 values that will be applied to all issued certificates that use this template. If the certificate request includes conflicting values for the same properties, they will be overwritten by the values defined here. If the issuing CaPool's IssuancePolicy defines conflicting baseline_values for the same properties, the certificate issuance request will fail. (id: X509Parameters)
updateTimestring (google-datetime)Output only. The time at which this CertificateTemplate was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, certificateTemplatesIdReturns a CertificateTemplate.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists CertificateTemplates.
createinsertprojectsId, locationsIdcertificateTemplateId, requestIdCreate a new CertificateTemplate in a given Project and Location.
patchupdateprojectsId, locationsId, certificateTemplatesIdupdateMask, requestIdUpdate a CertificateTemplate.
deletedeleteprojectsId, locationsId, certificateTemplatesIdrequestIdDeleteCertificateTemplate deletes a CertificateTemplate.

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
certificateTemplatesIdstring
locationsIdstring
projectsIdstring
certificateTemplateIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Returns a CertificateTemplate.

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

INSERT examples

Create a new CertificateTemplate in a given Project and Location.

INSERT INTO google.privateca.certificate_templates (
data__name,
data__maximumLifetime,
data__predefinedValues,
data__identityConstraints,
data__passthroughExtensions,
data__description,
data__labels,
projectsId,
locationsId,
certificateTemplateId,
requestId
)
SELECT
'{{ name }}',
'{{ maximumLifetime }}',
'{{ predefinedValues }}',
'{{ identityConstraints }}',
'{{ passthroughExtensions }}',
'{{ description }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ certificateTemplateId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a CertificateTemplate.

UPDATE google.privateca.certificate_templates
SET
data__name = '{{ name }}',
data__maximumLifetime = '{{ maximumLifetime }}',
data__predefinedValues = '{{ predefinedValues }}',
data__identityConstraints = '{{ identityConstraints }}',
data__passthroughExtensions = '{{ passthroughExtensions }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND certificateTemplatesId = '{{ certificateTemplatesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

DeleteCertificateTemplate deletes a CertificateTemplate.

DELETE FROM google.privateca.certificate_templates
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND certificateTemplatesId = '{{ certificateTemplatesId }}' --required
AND requestId = '{{ requestId }}';