lakeFS pulls API

The pulls API from lakeFS — 3 operation(s) for pulls.

OpenAPI Specification

lakefs-pulls-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: lakeFS HTTP API
  title: lakeFS actions pulls API
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
- url: /api/v1
  description: lakeFS server endpoint
security:
- jwt_token: []
- basic_auth: []
- cookie_auth: []
- oidc_auth: []
- saml_auth: []
tags:
- name: pulls
paths:
  /repositories/{repository}/pulls:
    parameters:
    - in: path
      name: repository
      required: true
      schema:
        type: string
    get:
      tags:
      - pulls
      operationId: listPullRequests
      summary: list pull requests
      parameters:
      - $ref: '#/components/parameters/PaginationPrefix'
      - $ref: '#/components/parameters/PaginationAfter'
      - $ref: '#/components/parameters/PaginationAmount'
      - in: query
        name: status
        schema:
          type: string
          enum:
          - open
          - closed
          - all
          default: all
          description: filter pull requests by status
      responses:
        200:
          description: list of pull requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestsList'
        400:
          $ref: '#/components/responses/BadRequest'
        401:
          $ref: '#/components/responses/Unauthorized'
        404:
          $ref: '#/components/responses/NotFound'
        429:
          description: too many requests
        default:
          $ref: '#/components/responses/ServerError'
    post:
      tags:
      - pulls
      operationId: createPullRequest
      summary: create pull request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PullRequestCreation'
      responses:
        201:
          description: pull request created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequestCreationResponse'
        400:
          $ref: '#/components/responses/ValidationError'
        401:
          $ref: '#/components/responses/Unauthorized'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        409:
          $ref: '#/components/responses/Conflict'
        429:
          description: too many requests
        default:
          $ref: '#/components/responses/ServerError'
  /repositories/{repository}/pulls/{pull_request}:
    parameters:
    - in: path
      name: repository
      required: true
      schema:
        type: string
    - in: path
      name: pull_request
      required: true
      description: pull request id
      schema:
        type: string
    get:
      tags:
      - pulls
      operationId: getPullRequest
      summary: get pull request
      responses:
        200:
          description: pull request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequest'
        400:
          $ref: '#/components/responses/ValidationError'
        401:
          $ref: '#/components/responses/Unauthorized'
        404:
          $ref: '#/components/responses/NotFound'
        429:
          description: too many requests
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      tags:
      - pulls
      operationId: updatePullRequest
      summary: update pull request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PullRequestBasic'
      responses:
        200:
          description: pull request updated successfully
        400:
          $ref: '#/components/responses/ValidationError'
        401:
          $ref: '#/components/responses/Unauthorized'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        429:
          description: too many requests
        default:
          $ref: '#/components/responses/ServerError'
  /repositories/{repository}/pulls/{pull_request}/merge:
    parameters:
    - in: path
      name: repository
      required: true
      schema:
        type: string
    - in: path
      name: pull_request
      required: true
      description: pull request id
      schema:
        type: string
    put:
      tags:
      - pulls
      operationId: mergePullRequest
      summary: merge pull request
      responses:
        200:
          description: merge completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergeResult'
        400:
          $ref: '#/components/responses/ValidationError'
        401:
          $ref: '#/components/responses/Unauthorized'
        403:
          $ref: '#/components/responses/Forbidden'
        404:
          $ref: '#/components/responses/NotFound'
        409:
          description: 'Conflict

            Deprecated: content schema will return Error format and not an empty MergeResult

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergeResult'
        412:
          description: precondition failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        429:
          description: too many requests
        default:
          $ref: '#/components/responses/ServerError'
components:
  responses:
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Validation Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Resource Conflicts With Target
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    PullRequest:
      allOf:
      - $ref: '#/components/schemas/PullRequestBasic'
      - required:
        - status
        - title
        - description
      - type: object
        required:
        - id
        - creation_date
        - author
        - source_branch
        - destination_branch
        properties:
          id:
            type: string
          creation_date:
            type: string
            format: date-time
          author:
            type: string
          source_branch:
            type: string
          destination_branch:
            type: string
          merged_commit_id:
            type: string
            description: the commit id of merged PRs
          closed_date:
            type: string
            format: date-time
    PullRequestsList:
      type: object
      required:
      - pagination
      - results
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        results:
          type: array
          items:
            $ref: '#/components/schemas/PullRequest'
    MergeResult:
      type: object
      required:
      - reference
      properties:
        reference:
          type: string
    PullRequestBasic:
      type: object
      properties:
        status:
          type: string
          enum:
          - open
          - closed
          - merged
        title:
          type: string
        description:
          type: string
    PullRequestCreationResponse:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          description: ID of the pull request
    Pagination:
      type: object
      required:
      - has_more
      - max_per_page
      - results
      - next_offset
      properties:
        has_more:
          type: boolean
          description: Next page is available
        next_offset:
          type: string
          description: Token used to retrieve the next page
        results:
          type: integer
          minimum: 0
          description: Number of values found in the results
        max_per_page:
          type: integer
          minimum: 0
          description: Maximal number of entries per page
    PullRequestCreation:
      type: object
      required:
      - title
      - source_branch
      - destination_branch
      properties:
        title:
          type: string
        description:
          type: string
        source_branch:
          type: string
        destination_branch:
          type: string
    Error:
      type: object
      required:
      - message
      properties:
        message:
          description: short message explaining the error
          type: string
  parameters:
    PaginationAfter:
      in: query
      name: after
      description: return items after this value
      allowEmptyValue: true
      schema:
        type: string
    PaginationPrefix:
      in: query
      name: prefix
      allowEmptyValue: true
      description: return items prefixed with this value
      schema:
        type: string
    PaginationAmount:
      in: query
      name: amount
      description: how many items to return
      schema:
        type: integer
        minimum: -1
        maximum: 1000
        default: 100
  securitySchemes:
    basic_auth:
      type: http
      scheme: basic
    jwt_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
    cookie_auth:
      type: apiKey
      in: cookie
      name: internal_auth_session
    oidc_auth:
      type: apiKey
      in: cookie
      name: oidc_auth_session
    saml_auth:
      type: apiKey
      in: cookie
      name: saml_auth_session