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!