Restorable Sql Containers - List

Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers?api-version=2024-08-15
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers?api-version=2024-08-15&restorableSqlDatabaseRid={restorableSqlDatabaseRid}&startTime={startTime}&endTime={endTime}

URI Parameters

Name In Required Type Description
instanceId
path True

string

The instanceId GUID of a restorable database account.

location
path True

string

Cosmos DB region, with spaces between words and each word capitalized.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

endTime
query

string

Restorable Sql containers event feed end time.

restorableSqlDatabaseRid
query

string

The resource ID of the SQL database.

startTime
query

string

Restorable Sql containers event feed start time.

Responses

Name Type Description
200 OK

RestorableSqlContainersListResult

The operation completed successfully.

Other Status Codes

CloudError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation Impersonate your user account

Examples

CosmosDBRestorableSqlContainerList

Sample request

GET https://management.azure.com/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers?api-version=2024-08-15&restorableSqlDatabaseRid=3fu-hg==

Sample response

{
  "value": [
    {
      "id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers/79609a98-3394-41f8-911f-cfab0c075c86",
      "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlContainers",
      "name": "79609a98-3394-41f8-911f-cfab0c075c86",
      "properties": {
        "resource": {
          "_rid": "zAyAPQAAAA==",
          "eventTimestamp": "2020-10-13T04:56:42Z",
          "ownerId": "Container1",
          "ownerResourceId": "V18LoLrv-qA=",
          "operationType": "Create",
          "canUndelete": "invalid",
          "container": {
            "id": "Container1",
            "indexingPolicy": {
              "indexingMode": "consistent",
              "automatic": true,
              "includedPaths": [
                {
                  "path": "/*"
                },
                {
                  "path": "/\"_ts\"/?"
                }
              ],
              "excludedPaths": [
                {
                  "path": "/\"_etag\"/?"
                }
              ]
            },
            "conflictResolutionPolicy": {
              "mode": "LastWriterWins",
              "conflictResolutionPath": "/_ts",
              "conflictResolutionProcedure": ""
            },
            "_rid": "V18LoLrv-qA=",
            "_self": "dbs/V18LoA==/colls/V18LoLrv-qA=/",
            "_etag": "\"00003e00-0000-0700-0000-5f85338a0000\""
          }
        }
      }
    },
    {
      "id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableSqlContainers/e85298a1-c631-4726-825e-a7ca092e9098",
      "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlContainers",
      "name": "e85298a1-c631-4726-825e-a7ca092e9098",
      "properties": {
        "resource": {
          "_rid": "PrArcgAAAA==",
          "eventTimestamp": "2020-10-13T05:03:27Z",
          "ownerId": "Container1",
          "ownerResourceId": "V18LoLrv-qA=",
          "operationType": "Replace",
          "canUndelete": "invalid",
          "container": {
            "id": "Container1",
            "indexingPolicy": {
              "indexingMode": "consistent",
              "automatic": true,
              "includedPaths": [
                {
                  "path": "/*"
                },
                {
                  "path": "/\"_ts\"/?"
                }
              ],
              "excludedPaths": [
                {
                  "path": "/\"_etag\"/?"
                }
              ]
            },
            "defaultTtl": 12345,
            "conflictResolutionPolicy": {
              "mode": "LastWriterWins",
              "conflictResolutionPath": "/_ts",
              "conflictResolutionProcedure": ""
            },
            "_rid": "V18LoLrv-qA=",
            "_self": "dbs/V18LoA==/colls/V18LoLrv-qA=/",
            "_etag": "\"00004400-0000-0700-0000-5f85351f0000\""
          }
        }
      }
    }
  ]
}

Definitions

Name Description
ClientEncryptionIncludedPath

.

ClientEncryptionPolicy

Cosmos DB client encryption policy.

CloudError

An error response from the service.

CompositePath
CompositePathSortOrder

Sort order for composite paths.

ComputedProperty

The definition of a computed property

