NVIDIA Run:ai Roles API

A role is a group of permissions that can be granted. Permissions are a set of actions that can be applied to entities. For more information, see [Roles](https://run-ai-docs.nvidia.com/saas/infrastructure-setup/authentication/roles).

OpenAPI Specification

runai-roles-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: latest
  description: '# Introduction


    The NVIDIA Run:ai Control-Plane API reference is a guide that provides an easy-to-use programming interface for adding various tasks to your application, including workload submission, resource management, and administrative operations.


    NVIDIA Run:ai APIs are accessed using *bearer tokens*. To obtain a token, you need to create a **Service account** through the NVIDIA Run:ai user interface.

    To create a service account, in your UI, go to Access → Service Accounts (for organization-level service accounts) or User settings → Access Keys (for user access keys), and create a new one.


    After you have created a new service account, you will need to assign it access rules.

    To assign access rules to the service account, see [Create access rules](https://run-ai-docs.nvidia.com/saas/infrastructure-setup/authentication/accessrules#create-or-delete-rules).

    Make sure you assign the correct rules to your service account. Use the [Roles](https://run-ai-docs.nvidia.com/saas/infrastructure-setup/authentication/roles) to assign the correct access rules.


    To get your access token, follow the instructions in [Request a token](https://run-ai-docs.nvidia.com/saas/reference/api/rest-auth/#request-an-api-token).

    '
  title: NVIDIA Run:ai Access Keys Roles API
  x-logo:
    url: https://api.redocly.com/registry/raw/runai-xq8/saas/latest/public/runai-logo-api.png
    altText: NVIDIA Run:ai
    href: https://run.ai
  license:
    name: NVIDIA Run:ai
    url: https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-software-license-agreement/
servers:
- url: https://app.run.ai
security:
- bearerAuth: []
tags:
- name: Roles
  description: "A role is a group of permissions that can be granted. \nPermissions are a set of actions that can be applied to entities.\nFor more information, see [Roles](https://run-ai-docs.nvidia.com/saas/infrastructure-setup/authentication/roles).\n"
paths:
  /api/v1/authorization/roles:
    get:
      summary: Get a list of roles.
      description: Use to retrieve a list of roles.
      operationId: get_roles_v1
      tags:
      - Roles
      responses:
        '200':
          description: Executed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RolesV1'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
  /api/v1/authorization/roles/{roleIdPath}:
    get:
      summary: Get a role by id.
      description: Retrieve the details of a role by id.
      operationId: get_role_v1
      tags:
      - Roles
      parameters:
      - $ref: '#/components/parameters/RoleIdPath'
      responses:
        '200':
          description: Executed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleV1'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
components:
  responses:
    401Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 401
            message: Issuer is not familiar.
    404NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 404
            message: Resource id not found.
    500InternalServerError:
      description: unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 500
            message: Something went wrong.
    400BadRequest:
      description: Bad request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 400
            message: Required parameter is missing
    503ServiceUnavailable:
      description: unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 503
            message: Please try again in few minutes.
    403Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 403
            message: You do not have sufficient permissions.
  schemas:
    RoleV1:
      type: object
      required:
      - name
      - description
      - permissions
      - id
      - createdAt
      - updatedAt
      - createdBy
      - custom
      - effectiveEnabled
      properties:
        id:
          type: integer
          format: int32
          example: 32
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          nullable: true
          format: date-time
        createdBy:
          type: string
          example: user@run.ai
        custom:
          type: boolean
        effectiveEnabled:
          type: boolean
          default: true
        permissions:
          $ref: '#/components/schemas/Permissions'
        name:
          type: string
          example: admin
        description:
          type: string
          example: can manage all resources
        enabled:
          type: boolean
          default: true
          nullable: true
        kubernetesPermissions:
          $ref: '#/components/schemas/KubernetesPermissions'
    KubernetesPermissions:
      type: object
      description: This object indicate what kubernetes cluster permission should this role should get
      properties:
        predefinedRole:
          type: string
          description: An id of a predefined role to copy the cluster permissions from
          example: '12'
          nullable: true
    Permission:
      type: object
      required:
      - resourceType
      - actions
      - groupId
      - displayName
      properties:
        resourceType:
          $ref: '#/components/schemas/ResourceType'
        displayName:
          type: string
          example: Projects
        groupId:
          $ref: '#/components/schemas/ResourceTypeGroupId'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/Action'
    RolesV1:
      type: array
      items:
        $ref: '#/components/schemas/RoleV1'
    Permissions:
      type: array
      items:
        $ref: '#/components/schemas/Permission'
      x-schema-name: Permissions
    ResourceTypeGroupId:
      type: string
      enum:
      - organization
      - physical-resource
      - iam
      - dashboard
      - workload
      - workload-asset
    ResourceType:
      type: string
      description: "Resource type enum for authorization. \n\nNote: The 'apps' resource type is DEPRECATED. Please use 'service-account' instead for managing service accounts.\n"
      enum:
      - department
      - tenant
      - project
      - cluster
      - cluster-config
      - nodepools
      - nodes
      - settings
      - security-settings
      - branding-settings
      - users
      - apps
      - service-account
      - dashboards-overview
      - dashboards-analytics
      - dashboards-consumption
      - roles
      - access_rules
      - jobs
      - workloads
      - workspaces
      - trainings
      - inferences
      - environments
      - pvc-assets
      - git-assets
      - host-path-assets
      - nfs-assets
      - s3-assets
      - compute-resources
      - templates
      - credentials
      - events-history
      - policies
      - cm-volume-assets
      - datavolumes
      - secret-volume-assets
      - storage-class-configuration
      - access-keys
      - workload-properties
      - network-topologies
      - registries
      - scrapeable-metrics
    Action:
      type: string
      enum:
      - create
      - read
      - update
      - delete
      - sync
    Error:
      required:
      - code
      - message
      properties:
        code:
          type: integer
          minimum: 100
          maximum: 599
        message:
          type: string
        details:
          type: string
      example:
        code: 400
        message: Bad request - Resource should have a name
  parameters:
    RoleIdPath:
      name: roleIdPath
      in: path
      required: true
      description: The id of the role to retrieve
      example: 32
      schema:
        type: integer
        format: int32
        minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer authentication
x-tagGroups:
- name: Organizations
  tags:
  - Clusters
  - Departments
  - Reports
  - NodePools
  - Nodes
  - Projects
  - Tenant
  - Logo
  - Researcher Command Line Interface
  - Researcher Command Line Interface Deprecated
  - Administrator Command Line Interface
  - Network Topologies
- name: Authentication and Authorization
  tags:
  - Access Keys
  - Access rules
  - Permissions
  - Applications
  - Service Accounts
  - Roles
  - Tokens
  - Users
  - User Applications
  - Idps
  - Me
  - Settings
  - Org unit
- name: Audit
  tags:
  - AuditLogs
- name: Datavolumes
  tags:
  - Datavolumes
- name: Workloads
  tags:
  - Events
  - Pods
  - Workloads
  - Workloads V2
  - NVIDIA NIM
  - Workspaces
  - Trainings
  - Inferences
  - Revisions
  - Distributed
  - Workloads batch
  - Workload properties
  - Workload templates
  - Distributed Inferences
- name: Workload assets
  tags:
  - Compute
  - Credentials
  - Datasources
  - Environment
  - Storage Classes
  - Storage Class Configuration
  - Git
  - HostPath
  - NFS
  - PVC
  - Registry
  - S3
  - ConfigMap
  - Secret
  - Template
- name: Policies
  tags:
  - Policy
- name: Notifications
  tags:
  - Notification State
  - Notification Types
  - NotificationChannels
  - Subscriptions
- name: AI Applications
  tags:
  - AI Applications