Nacos Operator API

Server operations and metrics

OpenAPI Specification

nacos-operator-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Nacos Open Auth Operator API
  description: Nacos Open API for service discovery, configuration management, and namespace management. Nacos supports dynamic service discovery, service configuration, service metadata, and traffic management.
  version: 2.3.0
  contact:
    name: Alibaba Nacos
    url: https://nacos.io/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:8848/nacos
  description: Local Nacos server
- url: http://{nacos_host}:{port}/nacos
  description: Custom Nacos server
  variables:
    nacos_host:
      default: localhost
    port:
      default: '8848'
security:
- AccessToken: []
tags:
- name: Operator
  description: Server operations and metrics
paths:
  /v1/ns/operator/switches:
    get:
      operationId: getSwitches
      summary: Get system switches
      description: Returns Nacos system switch values.
      tags:
      - Operator
      responses:
        '200':
          description: System switches
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  masters:
                    type: array
                    items:
                      type: string
                  adWeightMap:
                    type: object
                  defaultPushCacheMillis:
                    type: integer
                  clientBeatInterval:
                    type: integer
                  defaultCacheMillis:
                    type: integer
                  distroThreshold:
                    type: number
                  healthCheckEnabled:
                    type: boolean
                  autoChangeHealthCheckEnabled:
                    type: boolean
                  distroEnabled:
                    type: boolean
                  enableStandalone:
                    type: boolean
                  pushEnabled:
                    type: boolean
                  checkTimes:
                    type: integer
    put:
      operationId: updateSwitches
      summary: Update system switches
      description: Updates a Nacos system switch value.
      tags:
      - Operator
      parameters:
      - name: entry
        in: query
        required: true
        schema:
          type: string
        description: Switch entry key
      - name: value
        in: query
        required: true
        schema:
          type: string
        description: Switch entry value
      - name: debug
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: Switch updated
          content:
            text/plain:
              schema:
                type: string
  /v1/ns/operator/metrics:
    get:
      operationId: getMetrics
      summary: Get server metrics
      description: Returns current Nacos server metrics.
      tags:
      - Operator
      responses:
        '200':
          description: Server metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  serviceCount:
                    type: integer
                  instanceCount:
                    type: integer
                  subscribeCount:
                    type: integer
                  raftNotifyTaskCount:
                    type: integer
                  responsibleServiceCount:
                    type: integer
                  responsibleInstanceCount:
                    type: integer
                  cpu:
                    type: number
                  load:
                    type: number
                  mem:
                    type: number
  /v1/ns/operator/servers:
    get:
      operationId: listServers
      summary: List cluster servers
      description: Returns the list of Nacos cluster members.
      tags:
      - Operator
      parameters:
      - name: healthy
        in: query
        schema:
          type: boolean
        description: Filter by health status
      responses:
        '200':
          description: Cluster server list
          content:
            application/json:
              schema:
                type: object
                properties:
                  servers:
                    type: array
                    items:
                      type: object
                      properties:
                        ip:
                          type: string
                        port:
                          type: integer
                        state:
                          type: string
                        extendInfo:
                          type: object
                        address:
                          type: string
                        failAccessCnt:
                          type: integer
components:
  securitySchemes:
    AccessToken:
      type: apiKey
      name: accessToken
      in: query
      description: Access token obtained from login endpoint