Class CosmosAsyncDatabase
-
Method Summary
Modifier and TypeMethodDescriptioncreateClientEncryptionKey(CosmosClientEncryptionKeyProperties keyProperties) Creates a client encryption key after subscription the operation will be performed.createContainer(CosmosContainerProperties containerProperties) Creates a Cosmos container.createContainer(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options) Creates a Cosmos container.createContainer(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties) Creates a Cosmos container with custom throughput properties.createContainer(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties, CosmosContainerRequestOptions options) Creates a container.createContainer(String id, String partitionKeyPath) Creates a Cosmos container.createContainer(String id, String partitionKeyPath, ThroughputProperties throughputProperties) Creates a Cosmos container.createContainerIfNotExists(CosmosContainerProperties containerProperties) Creates a Cosmos container if it does not exist on the service.createContainerIfNotExists(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties) Creates a Cosmos container if it does not exist on the service.createContainerIfNotExists(String id, String partitionKeyPath) Creates a Cosmos container if it does not exist on the service.createContainerIfNotExists(String id, String partitionKeyPath, ThroughputProperties throughputProperties) Creates a Cosmos container if it does not exist on the service.createUser(CosmosUserProperties userProperties) Creates a user After subscription the operation will be performed.delete()Deletes a database.delete(CosmosDatabaseRequestOptions options) Deletes a database.Gets a CosmosAsyncClientEncryptionKey object without making a service callgetContainer(String id) Gets a CosmosAsyncContainer object without making a service callgetId()Get the id of the CosmosAsyncDatabase.Gets user.queryClientEncryptionKeys(SqlQuerySpec querySpec) Query for cosmos client encryption keys in a database.queryClientEncryptionKeys(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) Query for cosmos client encryption keys in a database.queryClientEncryptionKeys(String query) Query for cosmos client encryption keys in a database.queryClientEncryptionKeys(String query, CosmosQueryRequestOptions options) Query for cosmos client encryption keys in a database.queryContainers(SqlQuerySpec querySpec) Query for cosmos containers in a cosmos database.queryContainers(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) Query for cosmos containers in a cosmos database.queryContainers(String query) Query for cosmos containers in a cosmos database.queryContainers(String query, CosmosQueryRequestOptions options) Query for cosmos containers in a cosmos database.queryUsers(SqlQuerySpec querySpec) Query for cosmos users in a database.queryUsers(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) Query for cosmos users in a database.queryUsers(String query) Query for cosmos users in a database.queryUsers(String query, CosmosQueryRequestOptions options) Query for cosmos users in a database.read()Reads a database.read(CosmosDatabaseRequestOptions options) Reads a database.Reads all cosmos client encryption keys in a database.Reads all cosmos client encryption keys in a database.Reads all cosmos containers.Reads all cosmos containers.Reads all cosmos users in a database.Gets the throughput of the database.replaceThroughput(ThroughputProperties throughputProperties) Sets throughput provisioned for a container in measurement of Requests-per-Unit in the Azure Cosmos service.upsertUser(CosmosUserProperties userProperties) Upsert a user.
-
Method Details
-
getId
Get the id of the CosmosAsyncDatabase.- Returns:
- the id of the CosmosAsyncDatabase.
-
read
Reads a database.After subscription the operation will be performed. The
Monoupon successful completion will contain a single cosmos database respone with the read database. In case of failure theMonowill error.- Returns:
- an
Monocontaining the single cosmos database respone with the read database or an error.
-
read
Reads a database.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos cosmos database respone with the read database. In case of failure theMonowill error.- Parameters:
options- the request options.- Returns:
- an
Monocontaining the single cosmos database response with the read database or an error.
-
delete
Deletes a database.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos database response with the deleted database. In case of failure theMonowill error.- Returns:
- an
Monocontaining the single cosmos database response.
-
delete
Deletes a database.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos database response with the deleted database. In case of failure theMonowill error.- Parameters:
options- the request options.- Returns:
- an
Monocontaining the single cosmos database response.
-
createContainer
Creates a Cosmos container.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
containerProperties- the container properties.- Returns:
- a
Monocontaining the single cosmos container response with the created container or an error. - Throws:
IllegalArgumentException- containerProperties cannot be null.
-
createContainer
public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties) Creates a Cosmos container with custom throughput properties.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
containerProperties- the container properties.throughputProperties- the throughput properties for the container.- Returns:
- a
Monocontaining the single cosmos container response with the created container or an error. - Throws:
IllegalArgumentException- thown if containerProerties are null.
-
createContainer
public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties, CosmosContainerRequestOptions options) Creates a container.- Parameters:
containerProperties- the container properties.throughputProperties- the throughput properties.options- the request options.- Returns:
- the mono.
-
createContainer
public Mono<CosmosContainerResponse> createContainer(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options) Creates a Cosmos container.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
containerProperties- the containerProperties.options- the cosmos container request options.- Returns:
- a
Monocontaining the cosmos container response with the created container or an error. - Throws:
IllegalArgumentException- containerProperties can not be null.
-
createContainer
Creates a Cosmos container.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
id- the cosmos container id.partitionKeyPath- the partition key path.- Returns:
- a
Monocontaining the cosmos container response with the created container or an error.
-
createContainer
public Mono<CosmosContainerResponse> createContainer(String id, String partitionKeyPath, ThroughputProperties throughputProperties) Creates a Cosmos container.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
id- the cosmos container id.partitionKeyPath- the partition key path.throughputProperties- the throughput properties for the container.- Returns:
- a
Monocontaining the cosmos container response with the created container or an error.
-
createContainerIfNotExists
public Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosContainerProperties containerProperties) Creates a Cosmos container if it does not exist on the service.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created or existing container. In case of failure theMonowill error.- Parameters:
containerProperties- the container properties- Returns:
- a
Monocontaining the cosmos container response with the created or existing container or an error.
-
createContainerIfNotExists
public Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosContainerProperties containerProperties, ThroughputProperties throughputProperties) Creates a Cosmos container if it does not exist on the service.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
Monoupon successful completion will contain a cosmos container response with the created or existing container. In case of failure theMonowill error.- Parameters:
containerProperties- the container properties.throughputProperties- the throughput properties for the container.- Returns:
- a
Monocontaining the cosmos container response with the created or existing container or an error.
-
createContainerIfNotExists
Creates a Cosmos container if it does not exist on the service.After subscription the operation will be performed. The
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
id- the cosmos container id.partitionKeyPath- the partition key path.- Returns:
- a
Monocontaining the cosmos container response with the created container or an error.
-
createContainerIfNotExists
public Mono<CosmosContainerResponse> createContainerIfNotExists(String id, String partitionKeyPath, ThroughputProperties throughputProperties) Creates a Cosmos container if it does not exist on the service.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
Monoupon successful completion will contain a cosmos container response with the created container. In case of failure theMonowill error.- Parameters:
id- the cosmos container id.partitionKeyPath- the partition key path.throughputProperties- the throughput properties for the container.- Returns:
- a
Monocontaining the cosmos container response with the created container or an error.
-
readAllContainers
public CosmosPagedFlux<CosmosContainerProperties> readAllContainers(CosmosQueryRequestOptions options) Reads all cosmos containers.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the read containers. In case of failure theCosmosPagedFluxwill error.- Parameters:
options-CosmosQueryRequestOptions- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of read containers or an error.
-
readAllContainers
Reads all cosmos containers.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the read containers. In case of failure theCosmosPagedFluxwill error.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of read containers or an error.
-
queryContainers
Query for cosmos containers in a cosmos database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained containers. In case of failure theCosmosPagedFluxwill error.- Parameters:
query- the query.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained containers or an error.
-
queryContainers
public CosmosPagedFlux<CosmosContainerProperties> queryContainers(String query, CosmosQueryRequestOptions options) Query for cosmos containers in a cosmos database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained containers. In case of failure theCosmosPagedFluxwill error.- Parameters:
query- the query.options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained containers or an error.
-
queryContainers
Query for cosmos containers in a cosmos database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained containers. In case of failure theCosmosPagedFluxwill error.- Parameters:
querySpec- the SQL query specification.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained containers or an error.
-
queryContainers
public CosmosPagedFlux<CosmosContainerProperties> queryContainers(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) Query for cosmos containers in a cosmos database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained containers. In case of failure theCosmosPagedFluxwill error.- Parameters:
querySpec- the SQL query specification.options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained containers or an error.
-
getContainer
Gets a CosmosAsyncContainer object without making a service call- Parameters:
id- id of the container- Returns:
- Cosmos Container
-
createUser
Creates a user After subscription the operation will be performed. TheMonoupon successful completion will contain a single resource response with the created user. In case of failure theMonowill error.- Parameters:
userProperties- the cosmos user properties- Returns:
- an
Monocontaining the single resource response with the created cosmos user or an error.
-
createClientEncryptionKey
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public Mono<CosmosClientEncryptionKeyResponse> createClientEncryptionKey(CosmosClientEncryptionKeyProperties keyProperties) Creates a client encryption key after subscription the operation will be performed. TheMonoupon successful completion will contain a single resource response with the created client encryption key. In case of failure theMonowill error.- Parameters:
keyProperties- the cosmos client encryption key properties- Returns:
- an
Monocontaining the single resource response with the created cosmos client encryption key or an error.
-
upsertUser
Upsert a user. Upsert will create a new user if it doesn't exist, or replace the existing one if it does. After subscription the operation will be performed. TheMonoupon successful completion will contain a single resource response with the created user. In case of failure theMonowill error.- Parameters:
userProperties- the cosmos user properties- Returns:
- an
Monocontaining the single resource response with the upserted user or an error.
-
readAllUsers
Reads all cosmos users in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the read cosmos users. In case of failure theCosmosPagedFluxwill error.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the read cosmos users or an error.
-
getClientEncryptionKey
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosAsyncClientEncryptionKey getClientEncryptionKey(String id) Gets a CosmosAsyncClientEncryptionKey object without making a service call- Parameters:
id- id of the clientEncryptionKey- Returns:
- Cosmos ClientEncryptionKey
-
readAllClientEncryptionKeys
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosPagedFlux<CosmosClientEncryptionKeyProperties> readAllClientEncryptionKeys()Reads all cosmos client encryption keys in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the read cosmos client encryption keys. In case of failure theCosmosPagedFluxwill error.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the read cosmos client encryption keys or an error.
-
readAllClientEncryptionKeys
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosPagedFlux<CosmosClientEncryptionKeyProperties> readAllClientEncryptionKeys(CosmosQueryRequestOptions options) Reads all cosmos client encryption keys in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the read cosmos client encryption keys. In case of failure theCosmosPagedFluxwill error.- Parameters:
options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the read cosmos client encryption keys or an error.
-
queryClientEncryptionKeys
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosPagedFlux<CosmosClientEncryptionKeyProperties> queryClientEncryptionKeys(String query) Query for cosmos client encryption keys in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained client encryption keys. In case of failure theCosmosPagedFluxwill error.- Parameters:
query- query as string.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained client encryption keys or an error.
-
queryClientEncryptionKeys
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosPagedFlux<CosmosClientEncryptionKeyProperties> queryClientEncryptionKeys(String query, CosmosQueryRequestOptions options) Query for cosmos client encryption keys in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained client encryption keys. In case of failure theCosmosPagedFluxwill error.- Parameters:
query- query as string.options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained client encryption keys or an error.
-
queryClientEncryptionKeys
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosPagedFlux<CosmosClientEncryptionKeyProperties> queryClientEncryptionKeys(SqlQuerySpec querySpec) Query for cosmos client encryption keys in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained client encryption keys. In case of failure theCosmosPagedFluxwill error.- Parameters:
querySpec- the SQL query specification.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained client encryption keys or an error.
-
queryClientEncryptionKeys
@Beta(value=V4_14_0, warningText="Preview API - subject to change in non-backwards compatible way") public CosmosPagedFlux<CosmosClientEncryptionKeyProperties> queryClientEncryptionKeys(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) Query for cosmos client encryption keys in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained client encryption keys. In case of failure theCosmosPagedFluxwill error.- Parameters:
querySpec- the SQL query specification.options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained client encryption keys or an error.
-
queryUsers
Query for cosmos users in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained users. In case of failure theCosmosPagedFluxwill error.- Parameters:
query- query as string.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained users or an error.
-
queryUsers
public CosmosPagedFlux<CosmosUserProperties> queryUsers(String query, CosmosQueryRequestOptions options) Query for cosmos users in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained users. In case of failure theCosmosPagedFluxwill error.- Parameters:
query- query as string.options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained users or an error.
-
queryUsers
Query for cosmos users in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained users. In case of failure theCosmosPagedFluxwill error.- Parameters:
querySpec- the SQL query specification.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained users or an error.
-
queryUsers
public CosmosPagedFlux<CosmosUserProperties> queryUsers(SqlQuerySpec querySpec, CosmosQueryRequestOptions options) Query for cosmos users in a database.After subscription the operation will be performed. The
CosmosPagedFluxwill contain one or several feed response of the obtained users. In case of failure theCosmosPagedFluxwill error.- Parameters:
querySpec- the SQL query specification.options- the query request options.- Returns:
- a
CosmosPagedFluxcontaining one or several feed response pages of the obtained users or an error.
-
getUser
Gets user.- Parameters:
id- the id- Returns:
- the user
-
replaceThroughput
Sets throughput provisioned for a container in measurement of Requests-per-Unit in the Azure Cosmos service.- Parameters:
throughputProperties- the throughput properties.- Returns:
- the mono.
-
readThroughput
Gets the throughput of the database.- Returns:
- the mono containing throughput response.
-