gcp datacatalog v1beta1 create taxonomy and policy tags failed

0 votes

I am trying to use Python Client for Google Cloud Data Catalog API beta 1 to create taxonomy and policy tags. here is my code:

from google.cloud.datacatalog_v1beta1 import PolicyTagManagerClient, enums, types
from google.oauth2 import service_account


key_path = "./xxxxx.json"
credentials = service_account.Credentials.from_service_account_file(
    key_path,
    scopes=["https://www.googleapis.com/auth/cloud-platform"],
)

client = PolicyTagManagerClient(credentials=credentials)
resource_name = '//bigquery.googleapis.com/projects/{}/locations/us/taxonomies/{}'.format('3xxxxxxxx58','50xxxxxxxxx14')
taxonomy = client.get_taxonomy(resource_name) 
print(taxonomy)

pt_taxonomy = types.Taxonomy()
pt_taxonomy.display_name = 'PHI'
response = client.create_taxonomy(parent=<project_id>, taxonomy=pt_taxonomy)

I get following error for get_taxonomy()

google.api_core.exceptions.MethodNotImplemented: 501 Operation is not implemented, or supported, or enabled.

and for create_taxonomy() I got:

"Received http2 header with status: 404","grpc_status":1,"value":"404"}"

any idea? Thank you for your help!

Apr 6 in GCP by Rahul
• 3,380 points
34 views

1 answer to this question.

0 votes

I filed a bug describing the 501 error in the client library repository

https://github.com/googleapis/python-datacatalog/issues/33

Despite that 501 error there is another error which needs fixing 

resource_name = '//bigquery.googleapis.com/projects/{}/locations/us/taxonomies/{}'.format('3xxxxxxxx58','50xxxxxxxxx14') taxonomy = client.get_taxonomy(resource_name)

GET Taxonomy expects the resource name of the requested taxonomy as an argument formatted as

projects/{project_id}/locations/{location_id}/taxonomies/{taxonomies_id}

For your reference, the source is provided.

answered Apr 6 by Korak
• 5,820 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

How do I create a Virtual Machine on GCP?

To create a VM instance: It is important you ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,170 points
594 views
0 votes
1 answer

How do I create a Google Cloud Platform (GCP) account?

In order to access the services provided ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,170 points
2,008 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

What are the libraries and tools for cloud storage on GCP?

At the center level, XML API and ...READ MORE

answered Oct 7, 2019 in GCP by Sirajul
• 59,170 points
779 views
0 votes
1 answer

What are the service accounts in GCP? How to create one?

The special accounts associated with a project are called the Service Accounts. The ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 59,170 points
260 views
0 votes
1 answer

sort GCP billing data by metadata tags

Metadata identifies properties of the object as ...READ MORE

answered Mar 17 in GCP by Korak
• 5,820 points
34 views
0 votes
1 answer

What is the difference between GCP cloud composer and workflow?

There are some key differences to consider ...READ MORE

answered Mar 17 in GCP by Korak
• 5,820 points
141 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP