Trying to use the API to affect a policy change to a QOS policy. Every time getting the following response:
{
"response": {
"startTime": 1471831412988,
"endTime": 1471831413121,
"progress": "Apply Policy Version Diff Failed",
"version": 1471831413121,
"errorCode": "BadRequest",
"serviceType": "Policy Service",
"operationIdList": [
"90523c17-e13a-429f-97aa-290639e25178"
],
"isError": true,
"failureReason": "Invalid Policy",
"rootId": "eeef89e1-3cf8-4d7b-b13d-b2c51ecc437f",
"id": "eeef89e1-3cf8-4d7b-b13d-b2c51ecc437f"
},
"version": "1.0"
}
have tried it using both (PUT) /api/v1/policy and (POST) /api/v1/policy/diff. Neither seem to work.
my input to policy/diff looks like:
{
"policies": [
{
"policy": {
"policyScope": "ed-qos",
"resource": {
"applicationDiffs": [
{
"operation": "DELETE",
"policyApplication": {
"id": "3db738bd-a01a-4d6a-8bad-c23b39c78c23",
"appName": "facebook"
}
}
]
},
"id": "d36e817e-7dbf-4f0c-8217-a23e86ccfecd",
"state": "Active",
"instanceUuid": "d36e817e-7dbf-4f0c-8217-a23e86ccfecd",
"policyName": "default",
"taskId": "8c2f2989-92a7-4643-8492-d098ad640273",
"actionProperty": {
"relevanceLevel": "Business-Irrelevant",
"pathControlFlag": false,
"pathPreferenceFlag": false,
"priorityLevel": "0",
"experienceLevel": "experiencelevel",
"pathPreference": "pathpreference",
"trustLevel": "trustlevel"
},
"policyPriority": 0,
"actions": [
"SET_PROPERTY"
],
"policyOwner": "admin"
},
"operation": "UPDATE"
}
]
}
using the DevNet sandbox APIC for testing, so feel free to try it out and see if you get the same error.
Ok, if you were using PUT and didn't us [ and ] you will get error
just GET policy Dev_policy-D with it's ID. Use the response I change "relevanceLevel" attribute from "default" to "Business-Relevant" and do the PUT. Check task, no error, GET policy "Dev_policy-D" again, the attributed is changed to "Business-Relevant".
[{
"instanceUuid": "35646f3a-f84a-4766-8569-c9a79ac1d500",
"policyName": "Dev_policy-D",
"policyOwner": "devnetuser",
"policyPriority": 4095,
"state": "Active",
"taskId": "276b1083-a582-4773-9b15-f8255ea6f91d",
"id": "35646f3a-f84a-4766-8569-c9a79ac1d500",
"resource": {
"applications": [
{
"appName": "disney",
"id": "64ae9f46-ea00-459d-9bd7-c449ac42971f"
}
]
},
"actions": [
"SET_PROPERTY"
],
"policyScope": "DevNet",
"actionProperty": {
"relevanceLevel": "Business-Relevant",
"pathControlFlag": false,
"pathPreferenceFlag": false
}
}]
Comments
0 comments
Please sign in to leave a comment.