CreateSNSHttpEndpoint
API Request
URLs
POST zstack/v1/sns/application-endpoints/httpHeaders
Authorization: OAuth the-session-uuidBody
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": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.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/httpRequest Parameters
| Name | Type | Location | Description | Options Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the params structure) | The webhook URL of the FeiShu robot. | 5.0.0 | |
| username | String | body (contained in the params structure) | Optional. The user name. | 5.0.0 | |
| password | String | body (contained in the params structure) | Optional. The password. | 5.0.0 | |
| name | String | body (contained in the params structure) | The resource name. | 5.0.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 5.0.0 | |
| platformUuid | String | body (contained in the params structure) | The notificatiin platform uuid. | 5.0.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. The resource uuid. | 5.0.0 | |
| systemTags | List | body | Optional. The system tags. | 5.0.0 | |
| userTags | List | body | Optional. The user tags. | 5.0.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag uuid list. | 5.0.0 |
API Response
Sample
Response
{
"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()