Cosmos DB Accounts

The /cosmosDb resource collection represents Cosmos DB accounts that reside in Azure regions selected in backup policy settings and can be protected by Veeam Backup for Microsoft Azure.

Get Collection of Cosmos DB Accounts

The HTTP GET request to the /cosmosDb endpoint retrieves all Cosmos DB accounts that can be protected by Veeam Backup for Microsoft Azure.

SecurityBearer
Request
query Parameters
SubscriptionId
string or null <uuid>

Returns only Cosmos DB accounts managed by a subscription with the specified ID.

x-veeam-parameter-group: CosmosDbOptions
TenantId
string or null <uuid>

Returns only Cosmos DB accounts that belong to a tenant with the specified ID.

x-veeam-parameter-group: CosmosDbOptions
ServiceAccountId
string

Returns only Cosmos DB accounts to which a service account with the specified ID has access.

x-veeam-parameter-group: CosmosDbOptions
SearchPattern
string or null

Returns only those items of a resource collection whose names match the specified search pattern in the parameter value.

x-veeam-parameter-group: CosmosDbOptions
RegionIds
Array of strings or null

Returns only Cosmos DB accounts that reside in Azure regions with the specified IDs.

x-veeam-parameter-group: CosmosDbOptions
AccountTypes
Array of strings or null (CosmosDbAccountTypeFromClient)

Returns only Cosmos DB accounts of selected kinds.

Enum: "NoSql" "MongoRU" "Table" "Gremlin" "PostgresSql"
x-veeam-parameter-group: CosmosDbOptions
SoftDeleted
boolean or null

Defines whether to include deleted Cosmos DB accounts into the response.

x-veeam-parameter-group: CosmosDbOptions
CosmosDbAccountsFromProtectedRegions
boolean

Defines whether Veeam Backup for Microsoft Azure must return only Cosmos DB accounts that reside in regions protected by backup policies.

x-veeam-parameter-group: CosmosDbOptions
ProtectionStatus
Array of strings or null (ProtectionStatus)

Returns only Cosmos DB accounts with the specified protection statuses.

Enum: "Unprotected" "Protected" "Unknown"
x-veeam-parameter-group: CosmosDbOptions
Offset
integer <int32> >= 0

Specifies the first N items of a resource collection that will be excluded from the response.

x-veeam-parameter-group: Veeam.Azure.REST.RequestQuery.V2.PageProperties
Limit
integer <int32> >= -1

Specifies the maximum number of items of a resource collection that will be returned in the response.

x-veeam-parameter-group: Veeam.Azure.REST.RequestQuery.V2.PageProperties
BackupDestination
Array of strings or null (CosmosBackupDestinationFilterOptions)

Returns only Cosmos DB accounts with the specified backup types.

Enum: "ContinuousBackup" "AzureBlob" "ManualBackup" "Archive"
x-veeam-parameter-group: CosmosDbOptions
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

get/api/v8/cosmosDb
Request samples
curl -i -X GET \
  'https://123.123.123.123/api/v8/cosmosDb?SubscriptionId=497f6eca-6276-4993-bfeb-53cbbbba6f08&TenantId=497f6eca-6276-4993-bfeb-53cbbbba6f08&ServiceAccountId=string&SearchPattern=string&RegionIds=string&AccountTypes=NoSql&SoftDeleted=true&CosmosDbAccountsFromProtectedRegions=true&ProtectionStatus=Unprotected&Offset=0&Limit=-1&BackupDestination=ContinuousBackup' \
  -H 'Authorization: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "offset": 0,
  • "limit": 0,
  • "totalCount": 0,
  • "_links": {},
  • "results": [
    ]
}

Get Cosmos DB Account Data

The HTTP GET request to the /cosmosDb/{cosmosDbAccountId} endpoint retrieves information on a Cosmos DB account with the specified ID.

SecurityBearer
Request
path Parameters
cosmosDbAccountId
required
string or null

Specifies the Cosmos DB account ID in Microsoft Azure.

query Parameters
sync
boolean or null

Defines whether to force rescanning of the Microsoft Azure infrastructure before the response.

Responses
200

OK

202

Accepted

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

get/api/v8/cosmosDb/{cosmosDbAccountId}
Request samples
curl -i -X GET \
  'https://123.123.123.123/api/v8/cosmosDb/{cosmosDbAccountId}?sync=true' \
  -H 'Authorization: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "id": "string",
  • "azureId": "string",
  • "name": "string",
  • "status": "Online",
  • "accountType": "NoSql",
  • "latestRestorableTimestamp": "2019-08-24T14:15:22Z",
  • "sourceSizeBytes": 0,
  • "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",
  • "regionId": "string",
  • "regionName": "string",
  • "resourceGroupName": "string",
  • "postgresVersion": "string",
  • "mongoDbServerVersion": "string",
  • "isDeleted": true,
  • "capacityMode": "None",
  • "_links": {}
}

Rescan Cosmos DB Accounts

The HTTP POST request to the /cosmosDb/rescan endpoint launches a rescan operation for Cosmos DB accounts in Microsoft Azure environment.

SecurityBearer
Request
query Parameters
Offset
integer <int32> >= 0

Specifies the first N items of a resource collection that will be excluded from the response.

x-veeam-parameter-group: Veeam.Azure.REST.RequestQuery.V2.PageProperties
Limit
integer <int32> >= -1

Specifies the maximum number of items of a resource collection that will be returned in the response.

x-veeam-parameter-group: Veeam.Azure.REST.RequestQuery.V2.PageProperties
Request Body schema: application/json
subscriptionId
string or null <uuid>

Returns only Cosmos DB accounts managed by a subscription with the specified ID.

tenantId
string or null <uuid>

