cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1570
Views
0
Helpful
1
Replies

Error updating a policy with APIC-EM API

andreizamfir16
Beginner
Beginner

Hello! I'm trying to use the APIC-EM and its API to update a policy, but I get the error "BadRequest", with failureReason "Invalid Policy". The body I'm using in the PUT request is the following json:

[

   {

      "instanceUuid":"a298dfd7-1a21-4ab5-a223-df415906a681",

      "policyName":"Test-Policy-1_BR",

      "policyOwner":"devnetuser",

      "policyPriority":4095,

      "state":"Active",

      "taskId":"f3a40f1d-a675-4cb8-acec-41b0625ac161",

      "id":"96348dc5-a760-4ce3-9ee8-28b349ba6618",

      "resource":{

         "applications":[

            {

               "appName":"ptp",

               "id":"0661d06e-99ad-41b6-93e0-e36ff02029af"

            },

            {

               "appName":"twitch-tv",

               "id":"019d6ce9-8e40-401c-9b11-14483d7d5f7d"

            },

            {

               "appName":"distcc",

               "id":"01b823bd-9a18-4891-8eed-8d40c2016abe"

            },

            {

               "appName":"directv-soft",

               "id":"012ac649-a306-4c0c-9098-da00bc91d510"

            },

            {

               "appName":"windows-store",

               "id":"00d2d0d4-1b31-43ff-845e-f4f1f0fd7b07"

            }

         ]

      },

      "actions":[

         "SET_PROPERTY"

      ],

      "policyScope":"Test-Policy-1",

      "actionProperty":{

         "relevanceLevel":"Business-Rrelevant",

         "pathControlFlag":false,

         "pathPreferenceFlag":false

      }

   }

]

The json I'm getting as processing the task is this one:

{

   "response":{

      "startTime":1465576395397,

      "endTime":1465576395403,

      "progress":"Policy Update Failed",

      "version":1465576395397,

      "errorCode":"BadRequest",

      "serviceType":"Policy Service",

      "operationIdList":[

         "669ea643-04ad-478e-abe9-322dc775e872"

      ],

      "isError":true,

      "failureReason":"Invalid Policy",

      "rootId":"30e589a3-613c-4184-a681-6378cd201de0",

      "id":"30e589a3-613c-4184-a681-6378cd201de0"

   },

   "version":"1.0"

}

Also, while trying to update a policy with this body:

[
   {
      "instanceUuid":"a298dfd7-1a21-4ab5-a223-df415906a681",
      "policyName":"Test-Policy-1_IR",
      "policyOwner":"devnetuser",
      "policyPriority":4095,
      "state":"Active",
      "taskId":"9f3f7ece-10e8-4e9b-9476-c96b8280d343",
      "id":"a298dfd7-1a21-4ab5-a223-df415906a681",
      "resource":{
         "applications":[
            {
               "appName":"wordreference-com",
               "id":"218c7242-9455-42b8-aaf9-5e65f7a322ca"
            },
            {
               "appName":"smakynet",
               "id":"04fa6934-6e42-496a-93e6-1f5e4ccb464d"
            }
         ]
      },
      "actions":[
         "SET_PROPERTY"
      ],
      "policyScope":"Test-Policy-1",
      "actionProperty":{
         "relevanceLevel":"Business-Irrelevant",
         "pathControlFlag":false,
         "pathPreferenceFlag":false
      }
   }
]

I get this response:

{

   "response":{

      "startTime":1465577653334,

      "endTime":1465577653415,

      "progress":"Policy Update Failed",

      "version":1465577653334,

      "errorCode":"ResourceConflict",

      "serviceType":"Policy Service",

      "operationIdList":[

         "360966c9-0306-47b9-94c8-7972e39f13e0"

      ],

      "isError":true,

      "failureReason":"Policy Conflict",

      "rootId":"9eadc2d0-0eaf-4da0-92a6-71f86110ee20",

      "id":"9eadc2d0-0eaf-4da0-92a6-71f86110ee20"

   },

   "version":"1.0"

}, having errorCode "ResourceConflict" and failureReason "Policy Conflict".

Any ideas what those errors mean?

1 ACCEPTED SOLUTION

Accepted Solutions

yawming
Cisco Employee
Cisco Employee
1 REPLY 1

yawming
Cisco Employee
Cisco Employee
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: