Skip to content

Instantly share code, notes, and snippets.

@nov05
Last active May 12, 2026 23:54
Show Gist options
  • Select an option

  • Save nov05/5b3dca4d46a6f913c809c8d314117476 to your computer and use it in GitHub Desktop.

Select an option

Save nov05/5b3dca4d46a6f913c809c8d314117476 to your computer and use it in GitHub Desktop.

🟢 Create and Add Aspects to Knowledge Catalog Assets (GSP1145)

https://www.skills.google/games/7172/labs/44416

✅ Test result: the new script nov05_gsp1145.sh passed all 4 checks of the lab.

Welcome to Cloud Shell! Type "help" to get started, or type "gemini" to try prompting with Gemini CLI.
Your Cloud Platform project in this session is set to qwiklabs-gcp-00-552b9dbd1d54.
Use `gcloud config set project [PROJECT_ID]` to change to a different project.
student_02_5f732526960d@cloudshell:~ (qwiklabs-gcp-00-552b9dbd1d54)$ rm -f nov05_gsp1145.sh
curl -LO https://raw.githubusercontent.com/nov05/gcp-skills-boost/refs/heads/dev/GSP1145%20Create%20and%20Add%20Aspects%20to%20Knowledge%20Catalog%20Assets/nov05_gsp1145.sh
chmod +x nov05_gsp1145.sh
./nov05_gsp1145.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6692  100  6692    0     0  28241      0 --:--:-- --:--:-- --:--:-- 28355
Your active configuration is: [cloudshell-24724]
Your active configuration is: [cloudshell-24724]
Updated property [compute/region].

🔹  Project ID: qwiklabs-gcp-00-552b9dbd1d54
🔹  Project number: 84024950774
🔹  Region: us-west1
🔹  Zone: us-west1-a
🔹  User: student_02_5f732526960d

========================================================
Task 1. Create a lake, zone, and asset in Knowledge Catalog
========================================================

Operation "operations/acat.p2-84024950774-3a685c08-38df-47da-803b-7f5657f0da34" finished successfully.
Waiting for [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/operations/operation-1778629005674-651a75612073a-a5c1a7b7-f721df53] to finish...done.                                   
Created [orders-lake] Lake created in [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1].
Waiting for [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/operations/operation-1778629174069-651a7601b89f5-db778b11-b763e501] to finish...done.                                   
Created [customer-curated-zone] Zone created in [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/lakes/orders-lake].
Waiting for [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/operations/operation-1778629184918-651a760c1146a-5831bd96-cc815c8b] to finish...done.                                   
Created [customer-details-dataset] Asset created in [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/lakes/orders-lake/zones/customer-curated-zone].

👉  Data lake list:
NAME: orders-lake
DISPLAY_NAME: Orders Lake
LAKE_STATUS: ACTIVE
METASTORE_STATUS: NONE
METASTORE: 
SECURITY_STATUS: 
ACTIVE_ASSETS: 
LABELS: 

👉  Data zone list:
NAME: customer-curated-zone
DISPLAY_NAME: Customer Curated Zone
ZONE_STATUS: ACTIVE
ZONE_TYPE: CURATED
RESOURCE_LOCATION_TYPE: SINGLE_REGION
DISCOVERY_ENABLED: 
SECURITY_STATUS: 
ACTIVE_ASSETS: 
LABELS: 

👉  Data asset list:
NAME: customer-details-dataset
DISPLAY_NAME: Customer Details Dataset
ASSET_STATUS: ACTIVE
DISCOVERY_ENABLED: 
DISCOVERY_STATUS: DISABLED
RESOURCE_NAME: projects/qwiklabs-gcp-00-552b9dbd1d54/datasets/customers
RESOURCE_TYPE: BIGQUERY_DATASET
RESOURCE_STATE: READY
SECURITY_STATUS: READY
LABELS: 

