GitLab CI/CD commit_statuses API

Operations about commit_statuses

OpenAPI Specification

gitlab-ci-commit-statuses-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: GitLab access_requests commit_statuses API
  version: v4
  description: Operations related to access requests
host: gitlab.com
produces:
- application/json
tags:
- name: commit_statuses
  description: Operations about commit_statuses
paths:
  /api/v4/projects/{id}/repository/commits/{sha}/statuses:
    get:
      description: Get a commit's statuses
      produces:
      - application/json
      parameters:
      - in: path
        name: id
        description: ID or URL-encoded path of the project.
        type: string
        required: true
      - in: path
        name: sha
        description: Hash of the commit.
        type: string
        required: true
        example: 18f3e63d05582537db6d183d9d557be09e1f90c8
      - in: query
        name: ref
        description: Name of the branch or tag. Default is the default branch.
        type: string
        required: false
        example: develop
      - in: query
        name: stage
        description: Filter statuses by build stage.
        type: string
        required: false
        example: test
      - in: query
        name: name
        description: Filter statuses by job name.
        type: string
        required: false
        example: bundler:audit
      - in: query
        name: pipeline_id
        description: Filter statuses by pipeline ID.
        type: integer
        format: int32
        required: false
        example: 1234
      - in: query
        name: all
        description: Include all statuses instead of latest only. Default is `false`.
        type: boolean
        default: false
        required: false
      - in: query
        name: order_by
        description: Values for sorting statuses. Valid values are `id` and `pipeline_id`. Default is `id`.
        type: string
        default: id
        enum:
        - id
        - pipeline_id
        required: false
      - in: query
        name: sort
        description: Sort statuses in ascending or descending order. Valid values are `asc` and `desc`. Default is `asc`.
        type: string
        default: asc
        enum:
        - asc
        - desc
        required: false
      - in: query
        name: page
        description: Current page number
        type: integer
        format: int32
        default: 1
        required: false
        example: 1
      - in: query
        name: per_page
        description: Number of items per page
        type: integer
        format: int32
        default: 20
        required: false
        example: 20
      responses:
        '200':
          description: Get a commit's statuses
          schema:
            type: array
            items:
              $ref: '#/definitions/API_Entities_CommitStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
      tags:
      - commit_statuses
      operationId: getApiV4ProjectsIdRepositoryCommitsShaStatuses
  /api/v4/projects/{id}/statuses/{sha}:
    post:
      description: Post status to a commit
      produces:
      - application/json
      consumes:
      - application/json
      parameters:
      - in: path
        name: id
        description: ID or URL-encoded path of the project.
        type: string
        required: true
      - in: path
        name: sha
        description: The commit hash
        type: string
        required: true
        example: 18f3e63d05582537db6d183d9d557be09e1f90c8
      - name: postApiV4ProjectsIdStatusesSha
        in: body
        required: true
        schema:
          $ref: '#/definitions/postApiV4ProjectsIdStatusesSha'
      responses:
        '200':
          description: Post status to a commit
          schema:
            $ref: '#/definitions/API_Entities_CommitStatus'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Another update to this commit status is in progress
      tags:
      - commit_statuses
      operationId: postApiV4ProjectsIdStatusesSha
definitions:
  postApiV4ProjectsIdStatusesSha:
    type: object
    properties:
      state:
        type: string
        description: The state of the status
        enum:
        - pending
        - running
        - success
        - failed
        - canceled
        - skipped
        example: pending
      ref:
        type: string
        description: The ref
        example: develop
      target_url:
        type: string
        description: The target URL to associate with this status
        example: https://gitlab.example.com/janedoe/gitlab-foss/builds/91
      description:
        type: string
        description: A short description of the status
      name:
        type: string
        description: A string label to differentiate this status from the status of other systems
        default: default
        example: coverage
      context:
        type: string
        description: A string label to differentiate this status from the status of other systems
        default: default
        example: coverage
      coverage:
        type: number
        format: float
        description: The total code coverage
        example: 100.0
      pipeline_id:
        type: integer
        format: int32
        description: An existing pipeline ID, when multiple pipelines on the same commit SHA have been triggered
    required:
    - state
    description: Post status to a commit
  API_Entities_CustomAttribute:
    type: object
    properties:
      key:
        type: string
        example: foo
      value:
        type: string
        example: bar
    required:
    - key
    - value
    description: API_Entities_CustomAttribute model
  API_Entities_CommitStatus:
    type: object
    properties:
      id:
        type: integer
        format: int32
        example: 93
      sha:
        type: string
        example: 18f3e63d05582537db6d183d9d557be09e1f90c8
      ref:
        type: string
        example: develop
      status:
        type: string
        example: success
      name:
        type: string
        example: default
      target_url:
        type: string
        example: https://gitlab.example.com/janedoe/gitlab-foss/builds/91
      description:
        type: string
      created_at:
        type: string
        format: date-time
        example: '2016-01-19T09:05:50.355Z'
      started_at:
        type: string
        format: date-time
        example: '2016-01-20T08:40:25.832Z'
      finished_at:
        type: string
        format: date-time
        example: '2016-01-21T08:40:25.832Z'
      allow_failure:
        type: boolean
        example: false
      coverage:
        type: number
        format: float
        example: 98.29
      pipeline_id:
        type: integer
        format: int32
        example: 101
      author:
        $ref: '#/definitions/API_Entities_UserBasic'
    required:
    - id
    - sha
    - ref
    - status
    - name
    - target_url
    - description
    - created_at
    - started_at
    - finished_at
    - allow_failure
    - coverage
    - pipeline_id
    - author
    description: API_Entities_CommitStatus model
  API_Entities_UserBasic:
    type: object
    properties:
      id:
        type: integer
        format: int32
        example: 1
      username:
        type: string
        example: admin
      public_email:
        type: string
        example: john@example.com
      name:
        type: string
        example: Administrator
      state:
        type: string
        example: active
      locked:
        type: boolean
      avatar_url:
        type: string
        example: https://gravatar.com/avatar/1
      avatar_path:
        type: string
        example: /user/avatar/28/The-Big-Lebowski-400-400.png
      custom_attributes:
        type: array
        items:
          $ref: '#/definitions/API_Entities_CustomAttribute'
      web_url:
        type: string
        example: https://gitlab.example.com/root
    required:
    - id
    - username
    - public_email
    - name
    - state
    - locked
    - avatar_url
    - web_url
    description: API_Entities_UserBasic model
securityDefinitions:
  access_token_header:
    type: apiKey
    name: PRIVATE-TOKEN
    in: header
  access_token_query:
    type: apiKey
    name: private_token
    in: query