Get-AzCosmosDBMongoDBRestorableDatabase
Gets the list of all the restorable Azure Cosmos DB MongoDB databases available under the restorable account.
Syntax
ByNameParameterSet (Default)
Get-AzCosmosDBMongoDBRestorableDatabase
-Location <String>
-DatabaseAccountInstanceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByParentObjectParameterSet
Get-AzCosmosDBMongoDBRestorableDatabase
-InputObject <PSRestorableDatabaseAccountGetResult>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Gets the list of all the restorable Azure Cosmos DB MongoDB database events available under the restorable account. The list would have entries corresponding to create, replace and delete events of all live and deleted databases. This list is useful to identify the restore timestamp based on the changes in the database. For example, if user wants to restore the database account to a timestamp when a database named foo is deleted, the user can find corresponding database delete event from this list, and choose a timestamp before the delete event for restore.
Examples
Example 1
Get-AzCosmosDBMongoDBRestorableDatabase -Location "location" -DatabaseAccountInstanceId "DatabaseAccountInstanceId"
Name : cb04fbfc-4142-413d-b2c5-c91723a17e28
Id : /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{DatabaseAccountInstanceId}/restorableMongoDBDatabases/cb04fbfc-4142-413d-b2c5-c91723
a17e28
Type : Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongoDBDatabases
_rid : a+35ZwAAAA==
OperationType : Create
EventTimestamp : 01/20/2021 18:42:37
OwnerId : foo-db1
OwnerResourceId : Ts0YAA==
The resource object contains the properties of the database resource
Parameters
-DatabaseAccountInstanceId
The instance Id of the CosmosDB database account. (This is returned as a part of database account properties).
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByNameParameterSet
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: | IAzureContextContainer |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InputObject
CosmosDB Restorable Database Account object
Parameter properties
Type: | PSRestorableDatabaseAccountGetResult |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByParentObjectParameterSet
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Location
Name of the Location in string.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByNameParameterSet
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.