========================================================
Task 2. Create an aspect type
========================================================
https://docs.cloud.google.com/dataplex/docs/enrich-entries-metadata#gcloud

Waiting for [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/operations/operation-1778629231859-651a7638d558e-9eeabb8a-b8e93519] to finish...done.                                   
Created [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/aspectTypes/protected-data-aspect] Aspect Type created in project [qwiklabs-gcp-00-552b9dbd1d54] with location [us-west1].
authorization: {}
createTime: '2026-05-12T23:40:31.934272113Z'
displayName: Protected Data Aspect
etag: Tt53nBZsJwPQTH1zRhQkVrKVvScnehsrM-q2B5J3rZI
metadataTemplate:
  name: protected_data_template
  recordFields:
  - annotations:
      displayName: Protected Data Flag
    constraints:
      required: true
    enumValues:
    - index: 1
      name: Yes
    - index: 2
      name: No
    index: 1
    name: protected_data_flag
    type: enum
  type: record
name: projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/aspectTypes/protected-data-aspect
uid: 838825eb-e7fe-42f4-8ee6-a2c50787dd71
updateTime: '2026-05-12T23:40:33.451675068Z'

👉  Check entry list:
ENTRY_ID: protected-data-aspect_aspectType
SOURCE_LOCATION: us-west1
DISPLAY_NAME: Protected Data Aspect
DESCRIPTION: 
RESOURCE: projects/84024950774/locations/us-west1/aspectTypes/protected-data-aspect
SYSTEM: Dataplex
PLATFORM: GCP
LABELS: 
ANCESTORS: 
ENTRY_TYPE: projects/655216118709/locations/global/entryTypes/aspecttype
ENTRY_CREATE_TIME: 2026-05-12T23:40:33.594437Z
ENTRY_UPDATE_TIME: 2026-05-12T23:40:33.594437Z
PARENT_ENTRY: 
FULLY_QUALIFIED_NAME: 
SOURCE_CREATE_TIME: 2026-05-12T23:40:33.432189Z
SOURCE_UPDATE_TIME: 2026-05-12T23:40:33.432189Z

ENTRY_ID: @dataplex_entry
SOURCE_LOCATION: us-west1
DISPLAY_NAME: 
DESCRIPTION: 
RESOURCE: projects/84024950774/locations/us-west1/entryGroups/@dataplex
SYSTEM: Dataplex
PLATFORM: GCP
LABELS: 
ANCESTORS: 
ENTRY_TYPE: projects/655216118709/locations/global/entryTypes/entrygroup
ENTRY_CREATE_TIME: 2026-05-12T23:40:33.555598Z
ENTRY_UPDATE_TIME: 2026-05-12T23:40:35.886278Z
PARENT_ENTRY: 
FULLY_QUALIFIED_NAME: 
SOURCE_CREATE_TIME: 2026-05-12T23:40:34.762505Z
SOURCE_UPDATE_TIME: 2026-05-12T23:40:34.762505Z

👉  Check entry protected-data-aspect_aspectType:
aspects:
  655216118709.global.aspecttype-aspect:
    aspectSource: {}
    aspectType: projects/655216118709/locations/global/aspectTypes/aspecttype-aspect
    createTime: '2026-05-12T23:40:33.594437Z'
    data: {}
    updateTime: '2026-05-12T23:40:33.594437Z'
createTime: '2026-05-12T23:40:33.594437Z'
entrySource:
  createTime: '2026-05-12T23:40:33.432189Z'
  displayName: Protected Data Aspect
  location: us-west1
  platform: GCP
  resource: projects/84024950774/locations/us-west1/aspectTypes/protected-data-aspect
  system: Dataplex
  updateTime: '2026-05-12T23:40:33.432189Z'
entryType: projects/655216118709/locations/global/entryTypes/aspecttype
name: projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/entryGroups/@dataplex/entries/protected-data-aspect_aspectType
updateTime: '2026-05-12T23:40:33.594437Z'

