Skip to main content

assets

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

Overview

Nameassets
TypeResource
Idgoogle.migrationcenter.assets

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The full name of the asset.
assignedGroupsarrayOutput only. The list of groups that the asset is assigned to.
attributesobjectGeneric asset attributes.
createTimestring (google-datetime)Output only. The timestamp when the asset was created.
databaseDeploymentDetailsobjectOutput only. Asset information specific for database deployments. (id: DatabaseDeploymentDetails)
databaseDetailsobjectOutput only. Asset information specific for logical databases. (id: DatabaseDetails)
hiddenbooleanOptional. Indicates if the asset is hidden.
hideReasonstringOptional. An optional reason for marking this asset as hidden.
hideTimestring (google-datetime)Output only. The timestamp when the asset was marked as hidden.
insightListobjectOutput only. The list of insights associated with the asset. (id: InsightList)
labelsobjectLabels as key value pairs.
machineDetailsobjectOutput only. Asset information specific for virtual and physical machines. (id: MachineDetails)
performanceDataobjectOutput only. Performance data for the asset. (id: AssetPerformanceData)
sourcesarrayOutput only. The list of sources contributing to the asset.
titlestringOutput only. Server generated human readable name of the asset.
updateTimestring (google-datetime)Output only. The timestamp when the asset was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, assetsIdviewGets the details of an asset.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderBy, view, showHiddenLists all the assets in a given project and location.
patchupdateprojectsId, locationsId, assetsIdupdateMask, requestIdUpdates the parameters of an asset.
batch_updateupdateprojectsId, locationsIdUpdates the parameters of a list of assets.
deletedeleteprojectsId, locationsId, assetsIdrequestIdDeletes an asset.
batch_deletedeleteprojectsId, locationsIdDeletes list of Assets.
report_asset_framesexecprojectsId, locationsIdsourceReports a set of frames.
aggregate_valuesexecprojectsId, locationsIdAggregates the requested fields based on provided function.

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

SELECT examples

Gets the details of an asset.

SELECT
name,
assignedGroups,
attributes,
createTime,
databaseDeploymentDetails,
databaseDetails,
hidden,
hideReason,
hideTime,
insightList,
labels,
machineDetails,
performanceData,
sources,
title,
updateTime
FROM google.migrationcenter.assets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND assetsId = '{{ assetsId }}' -- required
AND view = '{{ view }}';

UPDATE examples

Updates the parameters of an asset.

UPDATE google.migrationcenter.assets
SET
data__labels = '{{ labels }}',
data__attributes = '{{ attributes }}',
data__hidden = {{ hidden }},
data__hideReason = '{{ hideReason }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND assetsId = '{{ assetsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
assignedGroups,
attributes,
createTime,
databaseDeploymentDetails,
databaseDetails,
hidden,
hideReason,
hideTime,
insightList,
labels,
machineDetails,
performanceData,
sources,
title,
updateTime;

DELETE examples

Deletes an asset.

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

Lifecycle Methods

Reports a set of frames.

EXEC google.migrationcenter.assets.report_asset_frames 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@source='{{ source }}'
@@json=
'{
"framesData": "{{ framesData }}"
}';