Skip to main content

import_jobs

Creates, updates, deletes, gets or lists an import_jobs resource.

Overview

Nameimport_jobs
TypeResource
Idgoogle.cloudkms.import_jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name for this ImportJob in the format projects/*/locations/*/keyRings/*/importJobs/*.
attestationobjectOutput only. Statement that was generated and signed by the key creator (for example, an HSM) at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only present if the chosen ImportMethod is one with a protection level of HSM. (id: KeyOperationAttestation)
createTimestring (google-datetime)Output only. The time at which this ImportJob was created.
expireEventTimestring (google-datetime)Output only. The time this ImportJob expired. Only present if state is EXPIRED.
expireTimestring (google-datetime)Output only. The time at which this ImportJob is scheduled for expiration and can no longer be used to import key material.
generateTimestring (google-datetime)Output only. The time this ImportJob's key material was generated.
importMethodstringRequired. Immutable. The wrapping method to be used for incoming key material.
protectionLevelstringRequired. Immutable. The protection level of the ImportJob. This must match the protection_level of the version_template on the CryptoKey you attempt to import into.
publicKeyobjectOutput only. The public key with which to wrap key material prior to import. Only returned if state is ACTIVE. (id: WrappingPublicKey)
statestringOutput only. The current state of the ImportJob, indicating if it can be used.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, keyRingsId, importJobsIdReturns metadata for a given ImportJob.
listselectprojectsId, locationsId, keyRingsIdpageSize, pageToken, filter, orderByLists ImportJobs.
createinsertprojectsId, locationsId, keyRingsIdimportJobIdCreate a new ImportJob within a KeyRing. ImportJob.import_method is required.

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
importJobsIdstring
keyRingsIdstring
locationsIdstring
projectsIdstring
filterstring
importJobIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Returns metadata for a given ImportJob.

SELECT
name,
attestation,
createTime,
expireEventTime,
expireTime,
generateTime,
importMethod,
protectionLevel,
publicKey,
state
FROM google.cloudkms.import_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND keyRingsId = '{{ keyRingsId }}' -- required
AND importJobsId = '{{ importJobsId }}' -- required;

INSERT examples

Create a new ImportJob within a KeyRing. ImportJob.import_method is required.

INSERT INTO google.cloudkms.import_jobs (
data__importMethod,
data__protectionLevel,
projectsId,
locationsId,
keyRingsId,
importJobId
)
SELECT
'{{ importMethod }}',
'{{ protectionLevel }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ keyRingsId }}',
'{{ importJobId }}'
RETURNING
name,
attestation,
createTime,
expireEventTime,
expireTime,
generateTime,
importMethod,
protectionLevel,
publicKey,
state
;