Delete entry type
Stay organized with collections
Save and categorize content based on your preferences.
Delete an entry type.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis page provides code samples in Java and Python demonstrating how to delete an entry type within Google Cloud Dataplex.\u003c/p\u003e\n"],["\u003cp\u003eThe Java sample uses the \u003ccode\u003eCatalogServiceClient\u003c/code\u003e to asynchronously delete an entry type, specified by project ID, location, and entry type ID.\u003c/p\u003e\n"],["\u003cp\u003eThe Python sample also utilizes the \u003ccode\u003eCatalogServiceClient\u003c/code\u003e, but it deletes the entry type directly by its fully qualified name, which is constructed from the project ID, location, and entry type ID.\u003c/p\u003e\n"],["\u003cp\u003eBoth code samples require setting up Application Default Credentials for authentication, and direct the user to links for more details on both Dataplex libraries and authentication.\u003c/p\u003e\n"],["\u003cp\u003eThe user is provided with a link to the google cloud sample browser to find other google cloud products.\u003c/p\u003e\n"]]],[],null,["# Delete entry type\n\nDelete an entry type.\n\nCode sample\n-----------\n\n### Java\n\n\nBefore trying this sample, follow the Java setup instructions in the\n[Dataplex Universal Catalog quickstart using\nclient libraries](/dataplex/docs/reference/libraries).\n\n\nFor more information, see the\n[Dataplex Universal Catalog Java API\nreference documentation](/java/docs/reference/google-cloud-dataplex/latest/overview).\n\n\nTo authenticate to Dataplex Universal Catalog, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n import com.google.cloud.dataplex.v1.CatalogServiceClient;\n import com.google.cloud.dataplex.v1.EntryTypeName;\n\n public class DeleteEntryType {\n\n public static void main(String[] args) throws Exception {\n // TODO(developer): Replace these variables before running the sample.\n String projectId = \"MY_PROJECT_ID\";\n // Available locations: https://cloud.google.com/dataplex/docs/locations\n String location = \"MY_LOCATION\";\n String entryTypeId = \"MY_ENTRY_TYPE_ID\";\n\n deleteEntryType(projectId, location, entryTypeId);\n System.out.println(\"Successfully deleted entry type\");\n }\n\n // Method to delete Entry Type located in projectId, location and with entryTypeId\n public static void deleteEntryType(String projectId, String location, String entryTypeId)\n throws Exception {\n // Initialize client that will be used to send requests. This client only needs to be created\n // once, and can be reused for multiple requests.\n try (CatalogServiceClient client = CatalogServiceClient.create()) {\n EntryTypeName entryTypeName = EntryTypeName.of(projectId, location, entryTypeId);\n client.deleteEntryTypeAsync(entryTypeName).get();\n }\n }\n }\n\n### Python\n\n\nBefore trying this sample, follow the Python setup instructions in the\n[Dataplex Universal Catalog quickstart using\nclient libraries](/dataplex/docs/reference/libraries).\n\n\nFor more information, see the\n[Dataplex Universal Catalog Python API\nreference documentation](/python/docs/reference/dataplex/latest).\n\n\nTo authenticate to Dataplex Universal Catalog, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n from google.cloud import dataplex_v1\n\n\n def delete_entry_type(project_id: str, location: str, entry_type_id: str) -\u003e None:\n \"\"\"Method to delete Entry Type located in project_id, location and with entry_type_id\"\"\"\n\n # Initialize client that will be used to send requests across threads. This\n # client only needs to be created once, and can be reused for multiple requests.\n # After completing all of your requests, call the \"__exit__()\" method to safely\n # clean up any remaining background resources. Alternatively, use the client as\n # a context manager.\n with dataplex_v1.CatalogServiceClient() as client:\n # The resource name of the Entry Type\n name = f\"projects/{project_id}/locations/{location}/entryTypes/{entry_type_id}\"\n client.delete_entry_type(name=name)\n\n\n if __name__ == \"__main__\":\n # TODO(developer): Replace these variables before running the sample.\n project_id = \"MY_PROJECT_ID\"\n # Available locations: https://cloud.google.com/dataplex/docs/locations\n location = \"MY_LOCATION\"\n entry_type_id = \"MY_ENTRY_TYPE_ID\"\n\n delete_entry_type(project_id, location, entry_type_id)\n print(\"Successfully deleted entry type\")\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=dataplex)."]]