ZStack Cloud 5.1.8 provides native RESTful supports. You can design principles and conventions by using the REST-defined framework, and use the HTTP-based programming language for further development.
HTTP Verb | Description |
---|---|
GET | Obtains resource information.
|
POST | Creates a resource. |
PUT | Updates a resource.
|
DELETE | Deletes a resource. |
URL, Query String, and HTTP Body can all be used to pass parameters. Each method can be used independently, or be used in conjunction with other methods. Note that the specific method is determined by the API you use.
When you operate on a specific resource, the resource UUID will be encoded and then passed to a URL.
zstack/v1/vm-instances/f97143d60f1042c9badd9a1336d3c105/actions
In the preceding sample, the UUID is encoded and passed to a URL.
All APIs that use the HTTP GET verb pass parameters by using query strings.
zstack/v1/vm-instances?q=state=Running
When you create a resource by using the POST verb, or modify a resource by using the PUT verb, the rest of the parameters will be passed by using the HTTP body method apart for those passed by using a URL.
PUT zstack/v1/vm-instances/f97143d60f1042c9badd9a1336d3c105/actions { "startVmInstance": { "hostUuid": "8aef7e3a53b34eedaa05027a919156d9" } }
In the preceding sample, the UUID of the VM instance is passed by using a URL, while the hostUuid parameter is passed by using the HTTP body.
ZStack Cloud API uses the following custom HTTP headers.
Authorization: OAuth Session UUID
Authorization: OAuth 34cbfddd470a47d8bdb0727cd2182618
X-Job-UUID: d825b1a26f4e474b8c59306081920ff2
If an HTTP header is not specified, ZStack Cloud will automatically generate a UUID for API Job.
X-Job-UUID must be a version 4 UUID (a random UUID) without hyphens (-). ZStack Cloud will authenticate the validity of the X-Job-UUID format, and returns the 400 Bad Request error for invalid strings.
X-Web-Hook: http://localhost:5000/api-callback
X-Web-Hook
callback method, ZStack Cloud will include the X-Job-Success
HTTP header to the HTTP Post request send to the callback URL. The X-Job-Success
HTTP header indicates whether the API operation succeeds or not. For example,X-Job-Success: true
If the value is true, the operation succeeds, or vice versa.
Back to Top
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioEmail Us
contact@zstack.ioThe download link is sent to your email address.
If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for using ZStack products and services.