@Generated public class QueriesLegacyAPI extends Object
**Note**: A new version of the Databricks SQL API is now available. Please see the latest version. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
| Constructor and Description |
|---|
QueriesLegacyAPI(ApiClient apiClient)
Regular-use constructor
|
QueriesLegacyAPI(QueriesLegacyService mock)
Constructor for mocks
|
| Modifier and Type | Method and Description |
|---|---|
LegacyQuery |
create(QueryPostContent request)
Create a new query definition.
|
void |
delete(DeleteQueriesLegacyRequest request)
Delete a query.
|
void |
delete(String queryId) |
LegacyQuery |
get(GetQueriesLegacyRequest request)
Get a query definition.
|
LegacyQuery |
get(String queryId) |
QueriesLegacyService |
impl() |
Iterable<LegacyQuery> |
list(ListQueriesLegacyRequest request)
Get a list of queries.
|
void |
restore(RestoreQueriesLegacyRequest request)
Restore a query.
|
void |
restore(String queryId) |
LegacyQuery |
update(QueryEditContent request)
Change a query definition.
|
LegacyQuery |
update(String queryId) |
public QueriesLegacyAPI(ApiClient apiClient)
public QueriesLegacyAPI(QueriesLegacyService mock)
public LegacyQuery 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 is now available. Please use :method:queries/create instead. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
public void delete(String queryId)
public void delete(DeleteQueriesLegacyRequest 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 is now available. Please use :method:queries/delete instead. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
public LegacyQuery get(String queryId)
public LegacyQuery get(GetQueriesLegacyRequest 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 is now available. Please use :method:queries/get instead. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
public Iterable<LegacyQuery> list(ListQueriesLegacyRequest 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 is now available. Please use :method:queries/list instead. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
public void restore(String queryId)
public void restore(RestoreQueriesLegacyRequest 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 is now available. Please see the latest version. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
public LegacyQuery update(String queryId)
public LegacyQuery update(QueryEditContent request)
Modify this query definition.
**Note**: You cannot undo this operation.
**Note**: A new version of the Databricks SQL API is now available. Please use :method:queries/update instead. [Learn more]
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
public QueriesLegacyService impl()
Copyright © 2025. All rights reserved.