Skip to main content

assets

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

Overview

Nameassets
TypeResource
Idgoogle.dataplex.assets

Fields

NameDatatypeDescription
namestringOutput only. The relative resource name of the asset, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}.
descriptionstringOptional. Description of the asset.
createTimestringOutput only. The time when the asset was created.
discoverySpecobjectSettings to manage the metadata discovery and publishing for an asset.
discoveryStatusobjectStatus of discovery for an asset.
displayNamestringOptional. User friendly display name.
labelsobjectOptional. User defined labels for the asset.
resourceSpecobjectIdentifies the cloud resource that is referenced by this asset.
resourceStatusobjectStatus of the resource referenced by an asset.
securityStatusobjectSecurity policy status of the asset. Data security policy, i.e., readers, writers & owners, should be specified in the lake/zone/asset IAM policy.
statestringOutput only. Current state of the asset.
uidstringOutput only. System generated globally unique ID for the asset. This ID will be different if the asset is deleted and re-created with the same name.
updateTimestringOutput only. The time when the asset was last updated.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_lakes_zones_assets_getSELECTassetsId, lakesId, locationsId, projectsId, zonesIdRetrieves an asset resource.
projects_locations_lakes_zones_assets_listSELECTlakesId, locationsId, projectsId, zonesIdLists asset resources in a zone.
projects_locations_lakes_zones_assets_createINSERTlakesId, locationsId, projectsId, zonesIdCreates an asset resource.
projects_locations_lakes_zones_assets_deleteDELETEassetsId, lakesId, locationsId, projectsId, zonesIdDeletes an asset resource. The referenced storage resource is detached (default) or deleted based on the associated Lifecycle policy.
projects_locations_lakes_zones_assets_patchUPDATEassetsId, lakesId, locationsId, projectsId, zonesIdUpdates an asset resource.

SELECT examples

Lists asset resources in a zone.

SELECT
name,
description,
createTime,
discoverySpec,
discoveryStatus,
displayName,
labels,
resourceSpec,
resourceStatus,
securityStatus,
state,
uid,
updateTime
FROM google.dataplex.assets
WHERE lakesId = '{{ lakesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND zonesId = '{{ zonesId }}';

INSERT example

Use the following StackQL query and manifest file to create a new assets resource.

/*+ create */
INSERT INTO google.dataplex.assets (
lakesId,
locationsId,
projectsId,
zonesId,
displayName,
labels,
description,
resourceSpec,
discoverySpec
)
SELECT
'{{ lakesId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ zonesId }}',
'{{ displayName }}',
'{{ labels }}',
'{{ description }}',
'{{ resourceSpec }}',
'{{ discoverySpec }}'
;

UPDATE example

Updates a assets resource.

/*+ update */
UPDATE google.dataplex.assets
SET
displayName = '{{ displayName }}',
labels = '{{ labels }}',
description = '{{ description }}',
resourceSpec = '{{ resourceSpec }}',
discoverySpec = '{{ discoverySpec }}'
WHERE
assetsId = '{{ assetsId }}'
AND lakesId = '{{ lakesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND zonesId = '{{ zonesId }}';

DELETE example

Deletes the specified assets resource.

/*+ delete */
DELETE FROM google.dataplex.assets
WHERE assetsId = '{{ assetsId }}'
AND lakesId = '{{ lakesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND zonesId = '{{ zonesId }}';