Skip to main content

import_jobs

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

Overview

Nameimport_jobs
TypeResource
Idgoogle.migrationcenter.import_jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The full name of the import job.
assetSourcestringRequired. Reference to a source.
completeTimestring (google-datetime)Output only. The timestamp when the import job was completed.
createTimestring (google-datetime)Output only. The timestamp when the import job was created.
displayNamestringOptional. User-friendly display name. Maximum length is 256 characters.
executionReportobjectOutput only. The report with the results of running the import job. (id: ExecutionReport)
labelsobjectLabels as key value pairs.
statestringOutput only. The state of the import job.
updateTimestring (google-datetime)Output only. The timestamp when the import job was last updated.
validationReportobjectOutput only. The report with the validation results of the import job. (id: ValidationReport)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, importJobsIdviewGets the details of an import job.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderBy, viewLists all import jobs.
createinsertprojectsId, locationsIdimportJobId, requestIdCreates an import job.
patchupdateprojectsId, locationsId, importJobsIdupdateMask, requestIdUpdates an import job.
deletedeleteprojectsId, locationsId, importJobsIdrequestId, forceDeletes an import job.
validateexecprojectsId, locationsId, importJobsIdValidates an import job.
runexecprojectsId, locationsId, importJobsIdRuns an import job.

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

SELECT examples

Gets the details of an import job.

SELECT
name,
assetSource,
completeTime,
createTime,
displayName,
executionReport,
labels,
state,
updateTime,
validationReport
FROM google.migrationcenter.import_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND importJobsId = '{{ importJobsId }}' -- required
AND view = '{{ view }}';

INSERT examples

Creates an import job.

INSERT INTO google.migrationcenter.import_jobs (
data__displayName,
data__labels,
data__assetSource,
projectsId,
locationsId,
importJobId,
requestId
)
SELECT
'{{ displayName }}',
'{{ labels }}',
'{{ assetSource }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ importJobId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an import job.

UPDATE google.migrationcenter.import_jobs
SET
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__assetSource = '{{ assetSource }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND importJobsId = '{{ importJobsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an import job.

DELETE FROM google.migrationcenter.import_jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND importJobsId = '{{ importJobsId }}' --required
AND requestId = '{{ requestId }}'
AND force = '{{ force }}';

Lifecycle Methods

Validates an import job.

EXEC google.migrationcenter.import_jobs.validate 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@importJobsId='{{ importJobsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}"
}';