public class CosmosDatabase extends Object
public String getId()
public CosmosDatabaseResponse read() throws CosmosClientException
CosmosDatabaseResponse
CosmosClientException
- the cosmos client exceptionpublic CosmosDatabaseResponse read(CosmosDatabaseRequestOptions options) throws CosmosClientException
options
- the CosmosDatabaseRequestOptions
request options.CosmosDatabaseResponse
CosmosClientException
- the cosmos client exceptionpublic CosmosDatabaseResponse delete() throws CosmosClientException
CosmosDatabaseResponse
CosmosClientException
- the cosmos client exceptionpublic CosmosDatabaseResponse delete(CosmosDatabaseRequestOptions options) throws CosmosClientException
options
- the CosmosDatabaseRequestOptions
request options.CosmosDatabaseResponse
CosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainer(CosmosContainerProperties containerProperties) throws CosmosClientException
containerProperties
- the CosmosContainerProperties
CosmosContainerResponse
with the created container.CosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainer(CosmosContainerProperties containerProperties, int throughput) throws CosmosClientException
containerProperties
- the CosmosContainerProperties
throughput
- the throughputCosmosContainerResponse
with the created container.CosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainer(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options) throws CosmosClientException
containerProperties
- the CosmosContainerProperties
options
- the CosmosContainerProperties
CosmosContainerResponse
with the created container.CosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainer(CosmosContainerProperties containerProperties, int throughput, CosmosContainerRequestOptions options) throws CosmosClientException
containerProperties
- the CosmosContainerProperties
throughput
- the throughputoptions
- the CosmosContainerProperties
CosmosContainerResponse
with the created container.CosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainer(String id, String partitionKeyPath) throws CosmosClientException
id
- the idpartitionKeyPath
- the partition key pathCosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainer(String id, String partitionKeyPath, int throughput) throws CosmosClientException
id
- the idpartitionKeyPath
- the partition key paththroughput
- the throughputCosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainerIfNotExists(CosmosContainerProperties containerProperties) throws CosmosClientException
containerProperties
- the container propertiesCosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainerIfNotExists(CosmosContainerProperties containerProperties, int throughput) throws CosmosClientException
containerProperties
- the container propertiesthroughput
- the throughputCosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainerIfNotExists(String id, String partitionKeyPath) throws CosmosClientException
id
- the idpartitionKeyPath
- the partition key pathCosmosClientException
- the cosmos client exceptionpublic CosmosContainerResponse createContainerIfNotExists(String id, String partitionKeyPath, int throughput) throws CosmosClientException
id
- the idpartitionKeyPath
- the partition key paththroughput
- the throughputCosmosClientException
- the cosmos client exceptionpublic CosmosContinuablePagedIterable<CosmosContainerProperties> readAllContainers(FeedOptions options)
options
- the optionsCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosContainerProperties> readAllContainers()
CosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosContainerProperties> queryContainers(String query)
query
- the queryCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosContainerProperties> queryContainers(String query, FeedOptions options)
query
- the queryoptions
- the optionsCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosContainerProperties> queryContainers(SqlQuerySpec querySpec)
querySpec
- the query specCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosContainerProperties> queryContainers(SqlQuerySpec querySpec, FeedOptions options)
querySpec
- the query specoptions
- the optionsCosmosContinuablePagedIterable
public CosmosContainer getContainer(String id)
id
- id of the containerpublic CosmosUserResponse createUser(CosmosUserProperties settings) throws CosmosClientException
settings
- the settingsCosmosClientException
- the cosmos client exceptionpublic CosmosUserResponse upsertUser(CosmosUserProperties settings) throws CosmosClientException
settings
- the settingsCosmosClientException
- the cosmos client exceptionpublic CosmosContinuablePagedIterable<CosmosUserProperties> readAllUsers()
CosmosContinuablePagedIterable
.CosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosUserProperties> readAllUsers(FeedOptions options)
CosmosContinuablePagedIterable
.options
- the optionsCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosUserProperties> queryUsers(String query)
CosmosContinuablePagedIterable
.query
- the queryCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosUserProperties> queryUsers(String query, FeedOptions options)
CosmosContinuablePagedIterable
.query
- the queryoptions
- the optionsCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosUserProperties> queryUsers(SqlQuerySpec querySpec)
CosmosContinuablePagedIterable
.querySpec
- the query specCosmosContinuablePagedIterable
public CosmosContinuablePagedIterable<CosmosUserProperties> queryUsers(SqlQuerySpec querySpec, FeedOptions options)
CosmosContinuablePagedIterable
.querySpec
- the query specoptions
- the optionsCosmosContinuablePagedIterable
public CosmosUser getUser(String id)
id
- the idpublic Integer readProvisionedThroughput() throws CosmosClientException
CosmosClientException
- the cosmos client exceptionpublic Integer replaceProvisionedThroughput(int requestUnitsPerSecond) throws CosmosClientException
requestUnitsPerSecond
- the request units per secondCosmosClientException
- the cosmos client exceptionCopyright © 2020 Microsoft Corporation. All rights reserved.