API Inspector is an experimental feature that allows you to view the API call that corresponds to each operation in the console. API Inspector can automatically generate API code snippets for each programming language. You can debug the API code snippets by using Cloud Shell and OpenAPI Explorer.
- Automatic recording: You can obtain relevant API calls by performing corresponding operations in the console. For more information, see Automatic recording.
- Code generation: The system automatically generates API code snippets with preset parameters for different programming languages. You can directly run the API code snippets. For more information, see Code generation.
- Online debugging: You can use OpenAPI Explorer and Cloud Shell to debug the code snippets without the need to build a developing environment. For more information, see Online debugging with OpenAPI Explorer and Online debugging with Cloud Shell.
Enable API Inspector
Perform the following operations to enable API Inspector:
- Log on to the Classic Load Balancer (CLB) console.
- Click in the lower-right corner.
The following example describes how to use the automatic recording feature in a scenario where you want to modify the name of a CLB instance in the console.
- Click the ID of the CLB instance that you want to manage and click the Instance Details tab.
- In the Basic Information section, click Edit to modify the name of the CLB instance.
- Click OK.
- Click on the right of the page to view the API call that corresponds to the operation.
You can select Hide Describe Class to view core API operations.
After the API call that corresponds to the operation is recorded, click the name of the API. Then, the system generates the API code snippets with preset parameters in the following formats: Python, Java, Go, Node.js, PHP, and CLI.
Online debugging with OpenAPI Explorer
After the API call that corresponds to the operation is recorded, click OpenAPI Explorer to go to the OpenAPI Explorer page and debug the code snippet.
Online debugging with Cloud Shell
After the API call that corresponds to the operation is recorded, expand the details about the API call and click to debug the code snippet with Cloud Shell.
aliyun slb actionName --parameter1value1 --paramter2value2...
aliyun slb SetLoadBalancerName --RegionId cn-hangzhou --LoadBalancerName SLB1 --LoadBalancerId lb-bp1b6c719dfa08exfuca5
The following value is returned: