Reply

Pull an array from an Issue in Triggered Job?

Adviser
Posts: 65
4692     0

I have a raw xml policy that fires an issue with a list of all ports on a switch that don't match the configuration in the policy.  Initially, the list was more informational and a repair job was scheduled to reset the entire range of user ports, based on the switch size - int range gi1/0/3-48 or int range gi1/0/3-24.   We now have trunks scattered through out the switches for APs, so I need to only reset the ports listed in the issue.

Is there a way to take the list from Issue and use as an input into the script?  I can change the error message to make it easier to use, if this is possiblity.  Perl/Python/CCS- script type doesn't matter.

 

Sample Issue output:

 

Message:
The following switchports are incorrectly configured: 3,4,5,6,7,8,9,10,11,12,13,14,15,16,18.

Re: Pull an array from an Issue in Triggered Job?

Adviser
Posts: 65
4693     0

So, from what i can find, this isn't possible.

 

Is it possible to find the Message data via rest?

I have found the policy rule and status, but nothing with the message data in it.

 

Thanks.

Re: Pull an array from an Issue in Triggered Job?

Adviser
Posts: 65
4693     0

Found it if anyone else needs it-

 

/api/3.0/device_policy_rules/search?PolicyRuleStatus=error&DevicePolicyID=#####

 

{
    "total": 1,
    "start": 0,
    "limit": 1000,
    "current": 1,
    "device_policy_rules": [
        {
            "DataSourceID": 4,
            "DevicePolicyID": "8950473071153901931",
            "DevicePolicyRuleChangedCols": "PolicyRuleStatus,PolicyRuleMessage",
            "DevicePolicyRuleEndTime": null,
            "DevicePolicyRuleID": "8421571587965439406",
            "DevicePolicyRuleStartTime": "2016-09-01 10:59:21",
            "DevicePolicyRuleTimestamp": "2017-10-24 15:00:26",
            "PolicyRuleContext": null,
            "PolicyRuleID": "4559690170655260362",
            "PolicyRuleLineNo": null,
            "PolicyRuleMessage": "The following switchports are incorrectly configured: 3,4,5,6,7,8.",
            "PolicyRuleStatus": "error",
            "_class": "DevicePolicyRule"
        }
    ]
}

Re: Pull an array from an Issue in Triggered Job?

Adviser
Posts: 353
4693     0
Excellent, glad you were able to find this. Does this resolve your original question or is there still something open?

Re: Pull an array from an Issue in Triggered Job?

Adviser
Posts: 65
4693     0

It took care of most of the question.  I'm still working on the solution to take the results and act upon them.

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You