Skip to content

Commit

Permalink
Chore: Clustering endpoints (#7935)
Browse files Browse the repository at this point in the history
* clustering endpoint

* cache endpoints

* Apply suggestions from code review

Co-authored-by: lena-larionova <[email protected]>

* caps

* missed one

* Apply suggestions from code review

Co-authored-by: lena-larionova <[email protected]>

---------

Co-authored-by: lena-larionova <[email protected]>
  • Loading branch information
Guaris and lena-larionova authored Sep 19, 2024
1 parent e97f390 commit 52acdf8
Show file tree
Hide file tree
Showing 6 changed files with 1,189 additions and 6 deletions.
200 changes: 199 additions & 1 deletion api-specs/Gateway-EE/3.6/kong-ee-3.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15192,6 +15192,198 @@ paths:
fips_disabled:
value: {"active": false, "version": "unknown"}
summary: FIPS mode is disabled or not supported. This may be the default state or result from a license configuration that does not enable FIPS mode.
'/clustering/data-planes':
get:
summary: Retrieve connected data planes
description: >
Retrieve a list of all data planes connected to the control plane. This endpoint is only accessible when Kong Gateway is running in hybrid mode.
operationId: getDataPlanes
responses:
'200':
description: A list of connected data planes.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
ip:
type: string
description: The IP address of the data plane.
updated_at:
type: integer
description: Unix timestamp of the last update.
config_hash:
type: string
description: The hash of the current configuration on the data plane.
sync_status:
type: string
description: The sync status of the data plane.
version:
type: string
description: The version of Kong running on the data plane.
id:
type: string
description: Unique identifier of the data plane.
hostname:
type: string
description: The hostname of the data plane.
ttl:
type: integer
description: Time-to-live for the connection.
last_seen:
type: integer
description: Unix timestamp when the data plane was last seen by the control plane.
labels:
type: object
description: Metadata labels attached to the data plane.
properties:
deployment:
type: string
description: The deployment name.
region:
type: string
description: The region of the data plane.
cert_details:
type: object
properties:
expiry_timestamp:
type: integer
description: Timestamp for when the certificate expires.
'400':
description: Kong is not running as a control plane.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: This endpoint is only available when Kong is configured to run as a control plane for the cluster.
tags:
- clustering

'/clustering/status':
get:
summary: Retrieve the status of connected data planes
description: >
Retrieve a status report for all data planes connected to the control plane. It includes information like the config hash, hostname, IP address, and last seen timestamp.
This endpoint is only accessible when Kong Gateway is running in hybrid mode.
operationId: getDataPlaneStatus
responses:
'200':
description: The status of all connected data planes.
headers:
Deprecation:
description: >
Indicates that the endpoint may be deprecated in the future.
schema:
type: string
content:
application/json:
schema:
type: object
additionalProperties:
type: object
properties:
config_hash:
type: string
description: Hash of the configuration running on the data plane.
hostname:
type: string
description: Hostname of the data plane.
ip:
type: string
description: The IP address of the data plane.
last_seen:
type: integer
description: Unix timestamp of the last interaction between the data plane and control plane.
'400':
description: Kong is not running as a control plane.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: This endpoint is only available when Kong is configured to run as a control plane for the cluster.
tags:
- clustering
'/cache/{key}':
get:
summary: Get cache value by key
description: >
Retrieve the cached value for a specific key. This endpoint probes both `kong.cache` and `kong.core_cache`.
If the key exists, it returns the associated value and TTL. If not found, it returns a 404.
operationId: getCacheByKey
parameters:
- name: key
in: path
required: true
description: The cache key to retrieve.
schema:
type: string
responses:
'200':
description: Cached value found.
content:
application/json:
schema:
type: object
properties:
ttl:
type: integer
description: Time-to-live (TTL) of the cached entry.
message:
type: string
description: Cached value or a message.
'404':
description: Cache key not found.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Not found
tags:
- cache
delete:
summary: Invalidate cache by key
description: >
Invalidate the cache for a specific key in both `kong.cache` and `kong.core_cache`.
operationId: deleteCacheByKey
parameters:
- name: key
in: path
required: true
description: The cache key to invalidate.
schema:
type: string
responses:
'204':
description: Cache invalidated successfully.
tags:
- cache

'/cache':
delete:
summary: Purge all cache entries
description: >
Purge all cache entries in both `kong.cache` and `kong.core_cache`.
operationId: purgeAllCache
responses:
'204':
description: All cache entries purged successfully.
tags:
- cache


servers:
- description: Default Admin API URL
Expand Down Expand Up @@ -15359,4 +15551,10 @@ tags:
<br><br>
Event hooks do not work with Konnect yet.
<br><br>
name: Event-hooks
name: Event-hooks
- description: |
Retrieve information about the status of data planes when Kong Gateway is running in hybrid mode.
name: clustering
- description: |
Querying and managing cache entries.
name: cache
Loading

0 comments on commit 52acdf8

Please sign in to comment.