Hi,
I am trying to add an API proxy to some custom roles using Node.js script. I will be getting "API Proxy Name" & "Custom Role Name" as parameters. I am not sure how to start this. Can someone help me out?
Hi Brinda,
Have you tried looking at these two documents as a starting point?
https://docs.apigee.com/api-platform/system-administration/managing-roles-api
https://docs.apigee.com/api-platform/system-administration/understanding-roles
Chris
Hi @Chris Hood,
I am trying to use this curl command to add the api proxy to custom role. But it is giving me permission error. Does anyone know what needs to be done to fix permission error?
curl -X POST --header "Content-Type: application/json" -d "{\"resourcePermission\" : [ {\"path\" : \"/applications/{apiproxy}\",\"permissions\" : [ \"get\",\"put\", \"delete\" ]}]}" "https://api.enterprise.apigee.com/v1/organizations/{org}/userroles/{customtestrole}/resourcepermissions" -u email:password
This is the error that I see in runtime logs for nodejs
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ npm update check failed │ |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ Try running with sudo or get access │ |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ to the local update config store via │ |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ sudo chown -R $USER:$(id -gn $USER) /root/.config |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 |
Check this repo I built sometime back. You need Maven to deploy the proxy. This proxy will be able to create the API Proxy and assign the specific custom role.
I am trying to use this curl command to add the api proxy to custom role. But it is giving me permission error. Does anyone know what needs to be done to fix permission error?
curl -X POST --header "Content-Type: application/json" -d "{\"resourcePermission\" : [ {\"path\" : \"/applications/{apiproxy}\",\"permissions\" : [ \"get\",\"put\", \"delete\" ]}]}" "https://api.enterprise.apigee.com/v1/organizations/{org}/userroles/{customtestrole}/resourcepermissions" -u email:password
This is the error that I see in runtime logs for nodejs
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ npm update check failed │ |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ Try running with sudo or get access │ |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ to the local update config store via │ |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 | │ sudo chown -R $USER:$(id -gn $USER) /root/.config |
Nov 1, 2018 9:27:21 AM | stderr | svr.0 |