All Products
Search
Document Center

ApsaraDB for MongoDB:[Notice] Changes of the DescribeBackups and DescribeBackupTasks operations

Last Updated:Nov 01, 2024

To improve user experience, ApsaraDB for MongoDB SDKs are upgraded on April 16, 2024. The new versions involves the compatibility improvements of the DescribeBackups and DescribeBackupTasks operations. To prevent impacts on your business, we recommend that you upgrade the SDK versions at your earliest opportunity.

Effective data

April 16, 2024

Content

The new versions of ApsaraDB for MongoDB SDKs change the data types of the BackupJobId and BackupId parameters in the DescribeBackups and DescribeBackupTasks operations and increases the number of digits allowed in the parameter values. For example, in the new versions of SDK for Java, the data types of the parameters are changed from numeric types to STRING.

You can download the SDKs from the following URLs:

Impacts

The DescribeBackups and DescribeBackupTasks operations that are called through the SDKs released before April 16, 2024 may fail if the BackupJobId or BackupId parameter is specified.

You can upgrade the SDKs to versions that are released on April 16, 2024 and later and change your business code that calls the two operations based on the examples provided in Modification examples.

Modification examples

  • Java: The data types of the BackupJobId and BackupId parameters are changed from Integer or Long to String.

    ...
    DescribeBackupsResponse describeBackupsResponse = client.describeBackupsWithOptions(describeBackupsRequest,new com.aliyun.teautil.models.RuntimeOptions());
    List<DescribeBackupsResponseBody.DescribeBackupsResponseBodyBackupsBackup> backup = describeBackupsResponse.getBody().getBackups().getBackup(); 
    for (DescribeBackupsResponseBody.DescribeBackupsResponseBodyBackupsBackup describeBackupsResponseBodyBackupsBackup : backup) {
     // After you upgrade the SDKs to the latest version, if you set the two parameters to Integer or Long values, errors are reported when you compile or package your program.
       // You can modify your business code based on the data types of the values of response parameters.
       // Integer backupId =describeBackupsResponseBodyBackupsBackup.getBackupId();
       // Long backupId =describeBackupsResponseBodyBackupsBackup.getBackupId();
          String backupId = describeBackupsResponseBodyBackupsBackup.getBackupId();
    }
  • Other programming languages: You can modify your business code based on the sample code for Java and the data types of the request and response parameters defined in the SDKs.

References