How can I create a threshold profile and associate a schedule using a REST client
Dx NetOps Performance Management any version
The following is an example done against a DA with https configures
Do a POST to https://<DA>:8582/rest/eventprofilegroups
<EventProfileGroup version="0.0.0">
<Item version="1.0.0">
<Name>Joe</Name>
<Description>Joe</Description>
</Item>
</EventProfileGroup>
Do a POST to https://<DA>:8582/rest/eventrules
<EventRule version="1.0.0">
<Enabled>1</Enabled>
<MetricFamily>{http://im.ca.com/normalizer}NormalizedSDNControlTunnelInfo</MetricFamily>
<Window>720</Window>
<Duration>300</Duration>
<AggregateToDevice>0</AggregateToDevice>
<ClearConditionList>
<ClearCondition>
<ClearOperator>LESS_THAN</ClearOperator>
<ClearValue>25</ClearValue>
</ClearCondition>
</ClearConditionList>
<ViolationConditionList>
<ViolationCondition>
<ViolationConditionType>CONSTANT</ViolationConditionType>
<ViolationPerformanceMetric>PctTimeinDownState</ViolationPerformanceMetric>
<ViolationOperator>GREATER_THAN</ViolationOperator>
<ViolationValue>75</ViolationValue>
</ViolationCondition>
</ViolationConditionList>
<Severity>CRITICAL</Severity>
<Item version="1.0.0">
<Name>SDN_Control_Tunnel_Time_down_state</Name>
<Description>THIS IS A TEST-</Description>
</Item>
</EventRule>
Do a POST to https://<DA>:8582/rest/eventprofiles
<EventProfile version="1.0.0">
<Enabled>1</Enabled>
<EventRuleIDList>
<EventRuleID>335019</EventRuleID>
</EventRuleIDList>
<OwnerID>1</OwnerID>
<LastModifiedUserID>1</LastModifiedUserID>
<LastModifiedTime>1744193098</LastModifiedTime>
<Item version="1.0.0">
<Name>SDN_Control_Tunnel_Time-in-up/down_state_Critical</Name>
<Description>THIS IS A TEST-Monitoring SDN Control Tunnel's up/down status</Description>
</Item>
</EventProfile>
You can relate the profile to a profile group via:
PUT: https://<DA>:8582/rest/eventprofiles/335021/relatesto/eventprofilegroups/335018
.... passing the profile itemid first and the profile group itemid on end
Then I created a schedule:
POST: https://<DA>:8582/rest/eventprofileschedules
<EventProfileSchedule version="1.0.0">
<InSpecifiedTimes>1</InSpecifiedTimes>
<TimeZone>UTC</TimeZone>
<EndTime>1440</EndTime>
<StartTime>0</StartTime>
<DaysOfWeekList>
<DaysOfWeek>MON</DaysOfWeek>
<DaysOfWeek>TUE</DaysOfWeek>
<DaysOfWeek>WED</DaysOfWeek>
<DaysOfWeek>THU</DaysOfWeek>
<DaysOfWeek>FRI</DaysOfWeek>
</DaysOfWeekList>
<Enabled>1</Enabled>
<Item version="1.0.0">
<Name>SDN_Control_Tunnel_Time-in-up/down_state_Critical</Name>
<Description>THIS IS A TEST-Monitoring SDN Control Tunnel's up/down status</Description>
</Item>
</EventProfileSchedule>
Finally associate the schedule to the event profile:
https://<DA>:8582/rest/eventprofiles/335021
<EventProfile version="2.0.0">
<EventProfileScheduleID>335026</EventProfileScheduleID>
</EventProfile>