Management APIs to associate API Proxy to custom role

We are in process of automation of QA deployment so we need to know if there's any Management APIs available to associate proxies to custom role.

0 1 180
1 REPLY 1

You can use one of the following management APIs to associate a specific API Proxy to a custom role:

  1. Add Permissions for Resource to a Role
  2. Add Multiple Resource Permissions for Resource

For example:

Let's say you want to give the permissions to view and edit an API Proxy named "TestOAuth" and also permissions to deploy and trace this API Proxy in an environment "test", then you can run the "Add Multiple Resource Permissions for Resource" API as follows:


curl -X POST -H "Content-Type: application/json" "https://api.enterprise.apigee.com/v1/organizations/<org-name>/userroles/<role-name>/resourcepermissions" 
with the following request payload
{
"resourcePermission" : [
{
"path" : "/applications/TestOAuth",
"permissions" : [ "get","put"]
},
{
"path" : "/environments/test/applications/TestOAuth/revisions/*/deployments",
"permissions" : [ "get","put"]
},
{
"path" : "/environments/test/applications/TestOAuth/revisions/*/debugsessions",
"permissions" : [ "get","put","delete"]
}
]
}