Spring Cloud Routes API

The Routes API from Spring Cloud — 3 operation(s) for routes.

OpenAPI Specification

spring-cloud-routes-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Spring Cloud Gateway Actuator Filters Routes API
  description: Actuator endpoints exposed by Spring Cloud Gateway for managing routes, global filters, and route filters at runtime. These endpoints are available under the /actuator/gateway path.
  version: 4.1.0
  contact:
    name: Spring Cloud Team
    url: https://spring.io/projects/spring-cloud-gateway
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:8080/actuator/gateway
  description: Default Gateway Actuator base path
tags:
- name: Routes
paths:
  /routes:
    get:
      operationId: getRoutes
      summary: Spring Cloud List all gateway routes
      description: Returns all route definitions including predicates, filters, URI, order, and metadata
      tags:
      - Routes
      responses:
        '200':
          description: List of route definitions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RouteDefinition'
    post:
      operationId: createRoute
      summary: Spring Cloud Create a new route definition
      tags:
      - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouteDefinition'
      responses:
        '201':
          description: Route created
        '400':
          description: Invalid route definition
  /routes/{id}:
    get:
      operationId: getRoute
      summary: Spring Cloud Get a specific route definition
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Route definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteDefinition'
        '404':
          description: Route not found
    put:
      operationId: updateRoute
      summary: Spring Cloud Update a route definition
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouteDefinition'
      responses:
        '200':
          description: Route updated
    delete:
      operationId: deleteRoute
      summary: Spring Cloud Delete a route definition
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Route deleted
        '404':
          description: Route not found
  /refresh:
    post:
      operationId: refreshRoutes
      summary: Spring Cloud Refresh the routes cache
      description: Forces a refresh of the route definitions
      tags:
      - Routes
      responses:
        '200':
          description: Routes refreshed
components:
  schemas:
    RouteDefinition:
      type: object
      properties:
        id:
          type: string
          description: Unique route identifier
        uri:
          type: string
          description: Destination URI
        predicates:
          type: array
          items:
            $ref: '#/components/schemas/PredicateDefinition'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FilterDefinition'
        order:
          type: integer
          description: Route priority
        metadata:
          type: object
          additionalProperties: true
      required:
      - id
      - uri
      - predicates
    FilterDefinition:
      type: object
      properties:
        name:
          type: string
          description: Filter factory name
        args:
          type: object
          additionalProperties:
            type: string
          description: Filter arguments
    PredicateDefinition:
      type: object
      properties:
        name:
          type: string
          description: Predicate factory name
        args:
          type: object
          additionalProperties:
            type: string
          description: Predicate arguments