ConflictResolutionMode

Indicates the conflict resolution mode.

ConflictResolutionPolicy

The conflict resolution policy for the container.

Container

Cosmos DB SQL container resource object

ContainerPartitionKey

The configuration of the partition key to be used for partitioning data into multiple partitions

CreateMode

Enum to indicate the mode of account creation.

DataType

The datatype for which the indexing behavior is applied to.

ErrorResponse

Error Response.

ExcludedPath
IncludedPath

The paths that are included in indexing

Indexes

The indexes for the path.

IndexingMode

Indicates the indexing mode.

IndexingPolicy

Cosmos DB indexing policy

IndexKind

Indicates the type of index.

OperationType

Enum to indicate the operation type of the event.

PartitionKind

Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create

Resource

The resource of an Azure Cosmos DB SQL container event

ResourceRestoreParameters

Parameters to indicate the information about the restore.

RestorableSqlContainerGetResult

An Azure Cosmos DB SQL container event

RestorableSqlContainersListResult

The List operation response, that contains the SQL container events and their properties.

SpatialSpec
SpatialType

Indicates the spatial type of index.

UniqueKey

The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

UniqueKeyPolicy

The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.

ClientEncryptionIncludedPath

.

Name Type Description
clientEncryptionKeyId

string

The identifier of the Client Encryption Key to be used to encrypt the path.

encryptionAlgorithm

string

The encryption algorithm which will be used. Eg - AEAD_AES_256_CBC_HMAC_SHA256.

encryptionType

string

The type of encryption to be performed. Eg - Deterministic, Randomized.

path

string

Path that needs to be encrypted.

ClientEncryptionPolicy

Cosmos DB client encryption policy.

Name Type Description
includedPaths

ClientEncryptionIncludedPath[]

Paths of the item that need encryption along with path-specific settings.

policyFormatVersion

integer

Version of the client encryption policy definition. Supported versions are 1 and 2. Version 2 supports id and partition key path encryption.

CloudError

An error response from the service.

Name Type Description
error

ErrorResponse

Error Response.

CompositePath

Name Type Description
order

CompositePathSortOrder

Sort order for composite paths.

path

string

The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)

CompositePathSortOrder

Sort order for composite paths.

Name Type Description
ascending

string

descending

string

ComputedProperty

The definition of a computed property

Name Type Description
name

string

The name of a computed property, for example - "cp_lowerName"

query

string

The query that evaluates the value for computed property, for example - "SELECT VALUE LOWER(c.name) FROM c"

ConflictResolutionMode

Indicates the conflict resolution mode.

Name Type Description
Custom

string

LastWriterWins

string

ConflictResolutionPolicy

The conflict resolution policy for the container.

Name Type Default value Description
conflictResolutionPath

string

The conflict resolution path in the case of LastWriterWins mode.

conflictResolutionProcedure

string

The procedure to resolve conflicts in the case of custom mode.

mode

ConflictResolutionMode

LastWriterWins

Indicates the conflict resolution mode.

Container

Cosmos DB SQL container resource object

Name Type Default value Description
_etag

string

A system generated property representing the resource etag required for optimistic concurrency control.

_rid

string

A system generated property. A unique identifier.

_self

string

A system generated property that specifies the addressable path of the container resource.

_ts

number

A system generated property that denotes the last updated timestamp of the resource.

analyticalStorageTtl

integer

Analytical TTL.

clientEncryptionPolicy

ClientEncryptionPolicy

The client encryption policy for the container.

computedProperties

ComputedProperty[]

List of computed properties

conflictResolutionPolicy

ConflictResolutionPolicy

The conflict resolution policy for the container.

createMode

CreateMode

Default

Enum to indicate the mode of resource creation.

defaultTtl

integer

Default time to live

id

string

Name of the Cosmos DB SQL container

indexingPolicy

IndexingPolicy

The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container

partitionKey

ContainerPartitionKey

The configuration of the partition key to be used for partitioning data into multiple partitions