========================================================
Task 3. Add an aspect to assets
========================================================
https://docs.cloud.google.com/dataplex/docs/enrich-entries-metadata#gcloud
https://docs.cloud.google.com/sdk/gcloud/reference/dataplex/entries/update

👉  Check aspect-patch.json:
{
  "qwiklabs-gcp-00-552b9dbd1d54.us-west1.protected-data-aspect": {
    "data": {
      "protected_data_flag": "Yes",
    }
  },
  "qwiklabs-gcp-00-552b9dbd1d54.us-west1.protected-data-aspect@Schema.zip": {
    "data": {
      "protected_data_flag": "Yes",
    }
  },
  "qwiklabs-gcp-00-552b9dbd1d54.us-west1.protected-data-aspect@Schema.state": {
    "data": {
      "protected_data_flag": "Yes",
      "protected_data_flag": "Yes",
    }
  },
  "qwiklabs-gcp-00-552b9dbd1d54.us-west1.protected-data-aspect@Schema.city": {
    "data": {
      "protected_data_flag": "Yes",
    }
  },
  "qwiklabs-gcp-00-552b9dbd1d54.us-west1.protected-data-aspect@Schema.longitude": {
    "data": {
      "protected_data_flag": "Yes",
    }
  },
}
Updated entry [projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-552b9dbd1d54/datasets/customers/tables/customer_details].

========================================================
Task 4. Search for assets using aspects
========================================================

student_02_5f732526960d@cloudshell:~ (qwiklabs-gcp-00-552b9dbd1d54)$ 
@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

🟢⚠️ Issue solved: lake, zone, asset created by gcloud, however the lab check says the task is still running.

Bug fix: RESOURCE_NAME: projects/qwiklabs-gcp-02-b1482ef10305/datasets/customers

gcloud dataplex assets create customer-details-dataset \
  --project=$PROJECT_ID \
  --location=$REGION \
  --lake=orders-lake \
  --zone=customer-curated-zone \
  --display-name="Customer Details Dataset" \
  --resource-type=BIGQUERY_DATASET \
  --resource-name="projects/$PROJECT_ID/datasets/customers"
Waiting for [projects/qwiklabs-gcp-02-b1482ef10305/locations/us-west1/operations/operation-1778604365546-651a19967832a-e8db1fe8-fb436f8a] to finish...done.                                   
Created [orders-lake] Lake created in [projects/qwiklabs-gcp-02-b1482ef10305/locations/us-west1].
Waiting for [projects/qwiklabs-gcp-02-b1482ef10305/locations/us-west1/operations/operation-1778604513927-651a1a23fa02f-e25c6bb5-bbd5bdd3] to finish...done.                                   
Created [customer-curated-zone] Zone created in [projects/qwiklabs-gcp-02-b1482ef10305/locations/us-west1/lakes/orders-lake].
Waiting for [projects/qwiklabs-gcp-02-b1482ef10305/locations/us-west1/operations/operation-1778604523232-651a1a2cd9cda-0a9ba077-23688253] to finish...done.                                   
Created [customer-details-dataset] Asset created in [projects/qwiklabs-gcp-02-b1482ef10305/locations/us-west1/lakes/orders-lake/zones/customer-curated-zone].

👉  Data lake list:
NAME: orders-lake
DISPLAY_NAME: Orders Lake
LAKE_STATUS: ACTIVE
METASTORE_STATUS: NONE
METASTORE: 
SECURITY_STATUS: 
ACTIVE_ASSETS: 
LABELS: 

👉  Data zone list:
NAME: customer-curated-zone
DISPLAY_NAME: Customer Curated Zone
ZONE_STATUS: ACTIVE
ZONE_TYPE: CURATED
RESOURCE_LOCATION_TYPE: SINGLE_REGION
DISCOVERY_ENABLED: 
SECURITY_STATUS: 
ACTIVE_ASSETS: 
LABELS: 

