Devtron GitOps Validation API

The GitOps Validation API from Devtron — 2 operation(s) for gitops validation.

OpenAPI Specification

devtron-gitops-validation-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.0
  title: Devtron APIs Specs Applications GitOps Validation API
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  description: Application management operations including creation, listing, and updates
servers:
- url: http://localhost/orchestrator
  description: Local development server
tags:
- name: GitOps Validation
  x-displayName: GitOps Validation
paths:
  /validate:
    post:
      description: Validate gitops configuration by dry run
      summary: Validate gitops configuration by dry run
      security: []
      operationId: GitOpsValidateDryRun
      requestBody:
        description: A JSON object containing the gitops configuration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitOpsConfigDto'
      responses:
        '200':
          description: Successfully return all validation stages results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedError'
        '400':
          description: Bad Request. Input Validation error/wrong request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Unauthorized User
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - GitOps Validation
  /config:
    post:
      description: create/save new configuration and validate them before saving
      summary: create/save new configuration and validate them before saving
      security: []
      operationId: CreateGitOpsConfig
      requestBody:
        description: A JSON object containing the gitops configuration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitOpsConfigDto'
      responses:
        '200':
          description: Successfully return all validation stages results and if validation is correct then saves the configuration in the backend
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedError'
        '400':
          description: Bad Request. Input Validation error/wrong request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Unauthorized User
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - GitOps Validation
    put:
      description: update configuration and validate them before saving(if last validation is within 30 seconds then do not validate)
      summary: update configuration and validate them before saving(if last validation is within 30 seconds then do not validate)
      operationId: UpdateGitOpsConfig
      security: []
      requestBody:
        description: A JSON object containing the gitops configuration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitOpsConfigDto'
      responses:
        '200':
          description: Successfully return all validation stages results and if validation is correct then updates the configuration in the backend
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedError'
        '400':
          description: Bad Request. Input Validation error/wrong request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Unauthorized User
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - GitOps Validation
components:
  schemas:
    GitOpsConfigDto:
      type: object
      properties:
        id:
          type: integer
          description: GitOps Id (null for new configuration)
        provider:
          type: string
          description: Gitops provider
          example: github,gitlabs
        username:
          type: string
          description: Username of GitOps provider
        token:
          type: string
          description: Authentication token of GitOps provider
        gitLabGroupId:
          type: string
          description: Group Id of gitLab
        gitHubOrgId:
          type: string
          description: Group Id of gitHub
        host:
          type: string
          description: Host of GitOps provider
        active:
          type: boolean
        azureProjectName:
          type: string
          description: Project Name of Azure
        userId:
          type: integer
          description: User Id of GitOps provider
    Error:
      required:
      - code
      - message
      properties:
        code:
          type: integer
          description: Error code
        message:
          type: string
          description: Error message
    DetailedError:
      type: object
      properties:
        successfulStages:
          type: array
          items:
            type: string
          description: All successful stages
        validatedOn:
          type: string
          description: Timestamp of validation
        stageErrorMap:
          type: array
          items:
            type: object
            properties:
              stage:
                type: string
              error:
                type: string
          description: map of stage and their respective errors
x-tagGroups:
- name: Common Devtron automation APIs
  tags:
  - Metadata
  - Jobs
  - Helm Charts
  - List Applications
  - Applications
  - Labels
  - bulk_other
  - BulkUpdate
  - SSO Configuration
  - User Management
  - Role Group Management
  - RBAC
  - Authentication
  - Policy Management
  - Cache Management
  - Cluster Environment
  - Cluster Management
  - Environment Management
  - Change Chart
  - Clone Workflow
  - Deployment History
  - K8s Resource
  - Resource Recommendation
  - Workflow Management
  - Devtron Server version
  - GitOps Validation
  - Notifications