Update History Alert Tags¶
Update the tags of a history alert.
Request Format¶
POST https://{apigw-address}/event-service/v2.1/history-alerts?action=updateTags
Request Parameters (URI)¶
Name | Mandatory/Optional | Data Type | Description |
---|---|---|---|
orgId | Mandatory | String | The organization ID which the asset belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name | Location (Path/Query) | Mandatory/Optional | Data Type | Description |
---|---|---|---|---|
eventId | Query | Mandatory | String | The event ID. |
tags | Query | Mandatory | Map | The user-defined tags to be modified. (The Key and Value are of String type.) For details, see How to use tags. |
isPatchUpdate | Query | Mandatory | Boolean |
|
Response Parameters¶
Name | Data Type | Description |
---|---|---|
data | Integer | The number of updated entries. |
Samples¶
Request Sample¶
url: https://{apigw-address}/event-service/v2.1/history-alerts?action=updateTags&orgId=yourOrgId
method: POST
requestBody:
{
"eventId": "yourEventId",
"isPatchUpdate": true,
"tags": {
"tag000": "000"
},
"action": "update"
}
Return Sample¶
{
"code": 0,
"msg": "success",
"requestId": "4873095e-621d-4cfd-bc2c-edb520f574ea",
"data": 1
}
Java SDK Sample¶
public void testUpdateHistoryAlertTags(){
String accessKey = "yourAppAccessKey";
String secretKey = "yourAppSecretKey";
UpdateHistoryAlertTagsRequest request = new UpdateHistoryAlertTagsRequest();
request.setOrgId("yourOrgId");
request.setEventId("yourEventId");
Map<String,String> map = new HashMap<>();
map.put("tag000","000");
request.setTags(map);
request.setIsPatchUpdate(true);
try {
UpdateHistoryAlertTagsResponse response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
.url("https://{apigw-address}")
.getResponse(request, UpdateHistoryAlertTagsResponse.class);
System.out.println(response);
} catch(Exception e) {
System.out.print(e);
}
}