Public API v2 → Delete External Schema Endpoint

About the /extraction/schema/{schema} endpoint

The /extraction/schema/{schema} endpoint removes the definition of the specified external schema from the Spark Metastore. This endpoint is available starting 2024.1.4

Starting 2024.7.x, you can also instruct the endpoint to delete the definition, target paths, and Parquet files of external tables in the given schema by setting the cascade parameter to true.

Note

When disabling the cascade parameter or when using a release before 2024.7.x, deleting external schemas only removes their definition from the Spark Maetastore. You must first delete all external tables in the schema before trying to delete it.

Only the Super admin user (and users with the SuperRole when the Super User Mode is enabled) can use this endpoint.

For information about how to get started with Public API v2, refer to References → Public API v2.

Note

Use the HTTPS or HTTP scheme according to your installation. You must use the HTTPS scheme to successfully run the API endpoints on Cloud installations.

Request URL

https://<cluster_URL>/incorta/api/v2/{tenant}/extraction/schema/{schema}?cascade=false

Examples:

  • https://mycluster.incorta.com/incorta/api/v2/default/extraction/schema/externalSchema1?cascade=false
  • https://10.1.2.3:8080/incorta/api/v2/default/extraction/schema/externalSchema1?cascade=true

Request URL Parameters

ParameterDescriptionTypeRequired
tenantThe tenant name (case-sensitive)StringRequired
schemaThe name of the external schema you want to deleteStringRequired
cascadeThis parameter is available starting 2024.7.x.
  ●  The default is false.
  ●  Set it to true to delete the target paths and Parquet files related to external tables in the given external schema, along with the schema definition in the Spark Metastore.
StringRequired

HTTP method

DELETE

Request headers

{
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {access_token}"
}

You must use a valid access token for the Super admin user (or a user with the SuperRole if the Super User Mode is enabled). For information about creating an access token, refer to Public API v2 → Create an API access token.

Endpoint response

The following table shows the HTTP response status codes for this endpoint.

CodeDescriptionPayload Response
200OK
The endpoint successfully ran and deleted the external schema, along with its external tables and their files and target paths if the cascade option is enabled.
400Bad Request
You provided invalid values.
{"message": "string"}
401Unauthenticated
The endpoint couldn’t run successfully due to authentication errors, such as an invalid or expired access token.
{"message": "string"}
Example:
{"message": "INC_09030108: Invalid authentication header. Invalid Token [abcd1234]"}
404Not Found
The tenant doesn't exist or is disabled.
{"message": "string"}
Example:
{"message": "Invalid [DEFAULT] tenant in resource path"}
500Internal Server Error
The endpoint couldn’t run successfully due to a server error.
{"message": "string"}
Example:
{"message": "The target schema name externalSchema2 not allowed for extraction"}