Apollo Config Items API

Configuration item management

OpenAPI Specification

apollo-config-items-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Apollo Config Open Apps Items API
  description: Apollo Open API for configuration management including app management, namespace management, configuration publishing, and release management. Apollo provides centralized configuration management for distributed systems with real-time push, versioning, and gray release support.
  version: 2.2.0
  contact:
    name: Apollo Config
    url: https://www.apolloconfig.com/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:8070
  description: Local Apollo Portal
- url: http://{portal_host}:{port}
  description: Custom Apollo Portal
  variables:
    portal_host:
      default: localhost
    port:
      default: '8070'
security:
- PortalToken: []
tags:
- name: Items
  description: Configuration item management
paths:
  /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items:
    get:
      operationId: listItems
      summary: List configuration items
      description: Returns all configuration items in a namespace.
      tags:
      - Items
      parameters:
      - $ref: '#/components/parameters/env'
      - $ref: '#/components/parameters/appId'
      - $ref: '#/components/parameters/clusterName'
      - $ref: '#/components/parameters/namespaceName'
      responses:
        '200':
          description: Configuration items
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Item'
    post:
      operationId: createItem
      summary: Create a configuration item
      description: Creates a new key-value configuration item in a namespace.
      tags:
      - Items
      parameters:
      - $ref: '#/components/parameters/env'
      - $ref: '#/components/parameters/appId'
      - $ref: '#/components/parameters/clusterName'
      - $ref: '#/components/parameters/namespaceName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - key
              - value
              - dataChangeCreatedBy
              properties:
                key:
                  type: string
                value:
                  type: string
                comment:
                  type: string
                dataChangeCreatedBy:
                  type: string
                  description: Created by user
      responses:
        '200':
          description: Item created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Item'
        '400':
          description: Item already exists
  /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key}:
    get:
      operationId: getItem
      summary: Get a configuration item
      tags:
      - Items
      parameters:
      - $ref: '#/components/parameters/env'
      - $ref: '#/components/parameters/appId'
      - $ref: '#/components/parameters/clusterName'
      - $ref: '#/components/parameters/namespaceName'
      - name: key
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Configuration item
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Item'
        '404':
          description: Item not found
    put:
      operationId: updateItem
      summary: Update a configuration item
      tags:
      - Items
      parameters:
      - $ref: '#/components/parameters/env'
      - $ref: '#/components/parameters/appId'
      - $ref: '#/components/parameters/clusterName'
      - $ref: '#/components/parameters/namespaceName'
      - name: key
        in: path
        required: true
        schema:
          type: string
      - name: createIfNotExists
        in: query
        schema:
          type: boolean
          default: false
        description: Create item if it does not exist
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - key
              - value
              - dataChangeLastModifiedBy
              properties:
                key:
                  type: string
                value:
                  type: string
                comment:
                  type: string
                dataChangeLastModifiedBy:
                  type: string
      responses:
        '200':
          description: Item updated
    delete:
      operationId: deleteItem
      summary: Delete a configuration item
      tags:
      - Items
      parameters:
      - $ref: '#/components/parameters/env'
      - $ref: '#/components/parameters/appId'
      - $ref: '#/components/parameters/clusterName'
      - $ref: '#/components/parameters/namespaceName'
      - name: key
        in: path
        required: true
        schema:
          type: string
      - name: operator
        in: query
        required: true
        schema:
          type: string
        description: Operator (user) performing the delete
      responses:
        '200':
          description: Item deleted
components:
  parameters:
    clusterName:
      name: clusterName
      in: path
      required: true
      schema:
        type: string
      description: Cluster name (default is 'default')
    env:
      name: env
      in: path
      required: true
      schema:
        type: string
      description: Environment (e.g., DEV, FAT, UAT, PRO)
    namespaceName:
      name: namespaceName
      in: path
      required: true
      schema:
        type: string
      description: Namespace name (default is 'application')
    appId:
      name: appId
      in: path
      required: true
      schema:
        type: string
      description: Application ID
  schemas:
    Item:
      type: object
      properties:
        id:
          type: integer
          format: int64
        namespaceId:
          type: integer
          format: int64
        key:
          type: string
        value:
          type: string
        comment:
          type: string
        lineNum:
          type: integer
        dataChangeCreatedBy:
          type: string
        dataChangeLastModifiedBy:
          type: string
        dataChangeCreatedTime:
          type: string
          format: date-time
        dataChangeLastModifiedTime:
          type: string
          format: date-time
  securitySchemes:
    PortalToken:
      type: apiKey
      name: Authorization
      in: header
      description: Apollo Portal open API token