GitLab CI/CD features API

Operations related to managing Flipper-based feature flags

OpenAPI Specification

gitlab-ci-features-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: GitLab access_requests features API
  version: v4
  description: Operations related to access requests
host: gitlab.com
produces:
- application/json
tags:
- name: features
  description: Operations related to managing Flipper-based feature flags
paths:
  /api/v4/features:
    get:
      summary: List all features
      description: Get a list of all persisted features, with its gate values.
      produces:
      - application/json
      responses:
        '200':
          description: List all features
          schema:
            type: array
            items:
              $ref: '#/definitions/API_Entities_Feature'
      tags:
      - features
      operationId: getApiV4Features
  /api/v4/features/definitions:
    get:
      summary: List all feature definitions
      description: Get a list of all feature definitions.
      produces:
      - application/json
      responses:
        '200':
          description: List all feature definitions
          schema:
            type: array
            items:
              $ref: '#/definitions/API_Entities_Feature_Definition'
      tags:
      - features
      operationId: getApiV4FeaturesDefinitions
  /api/v4/features/{name}:
    post:
      summary: Set or create a feature
      description: Set a feature's gate value. If a feature with the given name doesn't exist yet, it's created. The value can be a boolean, or an integer to indicate percentage of time.
      produces:
      - application/json
      consumes:
      - application/json
      parameters:
      - in: path
        name: name
        type: integer
        format: int32
        required: true
      - name: postApiV4FeaturesName
        in: body
        required: true
        schema:
          $ref: '#/definitions/postApiV4FeaturesName'
      responses:
        '201':
          description: Set or create a feature
          schema:
            $ref: '#/definitions/API_Entities_Feature'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      tags:
      - features
      operationId: postApiV4FeaturesName
    delete:
      summary: Delete a feature
      description: Removes a feature gate. Response is equal when the gate exists, or doesn't.
      produces:
      - application/json
      parameters:
      - in: path
        name: name
        type: integer
        format: int32
        required: true
      responses:
        '204':
          description: Delete a feature
      tags:
      - features
      operationId: deleteApiV4FeaturesName
definitions:
  API_Entities_Feature:
    type: object
    properties:
      name:
        type: string
        example: experimental_feature
      state:
        type: string
        example: 'off'
      gates:
        $ref: '#/definitions/API_Entities_FeatureGate'
      definition:
        $ref: '#/definitions/API_Entities_Feature_Definition'
    required:
    - name
    - state
    - gates
    - definition
    description: API_Entities_Feature model
  postApiV4FeaturesName:
    type: object
    properties:
      value:
        type: string
        description: '`true` or `false` to enable/disable, or an integer for percentage of time'
      key:
        type: string
        description: '`percentage_of_actors` or `percentage_of_time` (default)'
      feature_group:
        type: string
        description: A Feature group name
      user:
        type: string
        description: A GitLab username or comma-separated multiple usernames
      group:
        type: string
        description: A GitLab group's path, for example `gitlab-org`, or comma-separated multiple group paths
      namespace:
        type: string
        description: A GitLab group or user namespace's path, for example `john-doe`, or comma-separated multiple namespace paths. Introduced in GitLab 15.0.
      project:
        type: string
        description: A projects path, for example `gitlab-org/gitlab-foss`, or comma-separated multiple project paths
      repository:
        type: string
        description: A repository path, for example `gitlab-org/gitlab-test.git`, `gitlab-org/gitlab-test.wiki.git`, `snippets/21.git`, to name a few. Use comma to separate multiple repository paths
      runner:
        type: string
        description: A runner ID, or comma-separated list of runner IDs
      endpoint:
        type: string
        description: A caller_id identifying a code path, for example `GET /api/v4/projects/:id` or `ProjectsController#show`. Use comma to separate multiple endpoint paths
      force:
        type: boolean
        description: Skip feature flag validation checks, such as a YAML definition
    required:
    - value
    description: Set or create a feature
  API_Entities_Feature_Definition:
    type: object
    properties:
      name:
        type: string
      feature_issue_url:
        type: string
      introduced_by_url:
        type: string
      rollout_issue_url:
        type: string
      milestone:
        type: string
      log_state_changes:
        type: string
      type:
        type: string
      group:
        type: string
      default_enabled:
        type: string
      intended_to_rollout_by:
        type: string
    required:
    - name
    - feature_issue_url
    - introduced_by_url
    - rollout_issue_url
    - milestone
    - log_state_changes
    - type
    - group
    - default_enabled
    - intended_to_rollout_by
    description: API_Entities_Feature_Definition model
  API_Entities_FeatureGate:
    type: object
    properties:
      key:
        type: string
        example: percentage_of_actors
      value:
        type: integer
        format: int32
        example: 34
    required:
    - key
    - value
securityDefinitions:
  access_token_header:
    type: apiKey
    name: PRIVATE-TOKEN
    in: header
  access_token_query:
    type: apiKey
    name: private_token
    in: query