05-16-2017 06:01 AM - last edited on 03-25-2019 01:20 PM by ciscomoderator
Hello,
I want to set a traffic direction (to Bidirectional) and assign a CONSUMER to a Custom app trough REST API, but the problem is I can not find the right API request that can show me Advanced Policy Settings?
Has someone tried setting Advance Policy Settings trough REST API, can you tell me where can I find information about traffic direction, and consumers?
Solved! Go to Solution.
05-16-2017 06:15 AM
short answer is you create an application which is a consumer (e.g. name of "consumer"). The "trafficClass" will be "CONSUMER". You will need to get the id of this application (e.g. "xxxx")
you then update the policy attribute "networkUser ": { "applications" [{"appName" : "consumer", "id" : "xxxx", "stale" : false}]}
Can give you more details if required.
adam
05-16-2017 06:15 AM
short answer is you create an application which is a consumer (e.g. name of "consumer"). The "trafficClass" will be "CONSUMER". You will need to get the id of this application (e.g. "xxxx")
you then update the policy attribute "networkUser ": { "applications" [{"appName" : "consumer", "id" : "xxxx", "stale" : false}]}
Can give you more details if required.
adam
05-16-2017 07:02 AM
Thanks Adam,
That's what I am looking for.
06-26-2017 05:19 PM
Hi aradford,
Can you please advise what's the REST API for changing traffic direction to bidirectional?
Many Thanks.
Johnson
06-26-2017 09:47 PM
Hi Johnson,
you need to create a new policy that has the application as a networkUser
This is how i converted my PointOfSale application to Bidirectional.
[{
"policyName": "StoreQoS-BR",
"policyOwner": "admin",
"policyPriority": 4095,
"actions": ["SET_PROPERTY"],
"policyScope": "All-StoreDevicesWiredWireless",
"actionProperty": {
"relevanceLevel": "Business-Relevant"
},
"networkUser": {
"applications": [{
"id": "34559bc9-a432-44c1-81d7-96bb5aacb002",
"appName": "PointOfSale"
}]
},
"resource": {
"applications": []
}
}]
06-26-2017 10:16 PM
Thanks aradford!
Is it possible to update multiple applications in an exiting policy ?
Johnson
06-27-2017 05:08 AM
hi Johnson,
yes you can... just add multiple apps to the networkUser['applications'] list. snippet below.
"applications": [
{
"id": "34559bc9-a432-44c1-81d7-96bb5aacb002",
"appName": "PointOfSale"
},
{
"id": "2259bc9-a432-44c1-81d7-934b5aa23b003",
"appName": "PointOfSale2"
}
]
06-27-2017 08:19 PM
That's cool.
What if we already have an existing policy created for a scope, how to update that policy instead of creating a new one?
I also noticed that if we created a brand new policy for a scope without existing policies, only the applications listed in the POST will be assigned to that scope&policy, does that mean we have to include all the applications one by one? or is there a a way to include the default applications as the GUI interface?
Thanks again.
Johnson
06-29-2017 06:22 AM
Hi Johnson,
#1 they are done as two statements, but reference the same apps. You need to have the same name for both.
Note: the correct policy will have a -BR at the end of the name.
#2 The UI just grabs the default policy. There are really three policies, one for BR, Default and BI (business irrelevant).
Their names are:
- BUSINESS_RELEVANT_CVD_Policy
- DEFAULT_CVD_Policy
- BUSINESS_IRRELEVANT_CVD_Policy
You can just GET each of those, and extract the application list from them.
adam
06-29-2017 06:28 PM
Thanks Adam, that's very help... hopefully we will have a more detailed API help document in the near future to guide us how to invoke those APIs.
Johnson
06-30-2017 04:38 AM
yes,
I should add a second blog on the EQ API to cover more advanced use cases like this.
Did you read the first one at all?
Adam
06-30-2017 05:30 AM
No, not until today...
I did enjoy your other blogs about APIC-EM thoug. I'm deploying APIC-EM for couple of customers, one finished, one is going to finish next week, and three other on the list. At here in Australia Cisco use your blogs as part of the acceptance of the Automation part for the customers using DNA vouchers.
So really appreciate your bloga, please keep posting the cool things:).
Johnson
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide