UpdateSNSHttpEndpoint
API Request
URLs
PUT zstack/v1/sns/application-endpoints/http/{uuid}/actionsHeaders
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.
{
"updateSNSHttpEndpoint": {
"url": "https://open.http.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81",
"username": "admin",
"password": "password",
"name": "new name",
"description": "desc"
},
"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 PUT -d '{"updateSNSHttpEndpoint":{"url":"https://open.http.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81","username":"admin","password":"password","name":"new name","description":"desc"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/http/c051c930bd95394c9cd6b3775f8cb475/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the updateSNSHttpEndpoint structure) | Optional. The webhook url. | 5.0.0 | |
| username | Boolean | body (contained in the updateSNSHttpEndpoint structure) | Optional. The username. | 5.0.0 | |
| password | String | body (contained in the updateSNSHttpEndpoint structure) | Optional. The password. | 5.0.0 | |
| uuid | String | url | The resource uuid. | 5.0.0 | |
| name | String | body (contained in the updateSNSHttpEndpoint structure) | Optional. The resource name. | 5.0.0 | |
| description | String | body (contained in the updateSNSHttpEndpoint structure) | Optional. The detailed descrption of resource. | 5.0.0 | |
| systemTags | List | body | Optional. The system tag. | 5.0.0 | |
| userTags | List | body | Optional. The user tag. | 5.0.0 |
API Response
Sample
Response
{
"inventory": {
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Dec 25, 2023 2:08:22 PM",
"lastOpDate": "Dec 25, 2023 2:08:22 PM"
}
}#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 5.0.0 |
| description | String | The brief description of the error. | 5.0.0 |
| details | String | The details about the error. | 5.0.0 |
| elaboration | String | The reserved field. Default value: null. | 5.0.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 5.0.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 5.0.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 5.0.0 |
| uuid | String | The resource UUID. | 5.0.0 |
| description | String | The detailed description of the resource. | 5.0.0 |
| type | String | The type. | 5.0.0 |
| platformUuid | String | The application platform UUID. | 5.0.0 |
| createDate | Timestamp | The creation date. | 5.0.0 |
| lastOpDate | Timestamp | The last operation date. | 5.0.0 |
SDK Sample
Java
SDK
UpdateSNSHttpEndpointAction action = new UpdateSNSHttpEndpointAction();
action.url = "https://open.http.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81";
action.username = "admin";
action.password = "password";
action.uuid = "c051c930bd95394c9cd6b3775f8cb475";
action.name = "new name";
action.description = "desc";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSNSHttpEndpointAction.Result res = action.call();Python
SDK
UpdateSNSHttpEndpointAction action = UpdateSNSHttpEndpointAction()
action.url = "https://open.http.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81"
action.username = "admin"
action.password = "password"
action.uuid = "c051c930bd95394c9cd6b3775f8cb475"
action.name = "new name"
action.description = "desc"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSNSHttpEndpointAction.Result res = action.call()