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 where the cloud service for obtaining the token is located must be the same as the region where the called service is located. Otherwise, the calling fails.
- Click Send in the upper right corner to send POST https://iam.ap-southeast-1.myhuaweicloud.com/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.
- Create a POST request on Postman, select Headers, add the corresponding KEY and VALUE, and copy the token value to X-Auth-Token. The region in the request URL must be the same as that of the invoked service. You can obtain the region 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://dws.ap-southeast-1.myhuaweicloud.com/v1.0/{project_id}/snapshots and view the creation result.
{ "snapshot": { "id": "809bcf6e-4022-496d-9320-bbc700695692" } }
- Obtain the token for authentication.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot