Generating API Explorer Reusable Scripts to Create Instances

Last updated: 2021-03-16 15:27:44

    Overview

    While purchasing CVMs on the CVM purchase page, you can generate the OpenAPI best practice reusable scripts with the selected configurations. You can then use these codes to purchase CVM instances with the same configurations.

    Prerequisites

    Directions

    1. On the Confirm Configuration page, click Generate API Explorer Reusable Scripts as shown below:
    2. You can view the following information in the pop-up window.
      • API Workflow: provides the description and actual parameters of the RunInstances API based on the selected configurations. The parameters marked with “*” are required for the API. You can hover over the data to display it completely.
      • API Script: generates codes in Java and Python programing languages. Select the Java or Python tab as needed, click Copy Script in the top-right corner, and save the codes to purchase CVM instances that contain the same configurations.

        Note:

        • The instance password will not be displayed on the page or script codes for security reasons. Please modify it by yourself.
        • The collective expiry date cannot be set in the API Explorer reusable script. You need to set it after creating the CVM.