@Denys Thanks much. Really good documentation indeed of the RBAC roles.
Is there also documentation of other Jenkins API's for example : for creating a folder in Jenkins. Also I need a API by which I can add global as well as folder domain credentials in Jenkins.
@Zulfiqar if you do a get request on https://{{JENKIN_URL}}/groups/{{GROUP_NAME}} you should get a 302 Found status if it exists and a 404 Not Found if it is not found.
I had also created a CLI long ago which could do most of the RBAC requests - might be interesting to see.
Comments
8 comments
There is no documentation for creating a role but it works. Is it intentionally not there?
"${jenkinsUrl}/roles/createRole/api/json?name=user"
Here are just a few example of how to use the API endpoints which are documented in
https://go.cloudbees.com/docs/cloudbees-documentation/cje-user-guide/index.html#rbac-sect-rest-api-roles-management
which includes the Role endpoints.
@Denys Thanks much. Really good documentation indeed of the RBAC roles.
Is there also documentation of other Jenkins API's for example : for creating a folder in Jenkins. Also I need a API by which I can add global as well as folder domain credentials in Jenkins.
What is the syntax to delete a member from group? if i try below syntax API returns a confirmation page to delete member.
https://jenkins/job/folder/groups/group/deleteMember?member=abc
What is the syntax to check if a group exists?
@Venkatareddy
Add member: {{JenkinsUrl}}/groups/{{groupName}}/addMember/api/json?name={{memberId}}
Remove member: {{JenkinsUrl}}/groups/{{groupName}}/removeMember/api/json?name={{memberId}}
@Zulfiqar
if you do a get request on https://{{JENKIN_URL}}/groups/{{GROUP_NAME}} you should get a 302 Found status if it exists and a 404 Not Found if it is not found.
I had also created a CLI long ago which could do most of the RBAC requests - might be interesting to see.
@Allan
I found a better solution, https://{{JENKIN_URL}}/groups/{{GROUP_NAME}} /api/json?pretty=true
The URL https://{{JENKIN_URL}}/groups/{{GROUP_NAME}} is not a RBAC API. It hung our production system when I mistakenly used it as a Rest API.
Awesome! Thats for the update :D
Please sign in to leave a comment.