Returns only Cosmos DB accounts that belong to a tenant with the specified ID.

serviceAccountId
string

Returns only Cosmos DB accounts to which a service account with the specified ID has access.

searchPattern
string or null

Returns only those items of a resource collection whose names match the specified search pattern in the parameter value.

regionIds
Array of strings or null

Returns only Cosmos DB accounts that reside in Azure regions with the specified IDs.

accountTypes
Array of strings or null (CosmosDbAccountTypeFromClient)

Returns only Cosmos DB accounts of selected types.

Enum: "NoSql" "MongoRU" "Table" "Gremlin" "PostgresSql"
softDeleted
boolean or null

Defines whether to include deleted Cosmos DB accounts into the response.

cosmosDbAccountsFromProtectedRegions
boolean

Defines whether Veeam Backup for Microsoft Azure must return only Cosmos DB accounts that reside in regions protected by backup policies.

protectionStatus
Array of strings or null (ProtectionStatus)

Returns only Cosmos DB accounts with the specified protection statuses.

Enum: "Unprotected" "Protected" "Unknown"
backupDestination
Array of strings or null (CosmosBackupDestinationFilterOptions)

Returns only Cosmos DB accounts with the specified backup types.

Enum: "ContinuousBackup" "AzureBlob" "ManualBackup" "Archive"
Responses
202

Accepted

400

Bad Request

401

Unauthorized

403

Forbidden

post/api/v8/cosmosDb/rescan
Request samples
application/json
{
  • "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "serviceAccountId": "string",
  • "searchPattern": "string",
  • "regionIds": [
    ],
  • "accountTypes": [
    ],
  • "softDeleted": true,
  • "cosmosDbAccountsFromProtectedRegions": true,
  • "protectionStatus": [
    ],
  • "backupDestination": [
    ]
}
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "startTime": "2019-08-24T14:15:22Z",
  • "status": "Canceled",
  • "error": {
    },
  • "_links": {},
  • "result": {
    }
}

Export Collection of Cosmos DB Accounts

The HTTP POST request to the /cosmosDb/export endpoint exports a list of Cosmos DB accounts to a .CSV or an .XML file.

x-veeam-custom-response: true
SecurityBearer
Request
header Parameters
Accept
string or null

Specifies a media type of representation of the exported data. The default value is text/csv media type.

Request Body schema: application/json
subscriptionId
string or null <uuid>

Returns only Cosmos DB accounts managed by a subscription with the specified ID.

tenantId
string or null <uuid>

Returns only Cosmos DB accounts that belong to a tenant with the specified ID.

serviceAccountId
string or null

Returns only Cosmos DB accounts to which a service account with the specified ID has access.

searchPattern
string or null

Returns only those items of a resource collection whose names match the specified search pattern in the parameter value.

regionIds
Array of strings or null

Returns only Cosmos DB accounts that reside in Azure regions with the specified IDs.

cosmosDbAccountIds
Array of strings or null

Specifies Microsoft Azure IDs assigned to Cosmos DB accounts whose data will be exported.

accountTypes
Array of strings or null (CosmosDbAccountTypeFromClient)

Returns only Cosmos DB accounts of selected types.

Enum: "NoSql" "MongoRU" "Table" "Gremlin" "PostgresSql"
softDeleted
boolean or null

Defines whether to include deleted Cosmos DB accounts into the response.

cosmosDbAccountsFromProtectedRegions
boolean

Defines whether Veeam Backup for Microsoft Azure must return only Cosmos DB accounts that reside in regions protected by backup policies.

protectionStatus
Array of strings or null (ProtectionStatus)

Returns only Cosmos DB accounts with the specified protection statuses.

Enum: "Unprotected" "Protected" "Unknown"
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

409

Conflict

post/api/v8/cosmosDb/export
Request samples
application/json
{
  • "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "serviceAccountId": "string",
  • "searchPattern": "string",
  • "regionIds": [
    ],
  • "cosmosDbAccountIds": [
    ],
  • "accountTypes": [
    ],
  • "softDeleted": true,
  • "cosmosDbAccountsFromProtectedRegions": true,
  • "protectionStatus": [
    ]
}
Response samples
application/problem+json
{
  • "extensions": { },
  • "status": 0,
  • "title": "string",
  • "detail": "string",
  • "type": "string"
}

Create Cosmos DB Backups

The HTTP POST request to the /cosmosDb/startManualBackup endpoint launches a backup operation for the specified Cosmos DB accounts.

NOTE
This operation can be performed to Cosmos DB for PostgreSQL accounts only.

SecurityBearer
Request
Request Body schema: application/json
required
cosmosDbAccountIds
required
Array of strings non-empty

Specifies Microsoft Azure IDs assigned to Cosmos DB accounts that will be backed up.

repositoryId
required
string non-empty

Specifies the system ID assigned to the target repository in the Veeam Backup for Microsoft Azure REST API.

tenantId
required
string or null <uuid>

Specifies a Microsoft Azure ID assigned to a tenant to which the protected Cosmos DB accounts belong.

serviceAccountId
required
string <uuid>

Specifies the system ID assigned in the Veeam Backup for Microsoft Azure REST API to the service account whose permissions will be used to protect Cosmos DB accounts.

object or null (CosmosDbProcessingCredentials)

Specifies a list of credentials that will be used to connect to the databases of the specified Cosmos DB accounts.

Responses
202

Accepted

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

415

Client Error

post/api/v8/cosmosDb/startManualBackup
Request samples
application/json
{
  • "cosmosDbAccountIds": [
    ],
  • "repositoryId": "string",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "serviceAccountId": "a814cf67-aaac-43ae-acb4-8d34e82a4b4c",
  • "credentialsList": {
    }
}
Response samples
application/json
[
  • {
    }
]