All Products
Search
Document Center

ApsaraDB for MongoDB:CheckRecoveryCondition

Last Updated:Oct 12, 2026

Checks whether a MongoDB instance meets the conditions for data restoration.

Operation description

This operation is applicable to replica set instances or sharded cluster instances.

Note

After you call this operation to confirm that the conditions for data restoration are met, you can call the CreateDBInstance operation to restore data to a new instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dds:CheckRecoveryCondition

get

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

SourceDBInstance

string

Yes

The instance ID of the source instance to recover.

dds-bp1378****

DatabaseNames

string

No

The names of the databases to be restored. The value is a JSON array.

Note

If you do not specify this parameter, all databases are restored by default.

["db1","db2"]

RestoreTime

string

No

The point in time to which you want to restore the instance. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note
  • The value can be any point in time within the last seven days. The value must be earlier than the current time and later than the creation time of the instance.

  • You must specify either this parameter or the BackupId parameter.

2022-08-22T08:00:00Z

BackupId

string

No

The ID of the backup set.

Note
  • You can call the DescribeBackups operation to query the backup ID.

  • You must specify either this parameter or the RestoreTime parameter.

  • This parameter is not supported for sharded cluster instances.

5664****

ResourceGroupId

string

No

The ID of the resource group.

sg-bp179****

SourceDBInstance

string

Yes

The area where the source instance resides.

Note
  • This parameter is required when the backup recover type is rebuilding a deleted instance.

  • This parameter is required when the backup recover type is geo-redundancy cloning.

cn-beijing

SrcRegion

string

No

The area where the backup set resides during geo-redundancy recover.

Note

This parameter is required when the backup recover type is geo-redundancy cloning.

cn-hangzhou

DestRegion

string

No

The backup recover type. Valid values:

Note
  • 0: local backup recover

  • 1: local point-in-time recover

  • 2: backup recover of a deleted instance using a backup set

  • 3: geo-redundancy backup recover using a backup set

0

RestoreType

string

No

The instance type. Valid values:

  • replicate

  • sharding

Note
  • This parameter is required when the backup recover type is rebuilding a deleted instance.

  • This parameter is required when the backup recover type is geo-redundancy cloning.

replicate

InstanceType

string

No

The database version. Valid values:

  • 8.0

  • 7.0

  • 6.0

  • 5.0

  • 4.4

  • 4.2

  • 4.0

4.2

EngineVersion

string

No

The database engine version of the instance.

  • 6.0

  • 5.0

  • 4.4

  • 4.2

  • 4.0

  • 3.4

4.2

Response elements

Element

Type

Description

Example

object

The response information.

RequestId

string

The request ID.

D563A3E7-6010-45FE-A0CD-9283414C9657

DBInstanceName

string

The instance ID.

dds-bp1378****

IsValid

boolean

Indicates whether the restoration conditions are met. Valid values:

  • true: The conditions are met.

  • false: The conditions are not met.

true

Examples

Success response

JSON format

{
  "RequestId": "D563A3E7-6010-45FE-A0CD-9283414C9657",
  "DBInstanceName": "dds-bp1378****",
  "IsValid": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidMeta.WrongFormat Meta information is wrong formatter.
400 InvalidRestoreTime.Format Specified restore time is not valid. The specified RestoreTime value is invalid.
403 InvalidDBName The specified database name is not allowed. The specified database name is invalid.
403 InvalidMeta.TooLarge Meta information is too large. The metadata is too large.
403 SingleDBRestore.BackupSetNotSupport This backup set do not support this operation. Single-database recovery is not supported for the specified time point or backup file.
403 IncorrectDBInstanceType Current DB instance type does not support this operation. This operation is not supported for the specified instance type.
403 IncorrectEngineVersion Current engine version does not support operations.
403 InvalidBackupLogStatus Current backup log enable status does not support this operation. The operation is not supported when log backup is enabled.
403 IncorrectBackupSetState Current backup set state does not support operations..
404 InvalidBackupSetID.NotFound Specifiedbackup set ID does not exist.
404 InvalidBackup.NotFound Theavailable backup does not exist in recovery time. No backup set is available during the specified recovery period.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.