Create HTTP Endpoint

POST/zstack/v1/sns/application-endpoints/http

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "url": "http://127.0.0.1:6666/test-url",
    "username": "username",
    "password": "password",
    "name": "http"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, the systemTags and userTags fields are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"http://127.0.0.1:6666/test-url","username":"username","password":"password","name":"http"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/http

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
urlStringbody (contained in the params structure)HTTP URL 2.3
username (Optional)Stringbody (contained in the params structure)Username 2.3
password (Optional)Stringbody (contained in the params structure)Password 2.3
nameStringbody (contained in the params structure)Resource name 2.3
description (Optional)Stringbody (contained in the params structure)Detailed description of the resource 2.3
resourceUuid (Optional)Stringbody (contained in the params structure)  2.3
systemTags (Optional)ListbodySystem tags 2.3
userTags (Optional)ListbodyUser tags 2.3
platformUuid (Optional)Stringbody (contained in the params structure)  0.6

API Response

This API returns an empty JSON structure {} on success. On failure, the returned JSON structure contains an error field, for example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

CreateSNSHttpEndpointAction action = new CreateSNSHttpEndpointAction();
action.url = "http://127.0.0.1:6666/test-url";
action.username = "username";
action.password = "password";
action.name = "http";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSHttpEndpointAction.Result res = action.call();

Python SDK

CreateSNSHttpEndpointAction action = CreateSNSHttpEndpointAction()
action.url = "http://127.0.0.1:6666/test-url"
action.username = "username"
action.password = "password"
action.name = "http"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSHttpEndpointAction.Result res = action.call()