- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Getting all the permissions via WAPI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-27-2017 01:42 PM
I have been asked recently, how to get the permissions via WAPI:
1) All permissions
https://demo.se.infr.infoblox.com/wapi/v2.7/permission?_return_fields%2B=object
[
{
"_ref": "permission/b25lLmhpZXJfcnVsZSQuY29tLmluZm9ibG94LmRucy56b25lJC4uLi4uY29tLmluZm9ibG94Lm9uZS5yb2xlJEROUyBBZG1pbi4NS%20Admin/WRITE",
"object": null,
"permission": "WRITE",
"resource_type": "VIEW",
"role": "DNS Admin"
},
...
{
"_ref": "permission/b25lLmhpZXJfcnVsZSQuY29tLmluZm9ibG94LmRucy5uZXR3b3JrJDEwLjEyOC4zMy4wLzI0LzAuLi5jb20uaW5mb2Jsb3gub25lLmFkbWluX2dyb3VwJC56b25lMnN1Ym5ldDEuZG5zLmhvc3RfYWRkcmVzcztpc19pcHY0PXRydWU:zone2subnet1/WRITE",
"group": "zone2subnet1",
"object": "network/ZG5zLm5ldHdvcmskMTAuMTI4LjMzLjAvMjQvMA:10.128.33.0/24/default",
"permission": "WRITE",
"resource_type": "HOST_ADDRESS"
},
{
"_ref": "permission/b25lLmhpZXJfcnVsZSQuY29tLmluZm9ibG94LmRucy56b25lJC4uLi4uY29tLmluZm9ibG94Lm9uZS5hZG1pbl9ncm91cCQuem9uZTJzdWJuZXQxLmRucy56b25l:zone2subnet1/DENY",
"group": "zone2subnet1",
"object": null,
"permission": "DENY",
"resource_type": "ZONE"
}
]
2) Permission on a given object
https://demo.se.infr.infoblox.com/wapi/v2.7/permission?_return_fields%2B=object&object="network/ZG5zLm5ldHdvcmskMTAuMTI4LjMzLjAvMjQvMA:10.128.33.0/24/default"
3) Permission for a given group
https://demo.se.infr.infoblox.com/wapi/v2.7/permission?_return_fields%2B=object&group=zone2subnet1
4) Permissions for a type of permission (READ, WRITE, DENY)
https://demo.se.infr.infoblox.com/wapi/v2.7/permission?_return_fields%2B=object&permission=DENY
Re: Getting all the permissions via WAPI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-08-2019 12:05 AM
THis was very helpful however can you provide a similar guides to set a permission? I'm able to define pools of addresses via the API, however I'm currently manually assigning permission to groups via the UI.
Re: Getting all the permissions via WAPI
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-08-2019 02:06 PM - edited 08-08-2019 02:09 PM
i figured it out after a little playing
POST https://{{grid_master url}}/wapi/v2.5/permission?object={{object id}}&group={{group}}&permission={{WRITE/READ/DENY}}
example
h t t p s: //{{grid_master url}}/wapi/v2.5/permission?object=network/ZG5zLm5ldHdvcmskMTAuMS4wLjAvMjQvMA:10.1.0.0/24/NZ&group=G_VMware_DevVMPowerUser_AU&permission=WRITE
After creating an subnet via the WAPI, you retrieve the network subnet object, then you apply the permission with the command above. Note: post will only allow you set the permissions once. I haven't gotten around to using PUT to change permissions.