CreateSNSHttpEndpoint
API Request
URLs
POST zstack/v1/sns/application-endpoints/http
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"url": "http://127.0.0.1:6666/test-url",
"username": "username",
"password": "password",
"name": "http"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
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
Request Parameters
Name | Type | Location | Description | Optimal Value | Starting Version |
---|---|---|---|---|---|
url | String | body (contained in the params structure) | The HTTP webhook URL. | 2.3 | |
username | String | body (contained in the params structure) | Optional. The username of the URL. | 2.3 | |
password | String | body (contained in the params structure) | Optional. The password of the URL. | 2.3 | |
name | String | body (contained in the params structure) | The resource name. | 2.3 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 2.3 | |
resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
systemTags | List | body | Optional. The system tags. | 2.3 | |
userTags | List | body | Optional. The user tags. | 2.3 | |
platformUuid | String | body (contained in the params structure) | Optional. | 0.6 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API
failed, the returned JSON structure includes 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 Sample
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()