👉  Data asset list:
NAME: customer-details-dataset
DISPLAY_NAME: Customer Details Dataset
ASSET_STATUS: ACTIVE
DISCOVERY_ENABLED: 
DISCOVERY_STATUS: DISABLED
RESOURCE_NAME: //bigquery.googleapis.com/projects/qwiklabs-gcp-02-b1482ef10305/datasets/customers ❌
RESOURCE_TYPE: BIGQUERY_DATASET
RESOURCE_STATE: READY
SECURITY_STATUS: READY
LABELS: 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

✅ this works

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://dataplex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  -d '{
    "query": "*"
  }'

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

✅ this works

echo -e "\n👉  Check entry $ASPECT_ENTRY_ID:"
gcloud dataplex entries describe $ASPECT_ENTRY_ID \
  --location=$REGION \
  --entry-group=@dataplex
👉 Check entry protected-data-aspect_aspectType:
aspects:
  655216118709.global.aspecttype-aspect:
    aspectSource: {}
    aspectType: projects/655216118709/locations/global/aspectTypes/aspecttype-aspect
    createTime: '2026-05-12T20:29:12.980913Z'
    data: {}
    updateTime: '2026-05-12T20:29:12.980913Z'
createTime: '2026-05-12T20:29:12.980913Z'
entrySource:
  createTime: '2026-05-12T20:29:12.666907Z'
  displayName: Protected Data Aspect
  location: us-west1
  platform: GCP
  resource: projects/947219809049/locations/us-west1/aspectTypes/protected-data-aspect
  system: Dataplex
  updateTime: '2026-05-12T20:29:12.666907Z'
entryType: projects/655216118709/locations/global/entryTypes/aspecttype
name: projects/qwiklabs-gcp-03-463fdd1be952/locations/us-west1/entryGroups/@dataplex/entries/protected-data-aspect_aspectType
updateTime: '2026-05-12T20:29:12.980913Z'
student_02_bffc2643ef04@cloudshell:~ (qwiklabs-gcp-03-463fdd1be952)$ 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

