Vers commits API

The commits API from Vers — 4 operation(s) for commits.

OpenAPI Specification

vers-commits-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Orchestrator Control Plane commit_tags commits API
  description: ''
  license:
    name: ''
  version: 0.1.0
tags:
- name: commits
paths:
  /api/v1/commits:
    get:
      tags:
      - commits
      operationId: list_commits
      parameters:
      - name: limit
        in: path
        description: 'Maximum number of commits to return (default: 50, max: 100)'
        required: true
        schema:
          type:
          - integer
          - 'null'
          format: int64
      - name: offset
        in: path
        description: 'Number of commits to skip (default: 0)'
        required: true
        schema:
          type:
          - integer
          - 'null'
          format: int64
      responses:
        '200':
          description: List of commits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCommitsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
      - bearer_auth: []
  /api/v1/commits/public:
    get:
      tags:
      - commits
      operationId: list_public_commits
      parameters:
      - name: limit
        in: path
        description: 'Maximum number of commits to return (default: 50, max: 100)'
        required: true
        schema:
          type:
          - integer
          - 'null'
          format: int64
      - name: offset
        in: path
        description: 'Number of commits to skip (default: 0)'
        required: true
        schema:
          type:
          - integer
          - 'null'
          format: int64
      responses:
        '200':
          description: List of public commits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCommitsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
      - bearer_auth: []
  /api/v1/commits/{commit_id}:
    delete:
      tags:
      - commits
      operationId: delete_commit
      parameters:
      - name: commit_id
        in: path
        description: Commit ID to delete
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Commit deleted
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Commit not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Commit in use
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
      - bearer_auth: []
    patch:
      tags:
      - commits
      operationId: update_commit
      parameters:
      - name: commit_id
        in: path
        description: The commit ID
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCommitRequest'
        required: true
      responses:
        '200':
          description: Commit updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommitInfo'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Commit not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
      - bearer_auth: []
  /api/v1/vm/commits/{commit_id}/parents:
    get:
      tags:
      - commits
      operationId: list_parent_commits
      parameters:
      - name: commit_id
        in: path
        description: Commit ID to start from
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: List of commits from the specified commit to the root
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VmCommitEntity'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Commit not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
      - bearer_auth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Reason of error
        success:
          type: boolean
          description: 'Is always: false'
    ListCommitsResponse:
      type: object
      required:
      - commits
      - total
      - limit
      - offset
      properties:
        commits:
          type: array
          items:
            $ref: '#/components/schemas/CommitInfo'
        limit:
          type: integer
          format: int64
        offset:
          type: integer
          format: int64
        total:
          type: integer
          format: int64
    CommitInfo:
      type: object
      required:
      - commit_id
      - owner_id
      - name
      - created_at
      - is_public
      properties:
        commit_id:
          type: string
        created_at:
          type: string
        description:
          type:
          - string
          - 'null'
        grandparent_commit_id:
          type:
          - string
          - 'null'
        is_public:
          type: boolean
        name:
          type: string
        owner_id:
          type: string
        parent_vm_id:
          type:
          - string
          - 'null'
    UpdateCommitRequest:
      type: object
      description: Request body for PATCH /commits/{commit_id}
      required:
      - is_public
      properties:
        description:
          type:
          - string
          - 'null'
          description: Optional description for the commit.
        is_public:
          type: boolean
        name:
          type:
          - string
          - 'null'
          description: Optional human-readable name for the commit.
    VmCommitEntity:
      type: object
      required:
      - id
      - owner_id
      - name
      - created_at
      - is_public
      properties:
        created_at:
          type: string
          format: date-time
        description:
          type:
          - string
          - 'null'
        grandparent_commit_id:
          type:
          - string
          - 'null'
          format: uuid
          description: The commit that this commit's parent VM was started from, if any. Intended to optimize traversing the commit tree.
        id:
          type: string
          format: uuid
        is_public:
          type: boolean
          description: Whether this commit is publicly accessible (readable/restorable by anyone).
        name:
          type: string
        owner_id:
          type: string
          format: uuid
          description: api key id.
        parent_vm_id:
          type:
          - string
          - 'null'
          format: uuid
          description: The VM that this commit was created from, if any.
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: Token