You can call the DescribeMetaList operation to query the information about the restorable databases and tables in a specific data backup file.

Before you call the RestoreTable operation to restore a single database or table of an ApsaraDB RDS for MySQL instance, you can call this operation to query the information about the restorable databases and tables. For more information, see Restore individual databases or tables.

Note This operation is supported only when the instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6 on RDS High-availability Edition with local solid-state drives (SSDs).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeMetaList

The operation that you want to perform. Set the value to DescribeMetaList.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance. You can call the DescribeDBInstances operation to query the IDs of instances.

ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

RestoreType String No BackupSetID

The method that is used to restore data. Valid values:

  • BackupSetID: Data is restored from a data backup file. If you use this value, you must also specify the BackupSetID parameter.
  • RestoreTime: Data is restored to a specific point in time. If you use this value, you must also specify the RestoreTime parameter.

Default value: BackupSetID.

BackupSetID Integer No 14358

The ID of the data backup file from which you want to restore data. You can call the DescribeBackups operation to query the IDs of data backup files.

Note If you set the RestoreType parameter to BackupSetID, you must also specify this parameter.
RestoreTime String No 2019-05-30T03:29:10Z

The point in time to which you want to restore data. The specified point in time must be earlier than the current time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can call the DescribeBackups operation to query the restorable time range.

Note If you set the RestoreType parameter to RestoreTime, you must also specify this parameter.
GetDbName String No testdb1

The name of the database to query. ApsaraDB RDS implements exact match based on the value of this parameter and returns the name of the matched database and those of the tables in the matched database.

Note If you leave this parameter unspecified, ApsaraDB RDS returns all databases that are created on the instance.
Pattern String No test

The keyword in the name of the database to query. ApsaraDB RDS implements fuzzy match based on the value of this parameter and returns only the names of the matched databases.

Note For example, if you set the value to test, ApsaraDB RDS returns testdb1 and testdb2. Then, you can specify the GetDbName parameter to query tables in the required database.
PageSize Integer No 1

The number of entries to return on each page. Default value: 1.

Note This parameter only takes effect when you specify the PageIndex parameter.
PageIndex Integer No 1

The number of the page to return. Valid values: any non-zero positive integer. Default value: 1.

Note This parameter only takes effect when you specify the PageSize parameter.

Response parameters

Parameter Type Example Description
DBInstanceName String rm-uf6wjk5xxxxxxx

The name of the instance.

Items Array of Meta

An array that consists of the information about the databases and tables whose data is included in the data backup file.

Meta
Database String testdb1

The name of the database.

Size String 64

The size of the table. Unit: KB.

Tables String test1

The name of the table.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 1

The number of entries returned on the current page.

RequestId String 60F9A12A-16B8-4728-B099-4CA38D32C31C

The ID of the request.

TotalPageCount Integer 1

The total number of pages.

TotalRecordCount Integer 1

The total number of entries.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=DescribeMetaList
&DBInstanceId=rm-uf6wjk5xxxxxxx
&<Common request parameters>

Sample success responses

XML format

<DescribeMetaList>
      <TotalPageCount>1</TotalPageCount>
      <TotalRecordCount>1</TotalRecordCount>
      <PageRecordCount>1</PageRecordCount>
      <RequestId>60F9A12A-16B8-4728-B099-4CA38D32C31C</RequestId>
      <PageNumber>1</PageNumber>
      <Items>
            <Meta>
                  <Size>64</Size>
                  <Database>testdb1</Database>
                  <Tables>test1</Tables>
            </Meta>
      </Items>
      <DBInstanceName>rm-uf6wjk5xxxxxxx</DBInstanceName>
</DescribeMetaList>

JSON format

{
    "TotalPageCount": "1",
    "TotalRecordCount": "1",
    "PageRecordCount": "1",
    "RequestId": "60F9A12A-16B8-4728-B099-4CA38D32C31C",
    "PageNumber": "1",
    "Items": {
        "Meta": [{
            "Size": "64",
            "Database": "testdb1",
            "Tables": "test1"
        }]
    },
    "DBInstanceName": "rm-uf6wjk5xxxxxxx"
}

Error codes

HTTP status code Error code Error message Description
404 InvalidBackupSetID.NotFound Specified backup set ID does not exist. The error message returned because the specified ID of the data backup file cannot be found.
403 InvalidBackupLogStatus Current backup log enable status does not support this operation. The error message returned because the log backup feature is not enabled and consequently data cannot be restored to a specific point in time.
400 InvalidRestoreTime.Format Specified restore time is not valid. The error message returned because the specified point in time for restoration is invalid.

For a list of error codes, visit the API Error Center.