Restorable Mongodb Collections - List

Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections 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}/restorableMongodbCollections?api-version=2024-11-15
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections?api-version=2024-11-15&restorableMongodbDatabaseRid={restorableMongodbDatabaseRid}&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 MongoDB collections event feed end time.

restorableMongodbDatabaseRid
query

string

The resource ID of the MongoDB database.

startTime
query

string

Restorable MongoDB collections event feed start time.

Responses

Name Type Description
200 OK

RestorableMongodbCollectionsListResult

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

CosmosDBRestorableMongodbCollectionList

Sample request

GET https://management.azure.com/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections?api-version=2024-11-15&restorableMongodbDatabaseRid=PD5DALigDgw=

Sample response

{
  "value": [
    {
      "id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86",
      "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections",
      "name": "79609a98-3394-41f8-911f-cfab0c075c86",
      "properties": {
        "resource": {
          "_rid": "zAyAPQAAAA==",
          "eventTimestamp": "2020-10-13T04:56:42Z",
          "ownerId": "Collection1",
          "ownerResourceId": "V18LoLrv-qA=",
          "operationType": "Create",
          "canUndelete": "invalid"
        }
      }
    },
    {
      "id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86",
      "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections",
      "name": "79609a98-3394-41f8-911f-cfab0c075c86",
      "properties": {
        "resource": {
          "_rid": "zAyAPQAAAA==",
          "eventTimestamp": "2020-10-13T04:56:42Z",
          "ownerId": "Collection1",
          "ownerResourceId": "V18LoLrv-qA=",
          "operationType": "Delete",
          "canUndelete": "notRestorable",
          "canUndeleteReason": "Individual shared database collections restore is not supported. Please restore shared database to restore its collections that share the throughput."
        }
      }
    }
  ]
}

Definitions

Name Description
CloudError

An error response from the service.

ErrorResponse

Error Response.

OperationType

Enum to indicate the operation type of the event.

Resource

The resource of an Azure Cosmos DB MongoDB collection event

RestorableMongodbCollectionGetResult

An Azure Cosmos DB MongoDB collection event

RestorableMongodbCollectionsListResult

The List operation response, that contains the MongoDB collection events and their properties.

CloudError

An error response from the service.

Name Type Description
error

ErrorResponse

Error Response.

ErrorResponse

Error Response.

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

OperationType

Enum to indicate the operation type of the event.

Name Type Description
Create

string

Delete

string

Recreate

string

Replace

string

SystemOperation

string

Resource

The resource of an Azure Cosmos DB MongoDB collection event

Name Type Description
_rid

string

A system generated property. A unique identifier.

canUndelete

string

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

canUndeleteReason

string

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

eventTimestamp

string

The time when this collection event happened.

operationType

OperationType

The operation type of this collection event.

ownerId

string

The name of this MongoDB collection.

ownerResourceId

string

The resource ID of this MongoDB collection.

RestorableMongodbCollectionGetResult

An Azure Cosmos DB MongoDB collection 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 MongoDB collection event

type

string

The type of Azure resource.

RestorableMongodbCollectionsListResult

The List operation response, that contains the MongoDB collection events and their properties.

Name Type Description
value

RestorableMongodbCollectionGetResult[]

List of MongoDB collection events and their properties.