public class CosmosAsyncDatabase extends Object
| Modifier and Type | Method and Description |
|---|---|
Mono<CosmosContainerResponse> |
createContainer(CosmosContainerProperties containerProperties)
Creates a Cosmos container.
|
Mono<CosmosContainerResponse> |
createContainer(CosmosContainerProperties containerProperties,
CosmosContainerRequestOptions options)
Creates a Cosmos container.
|
Mono<CosmosContainerResponse> |
createContainer(CosmosContainerProperties containerProperties,
ThroughputProperties throughputProperties)
Creates a Cosmos container with custom throughput properties.
|
Mono<CosmosContainerResponse> |
createContainer(CosmosContainerProperties containerProperties,
ThroughputProperties throughputProperties,
CosmosContainerRequestOptions options)
Creates a container.
|
Mono<CosmosContainerResponse> |
createContainer(String id,
String partitionKeyPath)
Creates a Cosmos container.
|
Mono<CosmosContainerResponse> |
createContainer(String id,
String partitionKeyPath,
ThroughputProperties throughputProperties)
Creates a Cosmos container.
|
Mono<CosmosContainerResponse> |
createContainerIfNotExists(CosmosContainerProperties containerProperties)
Creates a Cosmos container if it does not exist on the service.
|
Mono<CosmosContainerResponse> |
createContainerIfNotExists(CosmosContainerProperties containerProperties,
ThroughputProperties throughputProperties)
Creates a Cosmos container if it does not exist on the service.
|
Mono<CosmosContainerResponse> |
createContainerIfNotExists(String id,
String partitionKeyPath)
Creates a Cosmos container if it does not exist on the service.
|
Mono<CosmosContainerResponse> |
createContainerIfNotExists(String id,
String partitionKeyPath,
ThroughputProperties throughputProperties)
Creates a Cosmos container if it does not exist on the service.
|
Mono<CosmosUserResponse> |
createUser(CosmosUserProperties userProperties)
Creates a user After subscription the operation will be performed.
|
Mono<CosmosDatabaseResponse> |
delete()
Deletes a database.
|
Mono<CosmosDatabaseResponse> |
delete(CosmosDatabaseRequestOptions options)
Deletes a database.
|
CosmosAsyncContainer |
getContainer(String id)
Gets a CosmosAsyncContainer object without making a service call
|
String |
getId()
Get the id of the CosmosAsyncDatabase.
|
CosmosAsyncUser |
getUser(String id)
Gets user.
|
CosmosPagedFlux<CosmosContainerProperties> |
queryContainers(SqlQuerySpec querySpec)
Query for cosmos containers in a cosmos database.
|
CosmosPagedFlux<CosmosContainerProperties> |
queryContainers(SqlQuerySpec querySpec,
CosmosQueryRequestOptions options)
Query for cosmos containers in a cosmos database.
|
CosmosPagedFlux<CosmosContainerProperties> |
queryContainers(String query)
Query for cosmos containers in a cosmos database.
|
CosmosPagedFlux<CosmosContainerProperties> |
queryContainers(String query,
CosmosQueryRequestOptions options)
Query for cosmos containers in a cosmos database.
|
CosmosPagedFlux<CosmosUserProperties> |
queryUsers(SqlQuerySpec querySpec)
Query for cosmos users in a database.
|
CosmosPagedFlux<CosmosUserProperties> |
queryUsers(SqlQuerySpec querySpec,
CosmosQueryRequestOptions options)
Query for cosmos users in a database.
|
CosmosPagedFlux<CosmosUserProperties> |
queryUsers(String query)
Query for cosmos users in a database.
|
CosmosPagedFlux<CosmosUserProperties> |
queryUsers(String query,
CosmosQueryRequestOptions options)
Query for cosmos users in a database.
|
Mono<CosmosDatabaseResponse> |
read()
Reads a database.
|
Mono<CosmosDatabaseResponse> |
read(CosmosDatabaseRequestOptions options)
Reads a database.
|
CosmosPagedFlux<CosmosContainerProperties> |
readAllContainers()
Reads all cosmos containers.
|
CosmosPagedFlux<CosmosContainerProperties> |
readAllContainers(CosmosQueryRequestOptions options)
Reads all cosmos containers.
|
CosmosPagedFlux<CosmosUserProperties> |
readAllUsers()
Reads all cosmos users in a database.
|
Mono<ThroughputResponse> |
readThroughput()
Gets the throughput of the database.
|
Mono<ThroughputResponse> |
replaceThroughput(ThroughputProperties throughputProperties)
Sets throughput provisioned for a container in measurement of
Requests-per-Unit in the Azure Cosmos service.
|
Mono<CosmosUserResponse> |
upsertUser(CosmosUserProperties userProperties)
Upsert a user.
|
public String getId()
public Mono<CosmosDatabaseResponse> read()
After subscription the operation will be performed. The Mono upon
successful completion will contain a single cosmos database respone with the
read database. In case of failure the Mono will error.
Mono containing the single cosmos database respone with
the read database or an error.public Mono<CosmosDatabaseResponse> read(CosmosDatabaseRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos cosmos database respone with the
read database. In case of failure the Mono will error.
options - the request options.Mono containing the single cosmos database response with
the read database or an error.public Mono<CosmosDatabaseResponse> delete()
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos database response with the
deleted database. In case of failure the Mono will error.
Mono containing the single cosmos database response.public Mono<CosmosDatabaseResponse> delete(CosmosDatabaseRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos database response with the
deleted database. In case of failure the Mono will error.
options - the request options.Mono containing the single cosmos database response.public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
containerProperties - the container properties.Mono containing the single cosmos container response with
the created container or an error.IllegalArgumentException - containerProperties cannot be null.public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
containerProperties - the container properties.throughputProperties - the throughput properties for the container.Mono containing the single cosmos container response with
the created container or an error.IllegalArgumentException - thown if containerProerties are null.public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties, CosmosContainerRequestOptions options)
containerProperties - the container properties.throughputProperties - the throughput properties.options - the request options.public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
containerProperties - the containerProperties.options - the cosmos container request options.Mono containing the cosmos container response with the
created container or an error.IllegalArgumentException - containerProperties can not be null.public Mono<CosmosContainerResponse> createContainer(String id, String partitionKeyPath)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
id - the cosmos container id.partitionKeyPath - the partition key path.Mono containing the cosmos container response with the
created container or an error.public Mono<CosmosContainerResponse> createContainer(String id, String partitionKeyPath, ThroughputProperties throughputProperties)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
id - the cosmos container id.partitionKeyPath - the partition key path.throughputProperties - the throughput properties for the container.Mono containing the cosmos container response with the
created container or an error.public Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosContainerProperties containerProperties)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created or existing container. In case of failure the Mono will
error.
containerProperties - the container propertiesMono containing the cosmos container response with the
created or existing container or an error.public Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties)
The throughput properties will only be used if the specified container
does not exist and therefor a new container will be created.
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created or existing container. In case of failure the Mono will
error.
containerProperties - the container properties.throughputProperties - the throughput properties for the container.Mono containing the cosmos container response with the
created or existing container or an error.public Mono<CosmosContainerResponse> createContainerIfNotExists(String id, String partitionKeyPath)
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
id - the cosmos container id.partitionKeyPath - the partition key path.Mono containing the cosmos container response with the
created container or an error.public Mono<CosmosContainerResponse> createContainerIfNotExists(String id, String partitionKeyPath, ThroughputProperties throughputProperties)
The throughput properties will only be used if the specified container
does not exist and therefor a new container will be created.
After subscription the operation will be performed. The Mono upon
successful completion will contain a cosmos container response with the
created container. In case of failure the Mono will error.
id - the cosmos container id.partitionKeyPath - the partition key path.throughputProperties - the throughput properties for the container.Mono containing the cosmos container response with the
created container or an error.public CosmosPagedFlux<CosmosContainerProperties> readAllContainers(CosmosQueryRequestOptions options)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the read containers. In case of
failure the CosmosPagedFlux will error.
options - CosmosQueryRequestOptionsCosmosPagedFlux containing one or several feed response pages of read
containers or an error.public CosmosPagedFlux<CosmosContainerProperties> readAllContainers()
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the read containers. In case of
failure the CosmosPagedFlux will error.
CosmosPagedFlux containing one or several feed response pages of read
containers or an error.public CosmosPagedFlux<CosmosContainerProperties> queryContainers(String query)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained containers. In case of
failure the CosmosPagedFlux will error.
query - the query.CosmosPagedFlux containing one or several feed response pages of the
obtained containers or an error.public CosmosPagedFlux<CosmosContainerProperties> queryContainers(String query, CosmosQueryRequestOptions options)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained containers. In case of
failure the CosmosPagedFlux will error.
query - the query.options - the query request options.CosmosPagedFlux containing one or several feed response pages of the
obtained containers or an error.public CosmosPagedFlux<CosmosContainerProperties> queryContainers(SqlQuerySpec querySpec)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained containers. In case of
failure the CosmosPagedFlux will error.
querySpec - the SQL query specification.CosmosPagedFlux containing one or several feed response pages of the
obtained containers or an error.public CosmosPagedFlux<CosmosContainerProperties> queryContainers(SqlQuerySpec querySpec, CosmosQueryRequestOptions options)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained containers. In case of
failure the CosmosPagedFlux will error.
querySpec - the SQL query specification.options - the query request options.CosmosPagedFlux containing one or several feed response pages of the
obtained containers or an error.public CosmosAsyncContainer getContainer(String id)
id - id of the containerpublic Mono<CosmosUserResponse> createUser(CosmosUserProperties userProperties)
Mono upon successful completion will contain a single resource
response with the created user. In case of failure the Mono will
error.userProperties - the cosmos user propertiesMono containing the single resource response with the
created cosmos user or an error.public Mono<CosmosUserResponse> upsertUser(CosmosUserProperties userProperties)
Mono upon successful completion will contain a single
resource response with the created user. In case of failure the Mono
will error.userProperties - the cosmos user propertiesMono containing the single resource response with the
upserted user or an error.public CosmosPagedFlux<CosmosUserProperties> readAllUsers()
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the read cosmos users. In case of
failure the CosmosPagedFlux will error.
CosmosPagedFlux containing one or several feed response pages of the
read cosmos users or an error.public CosmosPagedFlux<CosmosUserProperties> queryUsers(String query)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained users. In case of
failure the CosmosPagedFlux will error.
query - query as string.CosmosPagedFlux containing one or several feed response pages of the
obtained users or an error.public CosmosPagedFlux<CosmosUserProperties> queryUsers(String query, CosmosQueryRequestOptions options)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained users. In case of
failure the CosmosPagedFlux will error.
query - query as string.options - the query request options.CosmosPagedFlux containing one or several feed response pages of the
obtained users or an error.public CosmosPagedFlux<CosmosUserProperties> queryUsers(SqlQuerySpec querySpec)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained users. In case of
failure the CosmosPagedFlux will error.
querySpec - the SQL query specification.CosmosPagedFlux containing one or several feed response pages of the
obtained users or an error.public CosmosPagedFlux<CosmosUserProperties> queryUsers(SqlQuerySpec querySpec, CosmosQueryRequestOptions options)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained users. In case of
failure the CosmosPagedFlux will error.
querySpec - the SQL query specification.options - the query request options.CosmosPagedFlux containing one or several feed response pages of the
obtained users or an error.public CosmosAsyncUser getUser(String id)
id - the idpublic Mono<ThroughputResponse> replaceThroughput(ThroughputProperties throughputProperties)
throughputProperties - the throughput properties.public Mono<ThroughputResponse> readThroughput()
Copyright © 2020 Microsoft Corporation. All rights reserved.