cosmos Package

Packages

aio

Modules

auth

Authorization helper functions in the Azure Cosmos database service.

container

Create, read, update and delete items in the Azure Cosmos DB SQL API service.

cosmos_client

Create, read, and delete databases in the Azure Cosmos DB SQL API service.

database

Interact with databases in the Azure Cosmos DB SQL API service.

diagnostics

Diagnostic tools for Azure Cosmos database service operations. IMPORTANT: This file has been marked for deprecation and will be removed in the future. For diagnostics logging in our SDK, please use our CosmosHttpLoggingPolicy outlined in our README.

documents

Classes and enums for documents in the Azure Cosmos database service.

errors

Service-specific Exceptions in the Azure Cosmos database service.

.. warning:: This module is DEPRECATED. Use azure.cosmos.exceptions instead.

exceptions

Service-specific Exceptions in the Azure Cosmos database service.

http_constants

HTTP Constants in the Azure Cosmos database service.

offer

Create throughput properties in the Azure Cosmos DB SQL API service.

partition_key

Create partition keys in the Azure Cosmos DB SQL API service.

permission

Create permissions in the Azure Cosmos DB SQL API service.

scripts

Create, read, update and delete and execute scripts in the Azure Cosmos DB SQL API service.

user

Create, read, update and delete users in the Azure Cosmos DB SQL API service.

Classes

ConnectionRetryPolicy
ConsistencyLevel

Represents the consistency levels supported for Azure Cosmos client operations.

The requested ConsistencyLevel must match or be weaker than that provisioned for the database account. Consistency levels.

Consistency levels by order of strength are Strong, BoundedStaleness, Session, ConsistentPrefix and Eventual.

ContainerProxy

An interface to interact with a specific DB Container.

This class should not be instantiated directly. Instead, use the get_container_client method to get an existing container, or the create_container method to create a new container.

A container in an Azure Cosmos DB SQL API database is a collection of documents, each of which is represented as an Item.

CosmosClient

A client-side logical representation of an Azure Cosmos DB account.

Use this client to configure and execute requests to the Azure Cosmos DB service.

It's recommended to maintain a single instance of CosmosClient per lifetime of the application which enables efficient connection management and performance.

CosmosClient initialization is a heavy operation - don't use initialization CosmosClient instances as credentials or network connectivity validations.

Instantiate a new CosmosClient.

DataType

Specifies the data type of index specs.

DatabaseAccount

Database account.

A DatabaseAccount is the container for databases.

DatabaseProxy

An interface to interact with a specific database.

This class should not be instantiated directly. Instead use the get_database_client method.

A database contains one or more containers, each of which can contain items, stored procedures, triggers, and user-defined functions.

A database can also have associated users, each of which is configured with a set of permissions for accessing certain containers, stored procedures, triggers, user-defined functions, or items.

An Azure Cosmos DB SQL API database has the following system-generated properties. These properties are read-only:

  • _rid: The resource ID.

  • _ts: When the resource was last updated. The value is a timestamp.

  • _self: The unique addressable URI for the resource.

  • _etag: The resource etag required for optimistic concurrency control.

  • _colls: The addressable path of the collections resource.

  • _users: The addressable path of the users resource.

IndexKind

Specifies the index kind of index specs.

IndexingMode

Specifies the supported indexing modes.

PartitionKey

Key used to partition a container into logical partitions.

See https://docs.microsoft.com/azure/cosmos-db/partitioning-overview#choose-partitionkey for information on how to choose partition keys.

Permission

Represents a Permission object in the Azure Cosmos DB SQL API service.

PermissionMode

Applicability of a permission.

ProxyConfiguration

Configuration for a proxy.

SSLConfiguration

Configuration for SSL connections.

See https://requests.readthedocs.io/en/master/user/advanced/#ssl-cert-verification for more information.

ScriptsProxy

An interface to interact with stored procedures.

This class should not be instantiated directly. Instead, use the scripts attribute.

ThroughputProperties

Represents the throughput properties in an Azure Cosmos DB SQL API container.

To read and update throughput properties, use the associated methods on the <xref:Container>. If configuring auto-scale, auto_scale_max_throughput needs to be set and auto_scale_increment_percent can also be set in conjunction with it. The value of offer_throughput will not be allowed to be set in conjunction with the auto-scale settings.

TriggerOperation

Specifies the operations on which a trigger should be executed.

TriggerType

Specifies the type of a trigger.

UserProxy

An interface to interact with a specific user.

This class should not be instantiated directly. Instead, use the get_user_client method.