Sonatype Nexus Security management: roles API

The Security management: roles API from Sonatype Nexus — 2 operation(s) for security management: roles.

OpenAPI Specification

sonatype-nexus-security-management-roles-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  contact:
    name: Sonatype Community Maintainers
    url: https://github.com/sonatype-nexus-community
  description: This documents the available APIs into [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) as of version 3.91.0-07.
  license:
    name: Apache-2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: 'Sonatype Nexus Repository Manager assets Security management: roles API'
  version: 3.91.0-07
servers:
- url: /service/rest/
security:
- BasicAuth: []
tags:
- name: 'Security management: roles'
paths:
  /v1/security/roles:
    get:
      operationId: getRoles
      parameters:
      - description: The id of the user source to filter the roles by, if supplied. Otherwise roles from all user sources will be returned.
        in: query
        name: source
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/RoleXOResponse'
                type: array
          description: successful operation
        '400':
          content: {}
          description: The specified source does not exist
        '403':
          content: {}
          description: Insufficient permissions to read roles
      summary: List roles
      tags:
      - 'Security management: roles'
    post:
      operationId: create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleXORequest'
        description: A role configuration
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleXOResponse'
          description: successful operation
        '403':
          content: {}
          description: Insufficient permissions to create role
      summary: Create role
      tags:
      - 'Security management: roles'
      x-codegen-request-body-name: body
  /v1/security/roles/{id}:
    delete:
      operationId: delete
      parameters:
      - description: The id of the role to delete
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '204':
          content: {}
          description: Success
        '403':
          content: {}
          description: Insufficient permissions to delete role
        '404':
          content: {}
          description: Role not found
      summary: Delete role
      tags:
      - 'Security management: roles'
    get:
      operationId: getRole
      parameters:
      - description: The id of the user source to filter the roles by. Available sources can be fetched using the 'User Sources' endpoint.
        in: query
        name: source
        schema:
          default: default
          type: string
      - description: The id of the role to get
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleXOResponse'
          description: successful operation
        '400':
          content: {}
          description: The specified source does not exist
        '403':
          content: {}
          description: Insufficient permissions to read roles
        '404':
          content: {}
          description: Role not found
      summary: Get role
      tags:
      - 'Security management: roles'
    put:
      operationId: update
      parameters:
      - description: The id of the role to update
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleXORequest'
        description: A role configuration
        required: true
      responses:
        '403':
          content: {}
          description: Insufficient permissions to update role
        '404':
          content: {}
          description: Role not found
      summary: Update role
      tags:
      - 'Security management: roles'
      x-codegen-request-body-name: body
components:
  schemas:
    RoleXOResponse:
      properties:
        description:
          description: The description of this role.
          type: string
        id:
          description: The id of the role.
          type: string
        name:
          description: The name of the role.
          type: string
        privileges:
          description: The list of privileges assigned to this role.
          items:
            type: string
          type: array
          uniqueItems: true
        readOnly:
          description: Indicates whether the role can be changed. The system will ignore any supplied external values.
          type: boolean
        roles:
          description: The list of roles assigned to this role.
          items:
            type: string
          type: array
          uniqueItems: true
        source:
          description: The user source which is the origin of this role.
          type: string
      type: object
    RoleXORequest:
      properties:
        description:
          description: The description of this role.
          type: string
        id:
          description: The id of the role.
          type: string
        name:
          description: The name of the role.
          type: string
        privileges:
          description: The list of privileges assigned to this role.
          items:
            type: string
          type: array
          uniqueItems: true
        roles:
          description: The list of roles assigned to this role.
          items:
            type: string
          type: array
          uniqueItems: true
      type: object
  securitySchemes:
    BasicAuth:
      scheme: basic
      type: http
x-original-swagger-version: '2.0'