Using Postman to Call the API for Creating a Snapshot
Scenarios
Use Postman to call the API for creating a snapshot. For details, see Calling APIs.
Involved APIs
When this API is called, authentication is required. The following APIs are involved:
- Authentication: This API is used to authenticate identity to obtain the permission to operate APIs.
- Creating a Snapshot: This API is used to create a snapshot for a cluster.
Procedure
- Configure the environment.
Download Postman (7.24.0 is recommended) and call the snapshot creation service.
- Call services.
- Obtain the token for authentication.
Create a POST request on Postman, select the Body tab, and enter the username, password, account name, and project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
The region of the Huawei Cloud service used to obtain the token must match the region of the service being called. Otherwise, the call will fail.
- Click Send in the upper right corner to send POST https://{{endpoint}}/v3/auth/tokens. Obtain the token value in the returned result. The token validity period is 24 hours.
- Call the API for creating a snapshot.
- In the Postman interface, create a new POST request. Select the Headers tab, add the corresponding KEY and VALUE, and copy the token value to X-Auth-Token. The region specified in the request URL must be the same as the region of the service being called. You can obtain this information from Regions and Endpoints.
- Click Body and add the request parameter values to the request. Parameters vary by services. For details, see the API Description.
- Click Send in the upper right corner to send POST https://{{endpoint}} and view the creation result.
{ "snapshot": { "id": "809bcf6e-4022-496d-9320-bbc700695692" } }
- Obtain the token for authentication.