public class CosmosClient extends Object implements AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
static CosmosClientBuilder |
builder()
Instantiate the cosmos client builder to build cosmos client
|
void |
close()
Close this
CosmosClient instance and cleans up the resources. |
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings,
CosmosDatabaseRequestOptions options)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings,
int throughput)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings,
int throughput,
CosmosDatabaseRequestOptions options)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(String id)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(String id,
int throughput)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabaseIfNotExists(CosmosDatabaseProperties databaseSettings)
CREATE a Database if it does not already exist on the service
The
Mono upon successful completion will contain a single cosmos database response with the
created or existing database. |
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabaseIfNotExists(String id)
CREATE a Database if it does not already exist on the service
The
Mono upon successful completion will contain a single cosmos database response with the
created or existing database. |
CosmosDatabase |
getDatabase(String id)
Gets a database object without making a service call.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> |
queryDatabases(SqlQuerySpec querySpec,
FeedOptions options)
Query for databases.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> |
queryDatabases(String query,
FeedOptions options)
Query for databases.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> |
readAllDatabases()
Reads all databases.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> |
readAllDatabases(FeedOptions options)
Reads all databases.
|
public static CosmosClientBuilder builder()
CosmosClientBuilderpublic reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabaseIfNotExists(CosmosDatabaseProperties databaseSettings)
Mono upon successful completion will contain a single cosmos database response with the
created or existing database.databaseSettings - CosmosDatabasePropertiesMono containing the cosmos database response with the created or existing database or
an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabaseIfNotExists(String id)
Mono upon successful completion will contain a single cosmos database response with the
created or existing database.id - the id of the databaseMono containing the cosmos database response with the created or existing database or
an errorpublic reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings, CosmosDatabaseRequestOptions options)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.databaseSettings - CosmosDatabasePropertiesoptions - CosmosDatabaseRequestOptionsMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.databaseSettings - CosmosDatabasePropertiesMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(String id)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.id - id of the databaseMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings, int throughput, CosmosDatabaseRequestOptions options)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.databaseSettings - CosmosDatabasePropertiesthroughput - the throughput for the databaseoptions - CosmosDatabaseRequestOptionsMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings, int throughput)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.databaseSettings - CosmosDatabasePropertiesthroughput - the throughput for the databaseMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(String id, int throughput)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.id - id of the databasethroughput - the throughput for the databaseMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> readAllDatabases(FeedOptions options)
Flux will contain one or several feed response of the read databases.
In case of failure the Flux will error.options - FeedOptionsFlux containing one or several feed response pages of read databases or an error.public reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> readAllDatabases()
Flux will contain one or several feed response of the read databases.
In case of failure the Flux will error.Flux containing one or several feed response pages of read databases or an error.public reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> queryDatabases(String query, FeedOptions options)
Flux will contain one or several feed response of the read databases.
In case of failure the Flux will error.query - the query.options - the feed options.Flux containing one or several feed response pages of read databases or an error.public reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseProperties>> queryDatabases(SqlQuerySpec querySpec, FeedOptions options)
Flux will contain one or several feed response of the read databases.
In case of failure the Flux will error.querySpec - the SQL query specification.options - the feed options.Flux containing one or several feed response pages of read databases or an error.public CosmosDatabase getDatabase(String id)
id - name of the databaseCosmosDatabasepublic void close()
CosmosClient instance and cleans up the resources.close in interface AutoCloseableCopyright © 2019. All rights reserved.