public class CosmosClient extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this
CosmosClient instance and cleans up the resources. |
static CosmosClient |
create(CosmosConfiguration cosmosConfiguration)
Creates a cosmos client with given cosmosConfiguration
|
static CosmosClient |
create(String endpoint,
String key)
Creates a cosmos client with given endpoint and key
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(CosmosDatabaseSettings databaseSettings)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(CosmosDatabaseSettings databaseSettings,
CosmosDatabaseRequestOptions options)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabase(String id)
Creates a database.
|
reactor.core.publisher.Mono<CosmosDatabaseResponse> |
createDatabaseIfNotExists(CosmosDatabaseSettings 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<CosmosDatabaseSettings>> |
listDatabases()
Reads all databases.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseSettings>> |
listDatabases(FeedOptions options)
Reads all databases.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseSettings>> |
queryDatabases(SqlQuerySpec querySpec,
FeedOptions options)
Query for databases.
|
reactor.core.publisher.Flux<FeedResponse<CosmosDatabaseSettings>> |
queryDatabases(String query,
FeedOptions options)
Query for databases.
|
public static CosmosClient create(CosmosConfiguration cosmosConfiguration)
cosmosConfiguration - the cosmosConfigurationpublic static CosmosClient create(String endpoint, String key)
endpoint - the service end pointkey - the keypublic reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabaseIfNotExists(CosmosDatabaseSettings databaseSettings)
Mono upon successful completion will contain a single cosmos database response with the
created or existing database.databaseSettings - CosmosDatabaseSettingsMono 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(CosmosDatabaseSettings 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 - CosmosDatabaseSettingsoptions - CosmosDatabaseRequestOptionsMono containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosDatabaseResponse> createDatabase(CosmosDatabaseSettings databaseSettings)
Mono upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono will error.databaseSettings - CosmosDatabaseSettingsMono 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.Flux<FeedResponse<CosmosDatabaseSettings>> listDatabases(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<CosmosDatabaseSettings>> listDatabases()
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<CosmosDatabaseSettings>> 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<CosmosDatabaseSettings>> 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 databasepublic void close()
CosmosClient instance and cleans up the resources.Copyright © 2019. All rights reserved.