{"type":"api","title":"Create Custom Trap Event","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/3ba2ebf1-2c82-351f-9129-0701a2a03db6","info":{"title":"APIs exposed by Alarm Rest service","description":"APIs exposed by Alarm Rest service.","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"},"version":"7.1.0"},"x-parser-conf":{"overview":{"markdownPath":"reference/EMF/fault-emf-api-overview.md"}},"openapi":"3.0.1","servers":[{"url":"https://{server_ip}:30603/crosswork/alarm/v1","description":"Generated server url"}]},"spec":{"tags":["alarm-rest"],"summary":"Create Custom Trap Event","description":"Create custom trap event with specified details. \u003cbr\u003e\n\n **Mandatory Fields:**\n `trapName`,\n `trapOid` \u003cbr\u003e\n In `trapAttributes`, the following fields are mandatory:\n `varbindName`,\n `varbingOid`\n \u003cbr\u003e\nIn `eventDetails`, the following fields are mandatory:\n `eventType`,\n `category`,\n `defaultSeverity`,\n `description`,\n `asid`\n\u003cbr\u003e\n **Optional Fields:**\n `varbindValues`,\n `locationQuery`,\n `autoClear`,\n `probableCause`,\n `recommendationAction`,\n `matchConditions`.\n\u003cbr\u003e \u003cbr\u003e `eventDetails -\u003e category`: Possible values include \"BFD\", \"BGP\", \"Carrier Ethernet\", \"Clients\", \"Controller\", \"Generic\", \"ISIS\", \"MPLS\", \"MPLS-L3VPN\", \"NTP\", \"OSPF\", \"Optical Transport\", \"PTP\", \"Performance\", \"RIP\", \"SONET\", \"SYNCE\", \"Security\", \"Switches and Routers\", \"System\", \"NCS\". \u003cbr\u003e\n `eventDetails -\u003e defaultSeverity`: Possible values include \"Critical\", \"Major\", \"Minor\", \"Warning\", \"Information\", \"Cleared\". \u003cbr\u003e\n `matchConditions -\u003e operator`: Possible values include \u003e, \u003c, or =.\n \u003cbr\u003e \n ","operationId":"addCustomTrap","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"Payload for adding a custom trap event","properties":{"trapName":{"type":"string","description":"Name of the trap event","example":"cieLinkDown"},"trapOid":{"type":"string","description":"OID for the trap event","example":"1.3.6.1.4.1.9.9.276.0.1"},"trapAttributes":{"type":"array","description":"Attributes associated with the trap event","items":{"type":"object","properties":{"varbindName":{"type":"string","description":"Name of the varbind attribute","example":"ifIndex"},"varbindOid":{"type":"string","description":"OID of the varbind attribute","example":"1.3.6.1.2.1.2.2.1.1"},"varbindValues":{"type":"object","description":"Possible values for the varbind attribute","additionalProperties":{"type":"string"},"example":{"1":"unknown","2":"enabled","3":"disabled","4":"installed","5":"uninstalled","6":"enabledNotRunning"}}},"required":["varbindName","varbindOid"]}},"eventDetails":{"type":"array","description":"Details of events associated with the trap","items":{"type":"object","properties":{"eventType":{"type":"string","description":"Type of event associated with the trap","example":"nexusLinkDown"},"category":{"type":"string","description":"Category of the event","example":"Switches and Routers"},"defaultSeverity":{"type":"string","description":"Default severity level of the event","example":"Critical"},"description":{"type":"string","description":"Description of the event","example":"Port $ifName is down on device $mgmtAddress"},"asid":{"type":"string","description":"ASID associated with the event","example":"$mgmtAddress:nexusLinkDown:$ifName"},"locationQuery":{"type":"string","description":"Query to determine event location","example":"select id,name,displayname from protocolendpoint where name= '$ifName' and owningentityid like '%$mgmtAddress'"},"autoClear":{"type":"string","description":"Duration in minutes for auto-clearing the event","example":"120"},"probableCause":{"type":"string","description":"Probable cause of the event","example":"nexusLinkDown cause"},"recommendationAction":{"type":"string","description":"Recommended action for the event","example":"nexusLinkDown action"},"matchConditions":{"type":"array","description":"Conditions to match for the event","items":{"type":"object","properties":{"variableName":{"type":"string","description":"Name of the variable for condition matching","example":"ifAdminStatus"},"expectedValues":{"type":"string","description":"Expected values for the condition","example":"2"},"operator":{"type":"string","description":"Operator for the condition","example":"="}}}}},"required":["eventType","category","defaultSeverity","description","asid"]}}},"required":["trapName","trapOid","trapAttributes","eventDetails"],"$$ref":"#/components/schemas/TrapRequest"}}},"required":true},"responses":{"200":{"description":"Trap added successfully","content":{"application/json":{"schema":{"type":"object","description":"Response object for trap operations","properties":{"status":{"type":"string","description":"Status of the trap operation","example":"Success/Fail"},"message":{"type":"string","description":"Message indicating the result of the trap operation","example":"error-message"}},"$$ref":"#/components/schemas/TrapResponse"}}}},"403":{"description":"Authentication and Authorization errors"},"500":{"description":"operation-failed Response with error"}},"__originalOperationId":"addCustomTrap","method":"post","path":"/custom/trap"}}