Create ZCE-X Alert Platform

POST/zstack/v1/zce-x-plugin/{uuid}/alert-platform

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {},
  "systemTags": [],
  "userTags": []
}

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' \
http://localhost:8080/zstack/v1/zce-x-plugin/77e1393bf5aa4536a018b4c0c4e29c72/alert-platform

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlZCE-X information UUID, uniquely identifies the resource 4.10.6
resourceUuid (Optional)Stringbody (included in params structure)Resource UUID 4.10.6
tagUuids (Optional)Listbody (included in params structure)Tag UUID list 4.10.6
systemTags (Optional)ListbodySystem Tag 4.10.6
userTags (Optional)ListbodyUser Tag 4.10.6

API Response

Response Example

{
  "thirdPartyPlatform": {
    "uuid": "eec32b6fe11a464790641439f1d7c754",
    "name": "xsky-172.20.11.24",
    "type": "XSKY",
    "url": "http://172.20.11.24:8086/alerts/?token=001adb2ef25e41b7bd01b28651fcfa6a",
    "template": "{\n    \"product\":\"XSKY\",\n    \"service\":\"XSKY\",\n    \"message\":\"${resource_type + '[' + resource_name+'] ' + group + ' ' + alert_value}\",\n    \"metric\":\"${resource_type + '::' + group}\",\n    \"alertLevel\":\"${level == 'info' ? 'Normal' : level == 'warning' ? 'Important' : 'Emergent'}\",\n    \"alertTime\":\"${create}\",\n    \"dimensions\":\"{'resource_name':'${resource_name}'}\",\n    \"dataSource\":\"xsky-172.20.196.185\"\n}",
    "description": "desc",
    "lastSyncDate": "Feb 18, 2025 7:52:39 AM",
    "lastOpDate": "Feb 18, 2025 7:52:39 AM",
    "createDate": "Feb 18, 2025 7:52:39 AM"
  },
  "inventory": {
    "zceXUuid": "77e1393bf5aa4536a018b4c0c4e29c72",
    "thirdPartyPlatformUuid": "eec32b6fe11a464790641439f1d7c754",
    "createDate": "Nov 14, 2017 2:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
successbooleanWhether the addition was successful4.10.6
thirdPartyPlatformThirdpartyPlatformInventoryFor details, see thirdPartyPlatform4.10.6
inventoryZceXThirdPartyPlatformAlertRefInventoryFor details, see inventory4.10.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. For details, see error4.10.6

thirdPartyPlatform

NameTypeDescriptionStarting Version
uuidStringPlatform UUID3.10
nameStringPlatform name3.10
typeStringPlatform type3.10
urlStringPlatform address3.10
templateStringMessage transformation template3.10
stateStringPlatform state3.10
descriptionStringPlatform detailed description3.10
lastSyncDateTimestampLast sync time3.10
lastOpDateTimestampLast modification time3.10
createDateTimestampCreation time3.10

inventory

NameTypeDescriptionStarting Version
zceXUuidStringZCE-X resource UUID4.10.6
thirdPartyPlatformUuidStringAssociated third-party alert platform UUID4.10.6
createDateTimestampCreation time4.10.6

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10014.10.0
descriptionStringBrief summary of the error4.10.0
detailsStringDetailed error information4.10.0
elaborationStringReserved field, defaults to null4.10.0
opaqueLinkedHashMapReserved field, defaults to null4.10.0
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null4.10.0

SDK Examples

Java SDK

CreateZceXAlertPlatformAction action = new CreateZceXAlertPlatformAction();
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateZceXAlertPlatformAction.Result res = action.call();

Python SDK

CreateZceXAlertPlatformAction action = CreateZceXAlertPlatformAction()
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateZceXAlertPlatformAction.Result res = action.call()