✅ this works

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://dataplex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  -d '{
    "query": "customer_details"
  }'
{   "query": "customer_details"
  "results": [
    {
      "dataplexEntry": {
        "name": "projects/43686586334/locations/us-central1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-5f1da19cc96c/datasets/customers/tables/customer_details",
        "entryType": "projects/655216118709/locations/global/entryTypes/bigquery-table",
        "createTime": "2026-05-12T20:46:41Z",
        "updateTime": "2026-05-12T21:16:22Z",
        "parentEntry": "projects/qwiklabs-gcp-00-5f1da19cc96c/locations/us-central1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-5f1da19cc96c/datasets/customers",
        "fullyQualifiedName": "bigquery:qwiklabs-gcp-00-5f1da19cc96c.customers.customer_details",
        "entrySource": {
          "resource": "projects/qwiklabs-gcp-00-5f1da19cc96c/datasets/customers/tables/customer_details",
          "system": "BIGQUERY",
          "displayName": "customer_details",
          "description": "Customers= Details Table",
          "createTime": "2026-05-12T20:46:40Z",
          "updateTime": "2026-05-12T20:46:44Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    }
  ],
  "totalSize": 1
}
student_04_fa2e66c56c16@cloudshell:~ (qwiklabs-gcp-00-5f1da19cc96c)$ 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

✅ this works. check the result on console: Knowledge Catalog -> Search -> system = bigquery -> search for "customer_details".
then you will find the aspect is added to the table.

## The proper format is "project.location.aspectType"
cat > aspect-patch.json <<EOF
{
  "$PROJECT_ID.$REGION.protected-data-aspect": {
    "data": {
      "protected_data_flag": "Yes",
    }
  }
}
EOF
echo -e "👉  Check aspect-patch.json:"
cat aspect-patch.json
gcloud dataplex entries update \
  "bigquery.googleapis.com/projects/$PROJECT_ID/datasets/customers/tables/customer_details" \
  --location="$REGION" \
  --entry-group="@bigquery" \
  --update-aspects=aspect-patch.json
👉  Check aspect-patch.json:
{
  "qwiklabs-gcp-02-2c4ccf81f2bd.us-west1.protected-data-aspect": {
    "data": {
      "protected_data_flag": "Yes",
    }
  }
}
Updated entry [projects/qwiklabs-gcp-02-2c4ccf81f2bd/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers/tables/customer_details].
student_01_6f179ba1fa60@cloudshell:~ (qwiklabs-gcp-02-2c4ccf81f2bd)$ 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

✅ this works

gcloud dataplex entries describe \
  "bigquery.googleapis.com/projects/$PROJECT_ID/datasets/customers/tables/customer_details" \
  --location="$REGION" \
  --entry-group="@bigquery"
student_01_6f179ba1fa60@cloudshell:~ (qwiklabs-gcp-02-2c4ccf81f2bd)$ gcloud dataplex entries describe \
  "bigquery.googleapis.com/projects/$PROJECT_ID/datasets/customers/tables/customer_details" \
  --location="$REGION" \
  --entry-group="@bigquery"
aspects:
  655216118709.global.bigquery-policy: {}
  655216118709.global.bigquery-table:
    aspectSource:
      createTime: '2026-05-12T21:32:53.505Z'
      dataVersion: Ingestion/1.0.0
      updateTime: '2026-05-12T21:32:56.922Z'
    aspectType: projects/655216118709/locations/global/aspectTypes/bigquery-table
    createTime: '2026-05-12T21:32:54.682489Z'
    data:
      tableType: TABLE
      type: TABLE
    updateTime: '2026-05-12T21:32:57.276783Z'
  655216118709.global.schema:
    aspectSource:
      createTime: '2026-05-12T21:32:53.505Z'
      dataVersion: Ingestion/1.0.0
      updateTime: '2026-05-12T21:32:56.922Z'
    aspectType: projects/655216118709/locations/global/aspectTypes/schema
    createTime: '2026-05-12T21:32:54.682489Z'
    data:
      fields:
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: traffic_source
      - dataType: TIMESTAMP
        description: bq-datetime
        metadataType: OTHER
        mode: NULLABLE
        name: created_at
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: zip
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: state
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: last_name
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: country
      - dataType: INTEGER
        metadataType: NUMBER
        mode: NULLABLE
        name: age
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: email
      - dataType: FLOAT
        metadataType: NUMBER
        mode: NULLABLE
        name: latitude
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: first_name
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: city
      - dataType: FLOAT
        metadataType: NUMBER
        mode: NULLABLE
        name: longitude
      - dataType: STRING
        metadataType: STRING
        mode: NULLABLE
        name: gender
      - dataType: INTEGER
        metadataType: NUMBER
        mode: NULLABLE
        name: id
    updateTime: '2026-05-12T21:32:57.276783Z'
  655216118709.global.storage:
    aspectSource:
      createTime: '2026-05-12T21:32:53.505Z'
      dataVersion: Ingestion/1.0.0
      updateTime: '2026-05-12T21:32:56.922Z'
    aspectType: projects/655216118709/locations/global/aspectTypes/storage
    createTime: '2026-05-12T21:32:54.682489Z'
    data:
      resourceName: //bigquery.googleapis.com/projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers/tables/customer_details
      service: BIGQUERY
    updateTime: '2026-05-12T21:32:57.276783Z'
  666666772278.us-west1.protected-data-aspect: {}
createTime: '2026-05-12T21:32:54.682489Z'
entrySource:
  ancestors:
  - name: projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers
    type: dataplex-types.global.bigquery-dataset
  createTime: '2026-05-12T21:32:53.505Z'
  description: Customers= Details Table
  displayName: customer_details
  location: us-west1
  platform: GCP
  resource: projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers/tables/customer_details
  system: BIGQUERY
  updateTime: '2026-05-12T21:32:56.922Z'
entryType: projects/655216118709/locations/global/entryTypes/bigquery-table
fullyQualifiedName: bigquery:qwiklabs-gcp-02-2c4ccf81f2bd.customers.customer_details
name: projects/qwiklabs-gcp-02-2c4ccf81f2bd/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers/tables/customer_details
parentEntry: projects/qwiklabs-gcp-02-2c4ccf81f2bd/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers
updateTime: '2026-05-12T22:09:20.066615Z'
student_01_6f179ba1fa60@cloudshell:~ (qwiklabs-gcp-02-2c4ccf81f2bd)$ 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

❌ doesn't work.

student_01_6f179ba1fa60@cloudshell:~ (qwiklabs-gcp-02-2c4ccf81f2bd)$ gcloud dataplex entries update \
  "bigquery.googleapis.com/projects/$PROJECT_ID/datasets/customers/tables/customer_details/columns/id" \
  --location="$REGION" \
  --entry-group="@bigquery" \
  --update-aspects=aspect-patch.json
ERROR: (gcloud.dataplex.entries.update) Status code: 403. Permission denied on resource `projects/qwiklabs-gcp-02-2c4ccf81f2bd/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-02-2c4ccf81f2bd/datasets/customers/tables/customer_details/columns/id` (or it may not exist). This command is authenticated as student-01-6f179ba1fa60@qwiklabs.net which is the active account specified by the [core/account] property..
student_01_6f179ba1fa60@cloudshell:~ (qwiklabs-gcp-02-2c4ccf81f2bd)$ 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

✅ these 2 works

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://dataplex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  -d '{
    "query": "*"
  }'

and

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://dataplex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  -d '{
    "query": "Protected Data Aspect"
  }'

student_03_f82e488f0972@cloudshell:~ (qwiklabs-gcp-00-e97ac45440c8)$ curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \                              curl -X POST \
  "https://dataplex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  -d '{ontent-Type: application/json" \
    "query": "*"lex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  }' '{
{   "query": "*"
  "results": [
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@dataplex/entries/@dataplex_entry",
        "entryType": "projects/655216118709/locations/global/entryTypes/entrygroup",
        "createTime": "2026-05-12T22:47:45Z",
        "updateTime": "2026-05-12T22:47:47Z",
        "entrySource": {
          "resource": "projects/170469760888/locations/us-central1/entryGroups/@dataplex",
          "system": "Dataplex",
          "createTime": "2026-05-12T22:47:46Z",
          "updateTime": "2026-05-12T22:47:46Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    },
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@dataplex/entries/protected-data-aspect_aspectType",
        "entryType": "projects/655216118709/locations/global/entryTypes/aspecttype",
        "createTime": "2026-05-12T22:47:45Z",
        "updateTime": "2026-05-12T22:47:45Z",
        "entrySource": {
          "resource": "projects/170469760888/locations/us-central1/aspectTypes/protected-data-aspect",
          "system": "Dataplex",
          "displayName": "Protected Data Aspect",
          "createTime": "2026-05-12T22:47:44Z",
          "updateTime": "2026-05-12T22:47:44Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    },
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customers",
        "entryType": "projects/655216118709/locations/global/entryTypes/bigquery-dataset",
        "createTime": "2026-05-12T21:36:25Z",
        "updateTime": "2026-05-12T22:47:01Z",
        "fullyQualifiedName": "bigquery:qwiklabs-gcp-00-e97ac45440c8.customers",
        "entrySource": {
          "resource": "projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customers",
          "system": "BIGQUERY",
          "displayName": "Customers",
          "description": "BigQuery dataset for customer data",
          "labels": {
            "goog-dataplex-project-id": "qwiklabs-gcp-00-e97ac45440c8",
            "goog-dataplex-zone-id": "customer-curated-zone",
            "goog-dataplex-lake-id": "orders-lake",
            "goog-dataplex-asset-id": "customer-details-dataset",
            "env": "prod"
          },
          "createTime": "2026-05-12T21:36:24Z",
          "updateTime": "2026-05-12T22:47:01Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    },
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customer_curated_zone",
        "entryType": "projects/655216118709/locations/global/entryTypes/bigquery-dataset",
        "createTime": "2026-05-12T22:46:50Z",
        "updateTime": "2026-05-12T22:46:50Z",
        "fullyQualifiedName": "bigquery:qwiklabs-gcp-00-e97ac45440c8.customer_curated_zone",
        "entrySource": {
          "resource": "projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customer_curated_zone",
          "system": "BIGQUERY",
          "displayName": "customer_curated_zone",
          "labels": {
            "goog-dataplex-zone-id": "customer-curated-zone",
            "goog-dataplex-project-id": "qwiklabs-gcp-00-e97ac45440c8",
            "goog-dataplex-lake-id": "orders-lake"
          },
          "createTime": "2026-05-12T22:46:49Z",
          "updateTime": "2026-05-12T22:46:49Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    },
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customers/tables/customer_details",
        "entryType": "projects/655216118709/locations/global/entryTypes/bigquery-table",
        "createTime": "2026-05-12T21:36:25Z",
        "updateTime": "2026-05-12T22:47:56Z",
        "parentEntry": "projects/qwiklabs-gcp-00-e97ac45440c8/locations/us-central1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customers",
        "fullyQualifiedName": "bigquery:qwiklabs-gcp-00-e97ac45440c8.customers.customer_details",
        "entrySource": {
          "resource": "projects/qwiklabs-gcp-00-e97ac45440c8/datasets/customers/tables/customer_details",
          "system": "BIGQUERY",
          "displayName": "customer_details",
          "description": "Customers= Details Table",
          "createTime": "2026-05-12T21:36:24Z",
          "updateTime": "2026-05-12T21:36:28Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    },
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@bigquery/entries/@bigquery_entry",
        "entryType": "projects/655216118709/locations/global/entryTypes/entrygroup",
        "createTime": "2026-05-12T21:36:25Z",
        "updateTime": "2026-05-12T21:36:25Z",
        "entrySource": {
          "resource": "projects/170469760888/locations/us-central1/entryGroups/@bigquery",
          "system": "Dataplex",
          "location": "us-central1"
        }
      },
      "snippets": {}
    }
  ],
  "totalSize": 137,
  "nextPageToken": "CqQECgt1cy1jZW50cmFsMRKUBEV2c0NDanRFUlVaQlZVeFVYeTl6Y0dGdUwyZHNiMkpoYkM5amJHOTFaQzFrWVhSaGNHeGxlQzF0WkhNdFpHSTZjSEp2WkMxMWN5MWpaVzUwY21Gc01SSzdBZ3FFQVRBc1ZFbE5SVk5VUVUxUUlDSXlNREkyTFRBMUxURXlJREl4T2pNMk9qSTFLekF3SWl3eE56QTBOamszTmpBNE9EZ3NJa0JpYVdkeGRXVnllVjlsYm5SeWVTSXNJblZ6TFdObGJuUnlZV3d4SWl3aVFHSnBaM0YxWlhKNUlpd2labVJrTlROaE56Y3RNVEZoT0MwME9HSmxMV0psWTJVdFpEWmpNVFJoTUdFMlpUVmhJaEt4QVFGdHVwMDUybjFDVmRnTUZtM0JqZkZ2TUZpbkVPOTlaS1M0eXRGNFFUT1hTdHFGWFJsUy9Rc25veldXMEZhRXY5dnFidU8vZ2JEN0taajJLdlpQTDFWRUIwVW04MUpKSFU1RDkzNFlHNmMzNVRHVExMeXgveU9IZjdRRDM4RFRJa3Q2Zm5oWU44bGNwRXpXOFNsaUNlMXIzcDh1S1IxZStsM1BSSzZKMURmSHVZSWtnem85WW5hb3VQaHlvV1kyMlg2UDFiTElIOFZFQ2JGN3dsK1dONURLcjBmQlhDMUwzRHl3U3p4UFVGc3pBQm9DQ0FFb3ArQ21yL0cwbEFNd0JqZ0I="
student_03_f82e488f0972@cloudshell:~ (qwiklabs-gcp-00-e97ac45440c8)$ curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \c8)$ 
  -H "Content-Type: application/json" \wiklabs-gcp-00-e97ac45440c8)$ curl -X POST \
  "https://dataplex.googleapis.com/v1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
  -d '{ontent-Type: application/json" \
    "query": "Protected Data Aspect"1/projects/$PROJECT_ID/locations/$REGION:searchEntries" \
    {
      "dataplexEntry": {
        "name": "projects/170469760888/locations/us-central1/entryGroups/@dataplex/entries/protected-data-aspect_aspectType",
        "entryType": "projects/655216118709/locations/global/entryTypes/aspecttype",
        "createTime": "2026-05-12T22:47:45Z",
        "updateTime": "2026-05-12T22:47:45Z",
        "entrySource": {
          "resource": "projects/170469760888/locations/us-central1/aspectTypes/protected-data-aspect",
          "system": "Dataplex",
          "displayName": "Protected Data Aspect",
          "createTime": "2026-05-12T22:47:44Z",
          "updateTime": "2026-05-12T22:47:44Z",
          "location": "us-central1"
        }
      },
      "snippets": {}
    }
  ],
  "totalSize": 1
}
student_03_f82e488f0972@cloudshell:~ (qwiklabs-gcp-00-e97ac45440c8)$ 

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

