@Generated public class QueriesAPI extends Object
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
| Constructor and Description |
|---|
QueriesAPI(ApiClient apiClient)
Regular-use constructor
|
QueriesAPI(QueriesService mock)
Constructor for mocks
|
| Modifier and Type | Method and Description |
|---|---|
Query |
create(QueryPostContent request)
Create a new query definition.
|
void |
delete(DeleteQueryRequest request)
Delete a query.
|
void |
delete(String queryId) |
Query |
get(GetQueryRequest request)
Get a query definition.
|
Query |
get(String queryId) |
QueriesService |
impl() |
Iterable<Query> |
list(ListQueriesRequest request)
Get a list of queries.
|
void |
restore(RestoreQueryRequest request)
Restore a query.
|
void |
restore(String queryId) |
Query |
update(QueryEditContent request)
Change a query definition.
|
Query |
update(String queryId) |
public QueriesAPI(ApiClient apiClient)
public QueriesAPI(QueriesService mock)
public Query create(QueryPostContent request)
Creates a new query definition. Queries created with this endpoint belong to the authenticated user making the request.
The `data_source_id` field specifies the ID of the SQL warehouse to run this query against. You can use the Data Sources API to see a complete list of available SQL warehouses. Or you can copy the `data_source_id` from an existing query.
**Note**: You cannot add a visualization until you create the query.
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
public void delete(String queryId)
public void delete(DeleteQueryRequest request)
Moves a query to the trash. Trashed queries immediately disappear from searches and list views, and they cannot be used for alerts. The trash is deleted after 30 days.
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
public Query get(GetQueryRequest request)
Retrieve a query object definition along with contextual permissions information about the currently authenticated user.
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
public Iterable<Query> list(ListQueriesRequest request)
Gets a list of queries. Optionally, this list can be filtered by a search term.
**Warning**: Calling this API concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
public void restore(String queryId)
public void restore(RestoreQueryRequest request)
Restore a query that has been moved to the trash. A restored query appears in list views and searches. You can use restored queries for alerts.
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
public Query update(QueryEditContent request)
Modify this query definition.
**Note**: You cannot undo this operation.
**Note**: A new version of the Databricks SQL API will soon be available. [Learn more]
[Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources
public QueriesService impl()
Copyright © 2024. All rights reserved.