\
--member=serviceAccount:$TAG_CREATOR_SA' \
--role=roles/storage.legacyBucketReader
```
-
-12. Build and deploy the Cloud Run services:
+13. Build and deploy the Cloud Run services:
There is one Cloud Run service for the API (`tag-engine-api`) and another for the UI (`tag-engine-ui`). They are both built from the same code base. You can build either one or the other, depending on your needs. The majority of Tag Engine customers use the API service and a few of them also use the UI service.
@@ -274,10 +282,7 @@ If multiple teams want to share a single instance of Tag Engine and they own dif
--service-account=$TAG_ENGINE_SA
```
-
-
-
-11. Set the `SERVICE_URL` environment variable:
+14. Set the `SERVICE_URL` environment variable:
If you are deploying the API, you also need to set the environment variable SERVICE_URL on `tag-engine-api`:
@@ -295,8 +300,6 @@ If multiple teams want to share a single instance of Tag Engine and they own dif
gcloud run services update tag-engine-ui --set-env-vars SERVICE_URL=$UI_SERVICE_URL
```
-
-
This completes the manual setup for Tag Engine. Please consult [Part 2](https://github.com/GoogleCloudPlatform/datacatalog-tag-engine#testa) and [Part 3](https://github.com/GoogleCloudPlatform/datacatalog-tag-engine#testb) for testing your installation and further steps.
diff --git a/examples/configs/import/CSV_import_template.xlsx b/examples/configs/import/README.xlsx
similarity index 100%
rename from examples/configs/import/CSV_import_template.xlsx
rename to examples/configs/import/README.xlsx
diff --git a/examples/configs/import/finwire_import_column_tags.json b/examples/configs/import/bigquery_column_config.json
similarity index 50%
rename from examples/configs/import/finwire_import_column_tags.json
rename to examples/configs/import/bigquery_column_config.json
index de10c6f..264f50c 100644
--- a/examples/configs/import/finwire_import_column_tags.json
+++ b/examples/configs/import/bigquery_column_config.json
@@ -2,6 +2,8 @@
"template_id": "compliance_template",
"template_project": "tag-engine-run",
"template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/finwire_column_tags.csv",
+ "metadata_import_location": "gs://tag-import/latest/bigquery_column_tags.csv",
+ "data_asset_type": "bigquery",
+ "data_asset_region": "us-central1",
"overwrite": true
}
diff --git a/examples/configs/import/finwire_column_tags.csv b/examples/configs/import/bigquery_column_tags.csv
similarity index 100%
rename from examples/configs/import/finwire_column_tags.csv
rename to examples/configs/import/bigquery_column_tags.csv
diff --git a/examples/configs/import/bigquery_dataset_config.json b/examples/configs/import/bigquery_dataset_config.json
new file mode 100644
index 0000000..6e59535
--- /dev/null
+++ b/examples/configs/import/bigquery_dataset_config.json
@@ -0,0 +1,9 @@
+{
+ "template_id": "data_governance",
+ "template_project": "tag-engine-run",
+ "template_region": "us-central1",
+ "metadata_import_location": "gs://tag-import/latest/bigquery_dataset_tags.csv",
+ "data_asset_type": "bigquery",
+ "data_asset_region": "us-central1",
+ "overwrite": true
+}
diff --git a/examples/configs/import/sakila_dataset_tag.csv b/examples/configs/import/bigquery_dataset_tags.csv
similarity index 100%
rename from examples/configs/import/sakila_dataset_tag.csv
rename to examples/configs/import/bigquery_dataset_tags.csv
diff --git a/examples/configs/import/bigquery_table_config.json b/examples/configs/import/bigquery_table_config.json
new file mode 100644
index 0000000..ca884ae
--- /dev/null
+++ b/examples/configs/import/bigquery_table_config.json
@@ -0,0 +1,9 @@
+{
+ "template_id": "data_governance",
+ "template_project": "tag-engine-run",
+ "template_region": "us-central1",
+ "metadata_import_location": "gs://tag-import/latest/bigquery_table_tags.csv",
+ "data_asset_type": "bigquery",
+ "data_asset_region": "us-central1",
+ "overwrite": true
+}
diff --git a/examples/configs/import/sakila_table_tags.csv b/examples/configs/import/bigquery_table_tags.csv
similarity index 100%
rename from examples/configs/import/sakila_table_tags.csv
rename to examples/configs/import/bigquery_table_tags.csv
diff --git a/examples/configs/import/fileset_column_config.json b/examples/configs/import/fileset_column_config.json
new file mode 100644
index 0000000..b1dad77
--- /dev/null
+++ b/examples/configs/import/fileset_column_config.json
@@ -0,0 +1,9 @@
+{
+ "template_id": "data_sensitivity",
+ "template_project": "tag-engine-run",
+ "template_region": "us-central1",
+ "metadata_import_location": "gs://tag-import/latest/fileset_column_tags.csv",
+ "data_asset_type": "fileset",
+ "data_asset_region": "us-central1",
+ "overwrite": true
+}
diff --git a/examples/configs/import/fileset_column_tags.csv b/examples/configs/import/fileset_column_tags.csv
new file mode 100644
index 0000000..aa2d4e7
--- /dev/null
+++ b/examples/configs/import/fileset_column_tags.csv
@@ -0,0 +1,7 @@
+project,entry_group,fileset,column,sensitive_field,sensitive_type
+tag-engine-run,sakila_eg,actor,first_name,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,sakila_eg,actor,last_name,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,sakila_eg,customer,first_name,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,sakila_eg,customer,last_name,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,sakila_eg,staff,first_name,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,sakila_eg,staff,last_name,TRUE,Sensitive_Personal_Identifiable_Information
diff --git a/examples/configs/import/fileset_table_config.json b/examples/configs/import/fileset_table_config.json
new file mode 100644
index 0000000..599b071
--- /dev/null
+++ b/examples/configs/import/fileset_table_config.json
@@ -0,0 +1,9 @@
+{
+ "template_id": "data_governance",
+ "template_project": "tag-engine-run",
+ "template_region": "us-central1",
+ "metadata_import_location": "gs://tag-import/latest/fileset_table_tags.csv",
+ "data_asset_type": "fileset",
+ "data_asset_region": "us-central1",
+ "overwrite": true
+}
diff --git a/examples/configs/import/sakila_fileset_tags.csv b/examples/configs/import/fileset_table_tags.csv
similarity index 100%
rename from examples/configs/import/sakila_fileset_tags.csv
rename to examples/configs/import/fileset_table_tags.csv
diff --git a/examples/configs/import/finwire_import_table_tags.json b/examples/configs/import/finwire_import_table_tags.json
deleted file mode 100644
index 322f56d..0000000
--- a/examples/configs/import/finwire_import_table_tags.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_discovery",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/finwire_table_tags.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/finwire_table_tags.csv b/examples/configs/import/finwire_table_tags.csv
deleted file mode 100644
index 234f8e9..0000000
--- a/examples/configs/import/finwire_table_tags.csv
+++ /dev/null
@@ -1,28 +0,0 @@
-project,dataset,table,data_domain,data_confidentiality,data_product_type,data_owner,operations_owner,data_location,ingestion_frequency
-tag-engine-run,finwire,FINWIRE1976Q1_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,finwire,FINWIRE1976Q1_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1976Q1_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1976Q2_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,finwire,FINWIRE1976Q2_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,finwire,FINWIRE1976Q2_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1976Q3_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1976Q3_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,finwire,FINWIRE1976Q3_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1976Q4_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1976Q4_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,finwire,FINWIRE1976Q4_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,finwire,FINWIRE1977Q1_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q1_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q1_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q2_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q2_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,finwire,FINWIRE1977Q2_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q3_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,finwire,FINWIRE1977Q3_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q3_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,finwire,FINWIRE1977Q4_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,finwire,FINWIRE1977Q4_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,finwire,FINWIRE1977Q4_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-
-
-
diff --git a/examples/configs/import/sakila_column_empty_config.json b/examples/configs/import/sakila_column_empty_config.json
deleted file mode 100644
index 3630848..0000000
--- a/examples/configs/import/sakila_column_empty_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_sensitivity",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_column_empty_values.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_column_empty_values.csv b/examples/configs/import/sakila_column_empty_values.csv
deleted file mode 100644
index 28182ce..0000000
--- a/examples/configs/import/sakila_column_empty_values.csv
+++ /dev/null
@@ -1,8 +0,0 @@
-project,dataset,table,column,sensitive_field,sensitive_type
-tag-engine-run,sakila_dw,actor,actor_id,,
-tag-engine-run,sakila_dw,actor,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,Middle_Name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,Initials,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,FULL_NAME,TRUE,SPII
-tag-engine-run,sakila_dw,actor,CONTRACT_NAME,,
\ No newline at end of file
diff --git a/examples/configs/import/sakila_column_tags.csv b/examples/configs/import/sakila_column_tags.csv
deleted file mode 100644
index 0eecb2d..0000000
--- a/examples/configs/import/sakila_column_tags.csv
+++ /dev/null
@@ -1,18 +0,0 @@
-project,dataset,table,column,sensitive_field,sensitive_type
-tag-engine-run,sakila_dw,actor,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,address,address,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,address,phone,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,customer,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,customer,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,customer,email,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,staff,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,staff,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,staff,picture,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,staff,email,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,staff,username,TRUE,Sensitive_Personal_Identifiable_Information
-tag-engine-run,sakila_dw,staff,password,TRUE,Sensitive_Personal_Identifiable_Information
-tag-engine-run,sakila_dw,city,city_id,,
-tag-engine-run,sakila_dw,city,city,,
-tag-engine-run,sakila_dw,city,country_id,FALSE,
-tag-engine-run,sakila_dw,city,last_update,FALSE,
\ No newline at end of file
diff --git a/examples/configs/import/sakila_column_tags_config.json b/examples/configs/import/sakila_column_tags_config.json
deleted file mode 100644
index d543013..0000000
--- a/examples/configs/import/sakila_column_tags_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_sensitivity",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_column_tags.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_column_tags_mix_config.json b/examples/configs/import/sakila_column_tags_mix_config.json
deleted file mode 100644
index d8f224b..0000000
--- a/examples/configs/import/sakila_column_tags_mix_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_sensitivity",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_column_tags_mixed.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_column_tags_mixed.csv b/examples/configs/import/sakila_column_tags_mixed.csv
deleted file mode 100644
index 9d3bbf4..0000000
--- a/examples/configs/import/sakila_column_tags_mixed.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-project,dataset,table,column,sensitive_field,sensitive_type
-tag-engine-run,sakila_dw,actor,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,Middle_Name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,Initials,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_dw,actor,FULL_NAME,TRUE,Personal_Identifiable_Information
\ No newline at end of file
diff --git a/examples/configs/import/sakila_dataset_config.json b/examples/configs/import/sakila_dataset_config.json
deleted file mode 100644
index c21cf2a..0000000
--- a/examples/configs/import/sakila_dataset_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_governance",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_dataset_tag.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_fileset_column_config.json b/examples/configs/import/sakila_fileset_column_config.json
deleted file mode 100644
index b9db0de..0000000
--- a/examples/configs/import/sakila_fileset_column_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_sensitivity",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_fileset_column_tags.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_fileset_column_nested.csv b/examples/configs/import/sakila_fileset_column_nested.csv
deleted file mode 100644
index d34003e..0000000
--- a/examples/configs/import/sakila_fileset_column_nested.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-project,entry_group,fileset,column,sensitive_field,sensitive_type
-tag-engine-run,sakila_eg,address,address,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,phone,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,phone.area_code,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,phone.phone_number,TRUE,Personal_Identifiable_Information
diff --git a/examples/configs/import/sakila_fileset_column_tags.csv b/examples/configs/import/sakila_fileset_column_tags.csv
deleted file mode 100644
index ad11457..0000000
--- a/examples/configs/import/sakila_fileset_column_tags.csv
+++ /dev/null
@@ -1,20 +0,0 @@
-project,entry_group,fileset,column,sensitive_field,sensitive_type
-tag-engine-run,sakila_eg,actor,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,actor,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,address,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,phone,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,phone.area_code,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,address,phone.phone_number,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,customer,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,customer,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,customer,email,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,staff,first_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,staff,last_name,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,staff,picture,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,staff,email,TRUE,Personal_Identifiable_Information
-tag-engine-run,sakila_eg,staff,username,TRUE,Sensitive_Personal_Identifiable_Information
-tag-engine-run,sakila_eg,staff,password,TRUE,Sensitive_Personal_Identifiable_Information
-tag-engine-run,sakila_eg,city,city_id,FALSE,
-tag-engine-run,sakila_eg,city,city,FALSE,
-tag-engine-run,sakila_eg,city,country_id,FALSE,
-tag-engine-run,sakila_eg,city,last_update,FALSE,
\ No newline at end of file
diff --git a/examples/configs/import/sakila_fileset_config.json b/examples/configs/import/sakila_fileset_config.json
deleted file mode 100644
index 72e2c91..0000000
--- a/examples/configs/import/sakila_fileset_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_governance",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_fileset_tags.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_table_missing_dataset_table.csv b/examples/configs/import/sakila_table_missing_dataset_table.csv
deleted file mode 100644
index 545b0b0..0000000
--- a/examples/configs/import/sakila_table_missing_dataset_table.csv
+++ /dev/null
@@ -1,16 +0,0 @@
-project,data_domain,broad_data_category,environment,data_origin,data_creation,data_ownership,data_asset_owner,data_confidentiality,data_retention,data_asset_documentation
-tag-engine-run,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,OPERATIONS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,OPERATIONS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-tag-engine-run,OPERATIONS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
\ No newline at end of file
diff --git a/examples/configs/import/sakila_table_missing_dataset_table.json b/examples/configs/import/sakila_table_missing_dataset_table.json
deleted file mode 100644
index 79d81f1..0000000
--- a/examples/configs/import/sakila_table_missing_dataset_table.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_governance",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_table_missing_dataset_table.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_table_missing_project.csv b/examples/configs/import/sakila_table_missing_project.csv
deleted file mode 100644
index 74f99b6..0000000
--- a/examples/configs/import/sakila_table_missing_project.csv
+++ /dev/null
@@ -1,17 +0,0 @@
-dataset,table,data_domain,broad_data_category,environment,data_origin,data_creation,data_ownership,data_asset_owner,data_confidentiality,data_retention,data_asset_documentation
-sakila_dw,actor,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,address,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,category,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,city,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,country,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,customer,LOGISTICS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,John Smith,PUBLIC,90_DAYS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,film,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,film_actor,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,film_category,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,film_text,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,inventory,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,language,MARKETING,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,payment,OPERATIONS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,rental,OPERATIONS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,staff,OPERATIONS,CONTENT,DEV,OPEN_DATA, 2023-11-10,THIRD_PARTY_OPS,Emily Doe,PUBLIC,2_YEARS,https://dev.mysql.com/doc/sakila/en/sakila-structure.html
-sakila_dw,store,,,,,,,,,,
\ No newline at end of file
diff --git a/examples/configs/import/sakila_table_missing_project.json b/examples/configs/import/sakila_table_missing_project.json
deleted file mode 100644
index 87df020..0000000
--- a/examples/configs/import/sakila_table_missing_project.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_governance",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_table_missing_project.csv",
- "overwrite": true
-}
diff --git a/examples/configs/import/sakila_table_tags_config.json b/examples/configs/import/sakila_table_tags_config.json
deleted file mode 100644
index 9641fa9..0000000
--- a/examples/configs/import/sakila_table_tags_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "template_id": "data_governance",
- "template_project": "tag-engine-run",
- "template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_table_tags.csv",
- "overwrite": false
-}
diff --git a/examples/configs/import/spanner_column_config.json b/examples/configs/import/spanner_column_config.json
new file mode 100644
index 0000000..bd5cd67
--- /dev/null
+++ b/examples/configs/import/spanner_column_config.json
@@ -0,0 +1,9 @@
+{
+ "template_id": "data_sensitivity",
+ "template_project": "tag-engine-run",
+ "template_region": "us-central1",
+ "metadata_import_location": "gs://tag-import/latest/spanner_column_tags.csv",
+ "data_asset_type": "spanner",
+ "data_asset_region": "us-central1",
+ "overwrite": true
+}
diff --git a/examples/configs/import/spanner_column_tags.csv b/examples/configs/import/spanner_column_tags.csv
index 969358e..b54656b 100644
--- a/examples/configs/import/spanner_column_tags.csv
+++ b/examples/configs/import/spanner_column_tags.csv
@@ -1,17 +1,17 @@
-project,instance,database,schema,table,column,is_compliant,reason
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,pts,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,recType,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,companyName,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,cik,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,status,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,industryID,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,spRating,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,foundingDate,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,addr_line1,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,addr_line2,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,postalCode,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,city,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,stateProvince,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,country,TRUE,Passed automated controls
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,ceoName,FALSE,Name was used by knowledge graph
-tag-engine-run,goog-dev,user-testing,finwire,FINWIRE2024Q3_CMP,description,FALSE,Description was used in financial analysis
\ No newline at end of file
+project,instance,database,schema,table,column,sensitive_field,sensitive_type
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,pts,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,recType,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,companyName,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,cik,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,status,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,industryID,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,spRating,TRUE,Personal_Identifiable_Information
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,foundingDate,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,addr_line1,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,addr_line2,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,postalCode,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,city,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,stateProvince,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,country,FALSE,
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,ceoName,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,description,FALSE,
\ No newline at end of file
diff --git a/examples/configs/import/sakila_fileset_column_nested_config.json b/examples/configs/import/spanner_table_config.json
similarity index 50%
rename from examples/configs/import/sakila_fileset_column_nested_config.json
rename to examples/configs/import/spanner_table_config.json
index 2987e25..bface62 100644
--- a/examples/configs/import/sakila_fileset_column_nested_config.json
+++ b/examples/configs/import/spanner_table_config.json
@@ -2,6 +2,8 @@
"template_id": "data_sensitivity",
"template_project": "tag-engine-run",
"template_region": "us-central1",
- "metadata_import_location": "gs://tag-import/csv/sakila_fileset_column_nested.csv",
+ "metadata_import_location": "gs://tag-import/latest/spanner_table_tags.csv",
+ "data_asset_type": "spanner",
+ "data_asset_region": "us-central1",
"overwrite": true
}
diff --git a/examples/configs/import/spanner_table_tags.csv b/examples/configs/import/spanner_table_tags.csv
index 12f4e1d..38997ce 100644
--- a/examples/configs/import/spanner_table_tags.csv
+++ b/examples/configs/import/spanner_table_tags.csv
@@ -1,25 +1,4 @@
-project,instance,database,schema,table,data_domain,data_confidentiality,data_product_type,data_owner,operations_owner,data_location,ingestion_frequency
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q1_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q1_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q1_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q2_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q2_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q2_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q1_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q1_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q1_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q2_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q2_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q2_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q3_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,MONTHLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q3_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q3_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q4_FIN,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q4_SEC,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,WEEKLY
-tag-engine-run,goog-dev,user-testing,dev,FINWIRE2023Q4_CMP,FINANCE,PUBLIC,DERIVED,John Williams,Emily Doe,us-central1,DAILY
-
-
-
+project,instance,database,schema,table,sensitive_field,sensitive_type
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q1_CMP,TRUE,Personal_Identifiable_Information
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q2_CMP,TRUE,Sensitive_Personal_Identifiable_Information
+tag-engine-run,goog-dev,user-testing,dev,FINWIRE2024Q3_CMP,FALSE,
\ No newline at end of file
diff --git a/examples/load/setup/clone_tables_distributed.py b/examples/load/setup/clone_tables_distributed.py
index 177ab51..372415b 100644
--- a/examples/load/setup/clone_tables_distributed.py
+++ b/examples/load/setup/clone_tables_distributed.py
@@ -18,8 +18,6 @@ def make_copies(project, queue_region, queue_name, url, src_table, dest_project,
def create_task(project, queue_region, queue_name, url, src_table, dest_project, dest_dataset, start, stop):
- print('*** enter create_task ***')
-
client = tasks_v2.CloudTasksClient()
parent = client.queue_path(project, queue_region, queue_name)
diff --git a/examples/load/setup/load_tables_distributed.py b/examples/load/setup/load_tables_distributed.py
index 1328d35..abe2182 100644
--- a/examples/load/setup/load_tables_distributed.py
+++ b/examples/load/setup/load_tables_distributed.py
@@ -21,8 +21,6 @@ def load_tables(project, queue_region, queue_name, url, src_uri, dest_project, d
def create_task(project, queue_region, queue_name, url, src_table, dest_project, dest_dataset, table_prefix, start, stop):
- print('*** enter create_task ***')
-
client = tasks_v2.CloudTasksClient()
parent = client.queue_path(project, queue_region, queue_name)
diff --git a/examples/unit_tests.sh b/examples/unit_tests.sh
index ca51c3f..d2d6122 100644
--- a/examples/unit_tests.sh
+++ b/examples/unit_tests.sh
@@ -90,41 +90,57 @@ curl -i -X POST $TAG_ENGINE_URL/trigger_job \
curl -X POST $TAG_ENGINE_URL/get_job_status -d '{"job_uuid":"f106ae4aef4911edb86ee96cdaa8e7ae"}' \
-H "Authorization: Bearer $IAM_TOKEN"
-####### Table and column import tags from CSV #######
+####### BigQuery table and column tags from CSV imports #######
-# create the import table config
-curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/sakila_table_tags.json \
+# create an import config for tagging tables
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/bigquery_table_config.json \
-H "Authorization: Bearer $IAM_TOKEN"
-# trigger job
+# trigger the job
curl -i -X POST $TAG_ENGINE_URL/trigger_job \
-d '{"config_type":"TAG_IMPORT","config_uuid":"0e674d78eddd11ed8d3d09299afaece0"}' \
-H "Authorization: Bearer $IAM_TOKEN"
-# trigger job with metadata
+# alternatively, trigger the job with metadata
curl -i -X POST $TAG_ENGINE_URL/trigger_job \
-d '{"config_type":"TAG_IMPORT","config_uuid":"0e674d78eddd11ed8d3d09299afaece0", "job_metadata": {"source": "Collibra", "workflow": "process_sensitive_data"}}' \
-H "Authorization: Bearer $IAM_TOKEN"
+# get the job status
curl -X POST $TAG_ENGINE_URL/get_job_status -d '{"job_uuid":"2755de6ceddd11ed9e0e3f1388bde9d6"}' \
-H "Authorization: Bearer $IAM_TOKEN"
-# create the import column config
-curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/sakila_column_tags.json \
+# create an import config for tagging columns
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/bigquery_column_config.json \
-H "Authorization: Bearer $IAM_TOKEN"
-# trigger job
+# trigger the job
curl -i -X POST $TAG_ENGINE_URL/trigger_job \
-d '{"config_type":"TAG_IMPORT","config_uuid":"426ddac4eddd11ed9e0e3f1388bde9d6"}' \
-H "Authorization: Bearer $IAM_TOKEN"
+# get the job status
curl -X POST $TAG_ENGINE_URL/get_job_status -d '{"job_uuid":"4abb1a0ceddd11edb0341b486213f8b6"}' \
-H "Authorization: Bearer $IAM_TOKEN"
-####### Fileset import tags from CSV #######
+# create an import config for tagging datasets
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/bigquery_dataset_config.json \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
+# trigger the job
+curl -i -X POST $TAG_ENGINE_URL/trigger_job \
+ -d '{"config_type":"TAG_IMPORT","config_uuid":"7d4618be478211efa28142004e494300"}' \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
+# get the job status
+curl -X POST $TAG_ENGINE_URL/get_job_status -d '{"job_uuid":"75052fd2478211efa28142004e494300"}' \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
-# create the fileset import config
-curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/sakila_fileset_config.json \
+####### GCS fileset tags from CSV imports #######
+
+# create an import config for tagging filesets
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/fileset_config.json \
-H "Authorization: Bearer $IAM_TOKEN"
# trigger job
@@ -132,8 +148,8 @@ curl -i -X POST $TAG_ENGINE_URL/trigger_job \
-d '{"config_type":"TAG_IMPORT","config_uuid":"0e674d78eddd11ed8d3d09299afaece0"}' \
-H "Authorization: Bearer $IAM_TOKEN"
-# create the fileset column import config
-curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/sakila_fileset_column_config.json \
+# create an import config for tagging fileset columns
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/fileset_column_config.json \
-H "Authorization: Bearer $IAM_TOKEN"
# trigger job
@@ -141,6 +157,28 @@ curl -i -X POST $TAG_ENGINE_URL/trigger_job \
-d '{"config_type":"TAG_IMPORT","config_uuid":"0e674d78eddd11ed8d3d09299afaece0"}' \
-H "Authorization: Bearer $IAM_TOKEN"
+
+####### Spanner tags from CSV imports #######
+
+# create an import config for tagging Spanner tables
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/spanner_table_config.json \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
+# trigger job
+curl -i -X POST $TAG_ENGINE_URL/trigger_job \
+ -d '{"config_type":"TAG_IMPORT","config_uuid":"0e674d78eddd11ed8d3d09299afaece0"}' \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
+# create an import config for tagging Spanner table columns
+curl -X POST $TAG_ENGINE_URL/create_import_config -d @examples/configs/import/spanner_column_config.json \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
+# trigger job
+curl -i -X POST $TAG_ENGINE_URL/trigger_job \
+ -d '{"config_type":"TAG_IMPORT","config_uuid":"0e674d78eddd11ed8d3d09299afaece0"}' \
+ -H "Authorization: Bearer $IAM_TOKEN"
+
+
####### Restore tags from metadata export #######
# export the metadata
diff --git a/main.py b/main.py
index 38e7fe3..c715266 100644
--- a/main.py
+++ b/main.py
@@ -68,7 +68,20 @@
else:
FIRESTORE_DB = '(default)'
-BIGQUERY_REGION = config['DEFAULT']['BIGQUERY_REGION'].strip()
+if 'BIGQUERY_REGION' in config['DEFAULT']:
+ BIGQUERY_REGION = config['DEFAULT']['BIGQUERY_REGION'].strip()
+else:
+ BIGQUERY_REGION = None
+
+if 'SPANNER_REGION' in config['DEFAULT']:
+ SPANNER_REGION = config['DEFAULT']['SPANNER_REGION'].strip()
+else:
+ SPANNER_REGION = None
+
+if 'FILESET_REGION' in config['DEFAULT']:
+ FILESET_REGION = config['DEFAULT']['FILESET_REGION'].strip()
+else:
+ FILESET_REGION = None
SPLIT_WORK_HANDLER = SERVICE_URL + "/_split_work"
RUN_TASK_HANDLER = SERVICE_URL + '/_run_task'
@@ -2655,10 +2668,21 @@ def create_import_config():
else:
overwrite = True
+ if 'data_asset_type' in json_request:
+ data_asset_type = json_request['data_asset_type']
+ else:
+ data_asset_type = None
+
+ if 'data_asset_region' in json_request:
+ data_asset_region = json_request['data_asset_region']
+ else:
+ data_asset_region = None
+
tag_history_option, _ = store.read_tag_history_settings()
config_uuid = store.write_tag_import_config(tag_creator_sa, template_uuid, template_id, template_project, template_region, \
- metadata_import_location, tag_history_option, overwrite)
+ data_asset_type, data_asset_region, metadata_import_location, \
+ tag_history_option, overwrite)
return jsonify(config_uuid=config_uuid, config_type='TAG_IMPORT')
@@ -3415,7 +3439,44 @@ def _split_work():
jm.set_job_status(job_uuid, 'ERROR')
resp = jsonify(success=False)
return resp
-
+
+ # infer the data_asset_type if not present in the config
+ if 'data_asset_type' not in config or config.get('data_asset_type') == None:
+ if (extracted_tags[0].keys() >= {'dataset'}):
+ config['data_asset_type'] = 'bigquery'
+ elif (extracted_tags[0].keys() >= {'entry_group', 'fileset'}):
+ config['data_asset_type'] = 'fileset'
+ elif (extracted_tags[0].keys() >= {'instance', 'database'}):
+ config['data_asset_type'] = 'spanner'
+ else:
+ print('Error: unable to determine the data asset type of your config (bigquery, fileset, or spanner). Please add data_asset_type to your config and verify the format of your CSV.')
+ store.update_job_status(config_uuid, config_type, 'ERROR')
+ jm.set_job_status(job_uuid, 'ERROR')
+ resp = jsonify(success=False)
+ return resp
+
+ # save the update to Firestore
+ store.update_tag_import_config(config_uuid, config.get('data_asset_type'), None, None)
+
+ # infer the data_asset_region if not present in the config
+ if 'data_asset_region' not in config or config.get('data_asset_region') == None:
+ if config.get('data_asset_type') == 'bigquery':
+ config['data_asset_region'] = BIGQUERY_REGION
+ elif config.get('data_asset_type') == 'fileset':
+ config['data_asset_region'] = FILESET_REGION
+ elif config.get('data_asset_type') == 'spanner':
+ config['data_asset_region'] = SPANNER_REGION
+ else:
+ print('Error: unable to determine the data asset region of your config (us-central1, etc.). Please add data_asset_region to your config or add the appropriate default region variable to tagengine.ini.')
+ store.update_job_status(config_uuid, config_type, 'ERROR')
+ jm.set_job_status(job_uuid, 'ERROR')
+ resp = jsonify(success=False)
+ return resp
+
+ # save the update to Firestore
+ store.update_tag_import_config(config_uuid, None, config.get('data_asset_region'), None)
+
+
if config_type == 'TAG_RESTORE':
bkp_files = list(re.get_resources(config.get('metadata_export_location'), None))
@@ -3558,8 +3619,8 @@ def _run_task():
creation_status = dcc.apply_export_config(config['config_uuid'], config['target_project'], config['target_dataset'], config['target_region'], uri)
if config_type == 'TAG_IMPORT':
- creation_status = dcc.apply_import_config(job_uuid, config_uuid, tag_extract, \
- config['tag_history'], config['overwrite'])
+ creation_status = dcc.apply_import_config(job_uuid, config_uuid, config['data_asset_type'], config['data_asset_region'], \
+ tag_extract, config['tag_history'], config['overwrite'])
if config_type == 'TAG_RESTORE':
creation_status = dcc.apply_restore_config(job_uuid, config_uuid, tag_extract, \
config['tag_history'], config['overwrite'])
@@ -3597,7 +3658,7 @@ def _run_task():
@app.route("/version", methods=['GET'])
def version():
- return "Welcome to Tag Engine version 2.3.1\n"
+ return "Welcome to Tag Engine version 2.3.2\n"
####################### TEST METHOD ####################################
diff --git a/tagengine.ini.tpl b/tagengine.ini.tpl
index c2ddafa..e49c339 100644
--- a/tagengine.ini.tpl
+++ b/tagengine.ini.tpl
@@ -1,19 +1,20 @@
[DEFAULT]
-TAG_ENGINE_SA = tag-engine@solution-workspace.iam.gserviceaccount.com
-TAG_CREATOR_SA = tag-creator@dgtoolkit.iam.gserviceaccount.com
-TAG_ENGINE_PROJECT = solution-workspace
+TAG_ENGINE_SA = tag-engine@tag-engine-run.iam.gserviceaccount.com
+TAG_CREATOR_SA = tag-creator@tag-engine-run.iam.gserviceaccount.com
+TAG_ENGINE_PROJECT = tag-engine-run
TAG_ENGINE_REGION = us-central1
-FIRESTORE_PROJECT = dgtoolkit
-FIRESTORE_DB = tag-engine
+FIRESTORE_PROJECT = tag-engine-run
+FIRESTORE_DB = (default)
INJECTOR_QUEUE = tag-engine-injector-queue
WORK_QUEUE = tag-engine-work-queue
BIGQUERY_REGION = us-central1
-CLOUD_STORAGE_REGION = us-central1
+FILESET_REGION = us-central1
+SPANNER_REGION = us-central1
ENABLE_AUTH = True
OAUTH_CLIENT_CREDENTIALS = te_client_secret.json
ENABLE_TAG_HISTORY = True
-TAG_HISTORY_PROJECT = dgtoolkit
+TAG_HISTORY_PROJECT = tag-engine-run
TAG_HISTORY_DATASET = tag_history
ENABLE_JOB_METADATA = True
-JOB_METADATA_PROJECT = dgtoolkit
+JOB_METADATA_PROJECT = tag-engine-run
JOB_METADATA_DATASET = job_metadata
diff --git a/templates/home.html b/templates/home.html
index 926f083..3c7a635 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -14,7 +14,7 @@
Opps! Tag Engine was unable to retrieve the tag template below. Please ensure that it exists and that you have permissions to it. |
{% endif %}
- Tag Engine version: 2.3.1
+ Tag Engine version: 2.3.2
Tag Engine for Data Catalog