student_02_5f732526960d@cloudshell:~ (qwiklabs-gcp-00-552b9dbd1d54)$ gcloud dataplex entries search 'protected-data-aspect' --project=$PROJECT_ID
---
createTime: '2026-05-12T23:40:33Z'
entrySource:
  createTime: '2026-05-12T23:40:33Z'
  displayName: Protected Data Aspect
  location: us-west1
  resource: projects/84024950774/locations/us-west1/aspectTypes/protected-data-aspect
  system: Dataplex
  updateTime: '2026-05-12T23:40:33Z'
entryType: projects/655216118709/locations/global/entryTypes/aspecttype
name: projects/84024950774/locations/us-west1/entryGroups/@dataplex/entries/protected-data-aspect_aspectType
updateTime: '2026-05-12T23:40:33Z'

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

gcloud dataplex entries search 'customer_details' --project=$PROJECT_ID

student_02_5f732526960d@cloudshell:~ (qwiklabs-gcp-00-552b9dbd1d54)$ gcloud dataplex entries search 'customer_details' --project=$PROJECT_ID
---                                                                  gcloud dataplex entries search 'customer_details' --project=$PROJECT_ID
createTime: '2026-05-12T22:55:13Z'
entrySource:
  createTime: '2026-05-12T22:55:10Z'
  description: Customers= Details Table
  displayName: customer_details
  location: us-west1
  resource: projects/qwiklabs-gcp-00-552b9dbd1d54/datasets/customers/tables/customer_details
  system: BIGQUERY
  updateTime: '2026-05-12T22:55:13Z'
entryType: projects/655216118709/locations/global/entryTypes/bigquery-table
fullyQualifiedName: bigquery:qwiklabs-gcp-00-552b9dbd1d54.customers.customer_details
name: projects/84024950774/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-552b9dbd1d54/datasets/customers/tables/customer_details
parentEntry: projects/qwiklabs-gcp-00-552b9dbd1d54/locations/us-west1/entryGroups/@bigquery/entries/bigquery.googleapis.com/projects/qwiklabs-gcp-00-552b9dbd1d54/datasets/customers
updateTime: '2026-05-12T23:40:45Z'

@nov05

nov05 commented May 12, 2026

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment