Skip to main content

How do I use RBAC REST API?

Comments

8 comments

  • Allan Tony Selvan

    There is no documentation for creating a role but it works. Is it intentionally not there?

    "${jenkinsUrl}/roles/createRole/api/json?name=user"

    0
  • Denys Digtiar

    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.

    1
  • Allan Tony Selvan

    @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.

    0
  • Venkatareddy Sathi

    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

    0
  • Zulfiqar khoja

    What is the syntax to check if a group exists?

    0
  • Allan Tony Selvan

    @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.

    0
  • Zulfiqar khoja

    @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. 

     

     

    1
  • Allan Tony Selvan

    Awesome! Thats for the update :D 

    0

Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.