Devtron K8s API

The K8s API from Devtron — 1 operation(s) for k8s.

OpenAPI Specification

devtron-k8s-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.0
  title: Devtron APIs Specs Applications K8s 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: K8s
paths:
  /k8s/resource/recommended:
    post:
      summary: Get Resource Recommendation for a particular resource
      description: This API will fetch resource recommendations for a specific Kubernetes resource
      operationId: GetResourceRecommendation
      security: []
      requestBody:
        description: A JSON object containing the details required to fetch cluster resource recommendations
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceRequestObject'
      responses:
        '200':
          description: Resource recommendation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceGetResponse'
      tags:
      - K8s
components:
  schemas:
    ManifestResponse:
      type: object
      required:
      - manifest
      properties:
        recommendedManifest:
          $ref: '#/components/schemas/K8sManifest'
        manifest:
          $ref: '#/components/schemas/K8sManifest'
    ResourceGetResponse:
      type: object
      properties:
        manifestResponse:
          $ref: '#/components/schemas/ManifestResponse'
        secretViewAccess:
          type: boolean
          description: Indicates whether a user can see obscured secret values or not. True if the user has permission, false otherwise.
          example: true
      required:
      - manifestResponse
      - secretViewAccess
    K8sRequestObject:
      type: object
      properties:
        resourceIdentifier:
          type: object
          properties:
            groupVersionKind:
              $ref: '#/components/schemas/GroupVersionKind'
            namespace:
              type: string
              description: Namespace of the resource.
              example: default
            name:
              type: string
              description: Name of the resource.
              example: my-deployment
          required:
          - name
          - groupVersionKind
        podLogsRequest:
          type: object
          properties:
            containerName:
              type: string
              description: Name of the container for which logs are requested.
              example: my-container
        patch:
          type: string
          description: JSON patch or strategic merge patch to apply to the resource.
          example: '[{"op": "replace", "path": "/spec/replicas", "value": 3}]'
    K8sManifest:
      type: object
      description: Kubernetes manifest of the resource
      additionalProperties: true
    GroupVersionKind:
      type: object
      properties:
        group:
          type: string
          description: Group of the API resource.
          example: apps
        version:
          type: string
          description: Version of the API resource.
          example: v1
        kind:
          type: string
          description: Kind of the API resource.
          example: Deployment
      required:
      - group
      - version
      - kind
    ResourceRequestObject:
      type: object
      properties:
        appId:
          type: string
          description: Application ID. Used when the request is context-specific to an application.
          example: my-app/env-1
        clusterId:
          type: number
          description: Cluster ID. Used when the request is for a direct cluster resource (appId is not supplied).
          example: 1
        k8sRequest:
          $ref: '#/components/schemas/K8sRequestObject'
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