Skip to main content

sources

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

Overview

Namesources
TypeResource
Idgoogle.migrationcenter.sources

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The full name of the source.
createTimestring (google-datetime)Output only. The timestamp when the source was created.
descriptionstringFree-text description.
displayNamestringUser-friendly display name.
errorFrameCountinteger (int32)Output only. The number of frames that were reported by the source and contained errors.
managedbooleanIf true, the source is managed by other service(s).
pendingFrameCountinteger (int32)Output only. Number of frames that are still being processed.
priorityinteger (int32)The information confidence of the source. The higher the value, the higher the confidence.
statestringOutput only. The state of the source.
typestringData source type.
updateTimestring (google-datetime)Output only. The timestamp when the source was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, sourcesIdGets the details of a source.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists all the sources in a given project and location.
createinsertprojectsId, locationsIdsourceId, requestIdCreates a new source in a given project and location.
patchupdateprojectsId, locationsId, sourcesIdupdateMask, requestIdUpdates the parameters of a source.
deletedeleteprojectsId, locationsId, sourcesIdrequestIdDeletes a source.

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

SELECT examples

Gets the details of a source.

SELECT
name,
createTime,
description,
displayName,
errorFrameCount,
managed,
pendingFrameCount,
priority,
state,
type,
updateTime
FROM google.migrationcenter.sources
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND sourcesId = '{{ sourcesId }}' -- required;

INSERT examples

Creates a new source in a given project and location.

INSERT INTO google.migrationcenter.sources (
data__displayName,
data__description,
data__type,
data__priority,
data__managed,
projectsId,
locationsId,
sourceId,
requestId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ type }}',
{{ priority }},
{{ managed }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ sourceId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a source.

UPDATE google.migrationcenter.sources
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__type = '{{ type }}',
data__priority = {{ priority }},
data__managed = {{ managed }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND sourcesId = '{{ sourcesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a source.

DELETE FROM google.migrationcenter.sources
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND sourcesId = '{{ sourcesId }}' --required
AND requestId = '{{ requestId }}';