Create an 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 example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.

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 5.0.0
username (optional)Stringbody (contained in the params structure)Username 5.0.0
password (optional)Stringbody (contained in the params structure)Password 5.0.0
nameStringbody (contained in the params structure)Resource name 5.0.0
description (optional)Stringbody (contained in the params structure)Detailed description of the resource 5.0.0
resourceUuid (optional)Stringbody (contained in the params structure)  5.0.0
systemTags (optional)ListbodySystem tags 5.0.0
userTags (optional)ListbodyUser tags 5.0.0
platformUuid (optional)Stringbody (contained in the params structure)  5.0.0
tagUuids (optional)Listbody (contained in the params structure)Tag UUID list 5.0.0

API Response

Response 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()