public class CosmosAsyncClient extends Object implements AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this
CosmosAsyncClient instance and cleans up the resources. |
static CosmosClientBuilder |
cosmosClientBuilder()
Instantiate the cosmos client builder to build cosmos client
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings)
Creates a database.
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings,
CosmosDatabaseRequestOptions options)
Creates a database.
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings,
int throughput)
Creates a database.
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabase(CosmosDatabaseProperties databaseSettings,
int throughput,
CosmosDatabaseRequestOptions options)
Creates a database.
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabase(String id)
Creates a database.
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabase(String id,
int throughput)
Creates a database.
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
createDatabaseIfNotExists(CosmosDatabaseProperties databaseSettings)
CREATE a Database if it does not already exist on the service
|
reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> |
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. |
CosmosAsyncDatabase |
getDatabase(String id)
Gets a database object without making a service call.
|
CosmosContinuablePagedFlux<CosmosDatabaseProperties> |
queryDatabases(SqlQuerySpec querySpec,
FeedOptions options)
Query for databases.
|
CosmosContinuablePagedFlux<CosmosDatabaseProperties> |
queryDatabases(String query,
FeedOptions options)
Query for databases.
|
CosmosContinuablePagedFlux<CosmosDatabaseProperties> |
readAllDatabases()
Reads all databases.
|
CosmosContinuablePagedFlux<CosmosDatabaseProperties> |
readAllDatabases(FeedOptions options)
Reads all databases.
|
reactor.core.publisher.Mono<DatabaseAccount> |
readDatabaseAccount() |
public static CosmosClientBuilder cosmosClientBuilder()
CosmosClientBuilder
public reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> createDatabaseIfNotExists(CosmosDatabaseProperties databaseSettings)
The 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<CosmosAsyncDatabaseResponse> 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<CosmosAsyncDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings, CosmosDatabaseRequestOptions options)
After subscription the operation will be performed.
The Mono
upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono
will error.
databaseSettings
- CosmosDatabaseProperties
options
- CosmosDatabaseRequestOptions
Mono
containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings)
After subscription the operation will be performed.
The Mono
upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono
will error.
databaseSettings
- CosmosDatabaseProperties
Mono
containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> createDatabase(String id)
After subscription the operation will be performed.
The 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<CosmosAsyncDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings, int throughput, CosmosDatabaseRequestOptions options)
After subscription the operation will be performed.
The Mono
upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono
will error.
databaseSettings
- CosmosDatabaseProperties
throughput
- the throughput for the databaseoptions
- CosmosDatabaseRequestOptions
Mono
containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> createDatabase(CosmosDatabaseProperties databaseSettings, int throughput)
After subscription the operation will be performed.
The Mono
upon successful completion will contain a single resource response with the
created database.
In case of failure the Mono
will error.
databaseSettings
- CosmosDatabaseProperties
throughput
- the throughput for the databaseMono
containing the single cosmos database response with the created database or an error.public reactor.core.publisher.Mono<CosmosAsyncDatabaseResponse> createDatabase(String id, int throughput)
After subscription the operation will be performed.
The 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 CosmosContinuablePagedFlux<CosmosDatabaseProperties> readAllDatabases(FeedOptions options)
After subscription the operation will be performed.
The CosmosContinuablePagedFlux
will contain one or several feed response of the read databases.
In case of failure the CosmosContinuablePagedFlux
will error.
options
- FeedOptions
CosmosContinuablePagedFlux
containing one or several feed response pages of read databases or an error.public CosmosContinuablePagedFlux<CosmosDatabaseProperties> readAllDatabases()
After subscription the operation will be performed.
The CosmosContinuablePagedFlux
will contain one or several feed response of the read databases.
In case of failure the CosmosContinuablePagedFlux
will error.
CosmosContinuablePagedFlux
containing one or several feed response pages of read databases or an error.public CosmosContinuablePagedFlux<CosmosDatabaseProperties> queryDatabases(String query, FeedOptions options)
After subscription the operation will be performed.
The CosmosContinuablePagedFlux
will contain one or several feed response of the read databases.
In case of failure the CosmosContinuablePagedFlux
will error.
query
- the query.options
- the feed options.CosmosContinuablePagedFlux
containing one or several feed response pages of read databases or an error.public CosmosContinuablePagedFlux<CosmosDatabaseProperties> queryDatabases(SqlQuerySpec querySpec, FeedOptions options)
After subscription the operation will be performed.
The CosmosContinuablePagedFlux
will contain one or several feed response of the read databases.
In case of failure the CosmosContinuablePagedFlux
will error.
querySpec
- the SQL query specification.options
- the feed options.CosmosContinuablePagedFlux
containing one or several feed response pages of read databases or an error.public reactor.core.publisher.Mono<DatabaseAccount> readDatabaseAccount()
public CosmosAsyncDatabase getDatabase(String id)
id
- name of the databaseCosmosAsyncDatabase
public void close()
CosmosAsyncClient
instance and cleans up the resources.close
in interface AutoCloseable
Copyright © 2020 Microsoft Corporation. All rights reserved.