restoreParameters

ResourceRestoreParameters

Parameters to indicate the information about the restore

uniqueKeyPolicy

UniqueKeyPolicy

The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.

ContainerPartitionKey

The configuration of the partition key to be used for partitioning data into multiple partitions

Name Type Default value Description
kind

PartitionKind

Hash

Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create

paths

string[]

List of paths using which data within the container can be partitioned

systemKey

boolean

Indicates if the container is using a system generated partition key

version

integer

Indicates the version of the partition key definition

CreateMode

Enum to indicate the mode of account creation.

Name Type Description
Default

string

Restore

string

DataType

The datatype for which the indexing behavior is applied to.

Name Type Description
LineString

string

MultiPolygon

string

Number

string

Point

string

Polygon

string

String

string

ErrorResponse

Error Response.

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

ExcludedPath

Name Type Description
path

string

The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)

IncludedPath

The paths that are included in indexing

Name Type Description
indexes

Indexes[]

List of indexes for this path

path

string

The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)

Indexes

The indexes for the path.

Name Type Default value Description
dataType

DataType

String

The datatype for which the indexing behavior is applied to.

kind

IndexKind

Hash

Indicates the type of index.

precision

integer

The precision of the index. -1 is maximum precision.

IndexingMode

Indicates the indexing mode.

Name Type Description
consistent

string

lazy

string

none

string

IndexingPolicy

Cosmos DB indexing policy

Name Type Default value Description
automatic

boolean

Indicates if the indexing policy is automatic

compositeIndexes

CompositePath[]

List of composite path list

excludedPaths

ExcludedPath[]

List of paths to exclude from indexing

includedPaths

IncludedPath[]

List of paths to include in the indexing

indexingMode

IndexingMode

consistent

Indicates the indexing mode.

spatialIndexes

SpatialSpec[]

List of spatial specifics

IndexKind

Indicates the type of index.

Name Type Description
Hash

string

Range

string

Spatial

string

OperationType

Enum to indicate the operation type of the event.

Name Type Description
Create

string

Delete

string

Recreate

string

Replace

string

SystemOperation

string

PartitionKind

Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create

Name Type Description
Hash

string

MultiHash

string

Range

string

Resource

The resource of an Azure Cosmos DB SQL container event

Name Type Description
_rid

string

A system generated property. A unique identifier.

canUndelete

string

A state of this container to identify if this container is restorable in same account.

canUndeleteReason

string

The reason why this container can not be restored in same account.

container

Container

Cosmos DB SQL container resource object

eventTimestamp

string

The when this container event happened.

operationType

OperationType

The operation type of this container event.

ownerId

string

The name of this SQL container.

ownerResourceId

string

The resource ID of this SQL container.

ResourceRestoreParameters

Parameters to indicate the information about the restore.

Name Type Description
restoreSource

string

The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}

restoreTimestampInUtc

string

Time to which the account has to be restored (ISO-8601 format).

restoreWithTtlDisabled

boolean

Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.

RestorableSqlContainerGetResult

An Azure Cosmos DB SQL container event

Name Type Description
id

string

The unique resource Identifier of the ARM resource.

name

string

The name of the ARM resource.

properties.resource

Resource

The resource of an Azure Cosmos DB SQL container event

type

string

The type of Azure resource.

RestorableSqlContainersListResult

The List operation response, that contains the SQL container events and their properties.

Name Type Description
value

RestorableSqlContainerGetResult[]

List of SQL container events and their properties.

SpatialSpec

Name Type Description
path

string

The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)

types

SpatialType[]

List of path's spatial type

SpatialType

Indicates the spatial type of index.

Name Type Description
LineString

string

MultiPolygon

string

Point

string

Polygon

string

UniqueKey

The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

Name Type Description
paths

string[]

List of paths must be unique for each document in the Azure Cosmos DB service

UniqueKeyPolicy

The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.

Name Type Description
uniqueKeys

UniqueKey[]

List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.