edit-icon download-icon

ApsaraDB for RDS

Last Updated: Mar 20, 2018

ApsaraDB for RDS (Relational Database Service) is a stable and reliable online database service that supports the elastic scaling function. ApsaraDB for RDS is based on the Apsara distributed system and high-performance storage of ephemeral SSD and supports MySQL, SQL Server, and PostgreSQL engines. ApsaraDB for RDS offers a complete set of solutions for backup, recovery, monitoring, migration, disaster recovery, and troubleshooting database operation and maintenance. For more information, see ApsaraDB for RDS.

This tutorial uses the CreateDBInstance API of ApsaraDB RDS to show you how to use Alibaba Cloud Python SDK to create an ApsaraDB for RDS instance.

Note: Running the code in this example will create an ApsaraDB RDS instance and generate fees.

  1. from aliyunsdkcore.client import AcsClient
  2. from aliyunsdkrds.request.v20140815 import CreateDBInstanceRequest
  3. # Create the AcsClient instance
  4. client = AcsClient(
  5. "<your-access-key-id>",
  6. "<your-access-key-secret>",
  7. "<your-region-id>"
  8. );
  9. request = CreateDBInstanceRequest.CreateDBInstanceRequest()
  10. request.set_Engine("MySQL")
  11. request.set_EngineVersion("5.7")
  12. request.set_DBInstanceClass("mysql.n1.micro.1")
  13. request.set_DBInstanceStorage("20")
  14. request.set_DBInstanceNetType("Intranet")
  15. request.set_SecurityIPList("0.0.0.0/0")
  16. request.set_PayType("Postpaid")
  17. request.set_DBInstanceDescription("MyRds")
  18. request.set_ClientToken("<uuid>")
  19. response = client.do_action_with_exception(request)
  20. print response
Thank you! We've received your feedback.