org.openmetadata.client.api.DatabasesApi Maven / Gradle / Ivy
package org.openmetadata.client.api;
import org.openmetadata.client.ApiClient;
import org.openmetadata.client.EncodingUtils;
import org.openmetadata.client.model.ApiResponse;
import org.openmetadata.client.model.CreateDatabase;
import org.openmetadata.client.model.Database;
import org.openmetadata.client.model.DatabaseList;
import org.openmetadata.client.model.EntityHistory;
import org.openmetadata.client.model.RestoreEntity;
import java.util.UUID;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-06T17:05:44.995298Z[Etc/UTC]")
public interface DatabasesApi extends ApiClient.Api {
/**
* Create a database
* Create a database under an existing `service`.
* @param createDatabase (optional)
* @return Database
*/
@RequestLine("POST /v1/databases")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Database createDatabase(CreateDatabase createDatabase);
/**
* Create a database
* Similar to createDatabase
but it also returns the http response headers .
* Create a database under an existing `service`.
* @param createDatabase (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /v1/databases")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
ApiResponse createDatabaseWithHttpInfo(CreateDatabase createDatabase);
/**
* Create or update database
* Create a database, if it does not exist or update an existing database.
* @param createDatabase (optional)
* @return Database
*/
@RequestLine("PUT /v1/databases")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Database createOrUpdateDatabase(CreateDatabase createDatabase);
/**
* Create or update database
* Similar to createOrUpdateDatabase
but it also returns the http response headers .
* Create a database, if it does not exist or update an existing database.
* @param createDatabase (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("PUT /v1/databases")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
ApiResponse createOrUpdateDatabaseWithHttpInfo(CreateDatabase createDatabase);
/**
* Delete a database by Id
* Delete a database by `Id`. Database can only be deleted if it has no tables.
* @param id Id of the database (required)
* @param recursive Recursively delete this entity and it's children. (Default `false`) (optional, default to false)
* @param hardDelete Hard delete the entity. (Default = `false`) (optional, default to false)
*/
@RequestLine("DELETE /v1/databases/{id}?recursive={recursive}&hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
void deleteDatabase(@Param("id") UUID id, @Param("recursive") Boolean recursive, @Param("hardDelete") Boolean hardDelete);
/**
* Delete a database by Id
* Similar to deleteDatabase
but it also returns the http response headers .
* Delete a database by `Id`. Database can only be deleted if it has no tables.
* @param id Id of the database (required)
* @param recursive Recursively delete this entity and it's children. (Default `false`) (optional, default to false)
* @param hardDelete Hard delete the entity. (Default = `false`) (optional, default to false)
*/
@RequestLine("DELETE /v1/databases/{id}?recursive={recursive}&hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
ApiResponse deleteDatabaseWithHttpInfo(@Param("id") UUID id, @Param("recursive") Boolean recursive, @Param("hardDelete") Boolean hardDelete);
/**
* Delete a database by Id
* Delete a database by `Id`. Database can only be deleted if it has no tables.
* Note, this is equivalent to the other deleteDatabase
method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link DeleteDatabaseQueryParams} class that allows for
* building up this map in a fluent style.
* @param id Id of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - recursive - Recursively delete this entity and it's children. (Default `false`) (optional, default to false)
* - hardDelete - Hard delete the entity. (Default = `false`) (optional, default to false)
*
*/
@RequestLine("DELETE /v1/databases/{id}?recursive={recursive}&hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
void deleteDatabase(@Param("id") UUID id, @QueryMap(encoded=true) Map queryParams);
/**
* Delete a database by Id
* Delete a database by `Id`. Database can only be deleted if it has no tables.
* Note, this is equivalent to the other deleteDatabase
that receives the query parameters as a map,
* but this one also exposes the Http response headers
* @param id Id of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - recursive - Recursively delete this entity and it's children. (Default `false`) (optional, default to false)
* - hardDelete - Hard delete the entity. (Default = `false`) (optional, default to false)
*
*/
@RequestLine("DELETE /v1/databases/{id}?recursive={recursive}&hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
ApiResponse deleteDatabaseWithHttpInfo(@Param("id") UUID id, @QueryMap(encoded=true) Map queryParams);
/**
* A convenience class for generating query parameters for the
* deleteDatabase
method in a fluent style.
*/
public static class DeleteDatabaseQueryParams extends HashMap {
public DeleteDatabaseQueryParams recursive(final Boolean value) {
put("recursive", EncodingUtils.encode(value));
return this;
}
public DeleteDatabaseQueryParams hardDelete(final Boolean value) {
put("hardDelete", EncodingUtils.encode(value));
return this;
}
}
/**
* Delete a database by fully qualified name
* Delete a database by `fullyQualifiedName`. Databases can only be deleted if it has no tables.
* @param fqn Fully qualified name of the database (required)
* @param hardDelete Hard delete the entity. (Default = `false`) (optional, default to false)
*/
@RequestLine("DELETE /v1/databases/name/{fqn}?hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
void deleteDatabaseByFQN(@Param("fqn") String fqn, @Param("hardDelete") Boolean hardDelete);
/**
* Delete a database by fully qualified name
* Similar to deleteDatabaseByFQN
but it also returns the http response headers .
* Delete a database by `fullyQualifiedName`. Databases can only be deleted if it has no tables.
* @param fqn Fully qualified name of the database (required)
* @param hardDelete Hard delete the entity. (Default = `false`) (optional, default to false)
*/
@RequestLine("DELETE /v1/databases/name/{fqn}?hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
ApiResponse deleteDatabaseByFQNWithHttpInfo(@Param("fqn") String fqn, @Param("hardDelete") Boolean hardDelete);
/**
* Delete a database by fully qualified name
* Delete a database by `fullyQualifiedName`. Databases can only be deleted if it has no tables.
* Note, this is equivalent to the other deleteDatabaseByFQN
method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link DeleteDatabaseByFQNQueryParams} class that allows for
* building up this map in a fluent style.
* @param fqn Fully qualified name of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - hardDelete - Hard delete the entity. (Default = `false`) (optional, default to false)
*
*/
@RequestLine("DELETE /v1/databases/name/{fqn}?hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
void deleteDatabaseByFQN(@Param("fqn") String fqn, @QueryMap(encoded=true) Map queryParams);
/**
* Delete a database by fully qualified name
* Delete a database by `fullyQualifiedName`. Databases can only be deleted if it has no tables.
* Note, this is equivalent to the other deleteDatabaseByFQN
that receives the query parameters as a map,
* but this one also exposes the Http response headers
* @param fqn Fully qualified name of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - hardDelete - Hard delete the entity. (Default = `false`) (optional, default to false)
*
*/
@RequestLine("DELETE /v1/databases/name/{fqn}?hardDelete={hardDelete}")
@Headers({
"Accept: application/json",
})
ApiResponse deleteDatabaseByFQNWithHttpInfo(@Param("fqn") String fqn, @QueryMap(encoded=true) Map queryParams);
/**
* A convenience class for generating query parameters for the
* deleteDatabaseByFQN
method in a fluent style.
*/
public static class DeleteDatabaseByFQNQueryParams extends HashMap {
public DeleteDatabaseByFQNQueryParams hardDelete(final Boolean value) {
put("hardDelete", EncodingUtils.encode(value));
return this;
}
}
/**
* Get a database by fully qualified name
* Get a database by `fullyQualifiedName`.
* @param fqn Fully qualified name of the database (required)
* @param fields Fields requested in the returned resource (optional)
* @param include Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
* @return Database
*/
@RequestLine("GET /v1/databases/name/{fqn}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
Database getDatabaseByFQN(@Param("fqn") String fqn, @Param("fields") String fields, @Param("include") String include);
/**
* Get a database by fully qualified name
* Similar to getDatabaseByFQN
but it also returns the http response headers .
* Get a database by `fullyQualifiedName`.
* @param fqn Fully qualified name of the database (required)
* @param fields Fields requested in the returned resource (optional)
* @param include Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /v1/databases/name/{fqn}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
ApiResponse getDatabaseByFQNWithHttpInfo(@Param("fqn") String fqn, @Param("fields") String fields, @Param("include") String include);
/**
* Get a database by fully qualified name
* Get a database by `fullyQualifiedName`.
* Note, this is equivalent to the other getDatabaseByFQN
method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link GetDatabaseByFQNQueryParams} class that allows for
* building up this map in a fluent style.
* @param fqn Fully qualified name of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - fields - Fields requested in the returned resource (optional)
* - include - Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
*
* @return Database
*/
@RequestLine("GET /v1/databases/name/{fqn}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
Database getDatabaseByFQN(@Param("fqn") String fqn, @QueryMap(encoded=true) Map queryParams);
/**
* Get a database by fully qualified name
* Get a database by `fullyQualifiedName`.
* Note, this is equivalent to the other getDatabaseByFQN
that receives the query parameters as a map,
* but this one also exposes the Http response headers
* @param fqn Fully qualified name of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - fields - Fields requested in the returned resource (optional)
* - include - Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
*
* @return Database
*/
@RequestLine("GET /v1/databases/name/{fqn}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
ApiResponse getDatabaseByFQNWithHttpInfo(@Param("fqn") String fqn, @QueryMap(encoded=true) Map queryParams);
/**
* A convenience class for generating query parameters for the
* getDatabaseByFQN
method in a fluent style.
*/
public static class GetDatabaseByFQNQueryParams extends HashMap {
public GetDatabaseByFQNQueryParams fields(final String value) {
put("fields", EncodingUtils.encode(value));
return this;
}
public GetDatabaseByFQNQueryParams include(final String value) {
put("include", EncodingUtils.encode(value));
return this;
}
}
/**
* Get a database by Id
* Get a database by `Id`.
* @param id Id of the database (required)
* @param fields Fields requested in the returned resource (optional)
* @param include Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
* @return Database
*/
@RequestLine("GET /v1/databases/{id}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
Database getDatabaseByID(@Param("id") UUID id, @Param("fields") String fields, @Param("include") String include);
/**
* Get a database by Id
* Similar to getDatabaseByID
but it also returns the http response headers .
* Get a database by `Id`.
* @param id Id of the database (required)
* @param fields Fields requested in the returned resource (optional)
* @param include Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /v1/databases/{id}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
ApiResponse getDatabaseByIDWithHttpInfo(@Param("id") UUID id, @Param("fields") String fields, @Param("include") String include);
/**
* Get a database by Id
* Get a database by `Id`.
* Note, this is equivalent to the other getDatabaseByID
method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link GetDatabaseByIDQueryParams} class that allows for
* building up this map in a fluent style.
* @param id Id of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - fields - Fields requested in the returned resource (optional)
* - include - Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
*
* @return Database
*/
@RequestLine("GET /v1/databases/{id}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
Database getDatabaseByID(@Param("id") UUID id, @QueryMap(encoded=true) Map queryParams);
/**
* Get a database by Id
* Get a database by `Id`.
* Note, this is equivalent to the other getDatabaseByID
that receives the query parameters as a map,
* but this one also exposes the Http response headers
* @param id Id of the database (required)
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - fields - Fields requested in the returned resource (optional)
* - include - Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
*
* @return Database
*/
@RequestLine("GET /v1/databases/{id}?fields={fields}&include={include}")
@Headers({
"Accept: application/json",
})
ApiResponse getDatabaseByIDWithHttpInfo(@Param("id") UUID id, @QueryMap(encoded=true) Map queryParams);
/**
* A convenience class for generating query parameters for the
* getDatabaseByID
method in a fluent style.
*/
public static class GetDatabaseByIDQueryParams extends HashMap {
public GetDatabaseByIDQueryParams fields(final String value) {
put("fields", EncodingUtils.encode(value));
return this;
}
public GetDatabaseByIDQueryParams include(final String value) {
put("include", EncodingUtils.encode(value));
return this;
}
}
/**
* Get a version of the database
* Get a version of the database by given `Id`
* @param id Id of the database (required)
* @param version Database version number in the form `major`.`minor` (required)
* @return Database
*/
@RequestLine("GET /v1/databases/{id}/versions/{version}")
@Headers({
"Accept: application/json",
})
Database getSpecificDatabaseVersion(@Param("id") UUID id, @Param("version") String version);
/**
* Get a version of the database
* Similar to getSpecificDatabaseVersion
but it also returns the http response headers .
* Get a version of the database by given `Id`
* @param id Id of the database (required)
* @param version Database version number in the form `major`.`minor` (required)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /v1/databases/{id}/versions/{version}")
@Headers({
"Accept: application/json",
})
ApiResponse getSpecificDatabaseVersionWithHttpInfo(@Param("id") UUID id, @Param("version") String version);
/**
* List database versions
* Get a list of all the versions of a database identified by `Id`
* @param id Id of the database (required)
* @return EntityHistory
*/
@RequestLine("GET /v1/databases/{id}/versions")
@Headers({
"Accept: application/json",
})
EntityHistory listAllDatabaseVersion(@Param("id") UUID id);
/**
* List database versions
* Similar to listAllDatabaseVersion
but it also returns the http response headers .
* Get a list of all the versions of a database identified by `Id`
* @param id Id of the database (required)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /v1/databases/{id}/versions")
@Headers({
"Accept: application/json",
})
ApiResponse listAllDatabaseVersionWithHttpInfo(@Param("id") UUID id);
/**
* List databases
* Get a list of databases, optionally filtered by `service` it belongs to. Use `fields` parameter to get only necessary fields. Use cursor-based pagination to limit the number entries in the list using `limit` and `before` or `after` query params.
* @param fields Fields requested in the returned resource (optional)
* @param service Filter databases by service name (optional)
* @param limit Limit the number tables returned. (1 to 1000000, default = 10) (optional, default to 10)
* @param before Returns list of tables before this cursor (optional)
* @param after Returns list of tables after this cursor (optional)
* @param include Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
* @return DatabaseList
*/
@RequestLine("GET /v1/databases?fields={fields}&service={service}&limit={limit}&before={before}&after={after}&include={include}")
@Headers({
"Accept: application/json",
})
DatabaseList listDatabases(@Param("fields") String fields, @Param("service") String service, @Param("limit") Integer limit, @Param("before") String before, @Param("after") String after, @Param("include") String include);
/**
* List databases
* Similar to listDatabases
but it also returns the http response headers .
* Get a list of databases, optionally filtered by `service` it belongs to. Use `fields` parameter to get only necessary fields. Use cursor-based pagination to limit the number entries in the list using `limit` and `before` or `after` query params.
* @param fields Fields requested in the returned resource (optional)
* @param service Filter databases by service name (optional)
* @param limit Limit the number tables returned. (1 to 1000000, default = 10) (optional, default to 10)
* @param before Returns list of tables before this cursor (optional)
* @param after Returns list of tables after this cursor (optional)
* @param include Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /v1/databases?fields={fields}&service={service}&limit={limit}&before={before}&after={after}&include={include}")
@Headers({
"Accept: application/json",
})
ApiResponse listDatabasesWithHttpInfo(@Param("fields") String fields, @Param("service") String service, @Param("limit") Integer limit, @Param("before") String before, @Param("after") String after, @Param("include") String include);
/**
* List databases
* Get a list of databases, optionally filtered by `service` it belongs to. Use `fields` parameter to get only necessary fields. Use cursor-based pagination to limit the number entries in the list using `limit` and `before` or `after` query params.
* Note, this is equivalent to the other listDatabases
method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link ListDatabasesQueryParams} class that allows for
* building up this map in a fluent style.
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - fields - Fields requested in the returned resource (optional)
* - service - Filter databases by service name (optional)
* - limit - Limit the number tables returned. (1 to 1000000, default = 10) (optional, default to 10)
* - before - Returns list of tables before this cursor (optional)
* - after - Returns list of tables after this cursor (optional)
* - include - Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
*
* @return DatabaseList
*/
@RequestLine("GET /v1/databases?fields={fields}&service={service}&limit={limit}&before={before}&after={after}&include={include}")
@Headers({
"Accept: application/json",
})
DatabaseList listDatabases(@QueryMap(encoded=true) Map queryParams);
/**
* List databases
* Get a list of databases, optionally filtered by `service` it belongs to. Use `fields` parameter to get only necessary fields. Use cursor-based pagination to limit the number entries in the list using `limit` and `before` or `after` query params.
* Note, this is equivalent to the other listDatabases
that receives the query parameters as a map,
* but this one also exposes the Http response headers
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - fields - Fields requested in the returned resource (optional)
* - service - Filter databases by service name (optional)
* - limit - Limit the number tables returned. (1 to 1000000, default = 10) (optional, default to 10)
* - before - Returns list of tables before this cursor (optional)
* - after - Returns list of tables after this cursor (optional)
* - include - Include all, deleted, or non-deleted entities. (optional, default to non-deleted)
*
* @return DatabaseList
*/
@RequestLine("GET /v1/databases?fields={fields}&service={service}&limit={limit}&before={before}&after={after}&include={include}")
@Headers({
"Accept: application/json",
})
ApiResponse listDatabasesWithHttpInfo(@QueryMap(encoded=true) Map queryParams);
/**
* A convenience class for generating query parameters for the
* listDatabases
method in a fluent style.
*/
public static class ListDatabasesQueryParams extends HashMap {
public ListDatabasesQueryParams fields(final String value) {
put("fields", EncodingUtils.encode(value));
return this;
}
public ListDatabasesQueryParams service(final String value) {
put("service", EncodingUtils.encode(value));
return this;
}
public ListDatabasesQueryParams limit(final Integer value) {
put("limit", EncodingUtils.encode(value));
return this;
}
public ListDatabasesQueryParams before(final String value) {
put("before", EncodingUtils.encode(value));
return this;
}
public ListDatabasesQueryParams after(final String value) {
put("after", EncodingUtils.encode(value));
return this;
}
public ListDatabasesQueryParams include(final String value) {
put("include", EncodingUtils.encode(value));
return this;
}
}
/**
* Update a database
* Update an existing database using JsonPatch.
* @param id Id of the database (required)
* @param body JsonPatch with array of operations (optional)
* JsonPatch RFC
* @see Update a database Documentation
*/
@RequestLine("PATCH /v1/databases/{id}")
@Headers({
"Content-Type: application/json-patch+json",
"Accept: application/json",
})
void patchDatabase(@Param("id") UUID id, Object body);
/**
* Update a database
* Similar to patchDatabase
but it also returns the http response headers .
* Update an existing database using JsonPatch.
* @param id Id of the database (required)
* @param body JsonPatch with array of operations (optional)
* JsonPatch RFC
* @see Update a database Documentation
*/
@RequestLine("PATCH /v1/databases/{id}")
@Headers({
"Content-Type: application/json-patch+json",
"Accept: application/json",
})
ApiResponse patchDatabaseWithHttpInfo(@Param("id") UUID id, Object body);
/**
* Restore a soft deleted Database.
* Restore a soft deleted Database.
* @param restoreEntity (optional)
* @return Database
*/
@RequestLine("PUT /v1/databases/restore")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Database restore3(RestoreEntity restoreEntity);
/**
* Restore a soft deleted Database.
* Similar to restore3
but it also returns the http response headers .
* Restore a soft deleted Database.
* @param restoreEntity (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("PUT /v1/databases/restore")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
ApiResponse restore3WithHttpInfo(RestoreEntity restoreEntity);
}