cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2033
Views
10
Helpful
11
Replies

APIC-EM 1.4.1.X REST API - Advanced Policy Settings

mario.malenica
Level 1
Level 1

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?     

1 Accepted Solution

Accepted Solutions

aradford
Cisco Employee
Cisco Employee

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

View solution in original post

11 Replies 11

aradford
Cisco Employee
Cisco Employee

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

Thanks Adam,

That's what I am looking for.

Hi aradford,


Can you please advise what's the REST API for changing traffic direction to bidirectional?

Many Thanks.

Johnson

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": []

  }

}]

Thanks aradford!


Is it possible to update multiple applications in an exiting policy ?


Johnson

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"

  }

]

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

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

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

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?

https://communities.cisco.com/community/developer/dna/blog/2016/11/27/next-generation-network-deployment-easyqos-apic-em-13-part2

Adam

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