openapi: 3.0.1 info: title: Aeron Cache HTTP API description: This API exposes endpoints to interact with Aeron Cache. termsOfService: https://www.github.com/bhf contact: name: Sanjeev url: https://www.sanjeev.pages.dev email: na@na.com license: name: MIT License url: https://choosealicense.com/licenses/mit/ version: '1.0' servers: - url: http://localhost:7070 description: Dev server paths: /api/v1/cache: post: tags: - CreateCache summary: Create a new cache description: Create a cache by specifying the cache Id in the request body operationId: createCache requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateRequest' required: true responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/CreateResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/cache/bulkops: post: tags: - BulkOps summary: Perform bulk cache operations description: Execute multiple cache operations in a single request. operationId: bulkOps requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkCacheOpsRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/BulkCacheOpsResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/cache/{cacheId}: get: tags: - GetCache summary: Get all items from a cache description: Get all items from the specified cache operationId: getCache parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/GetCacheResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - PutItem summary: Put an item into a cache description: Put an item on the specified key into the specified cache operationId: putItem parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache requestBody: content: application/json: schema: $ref: '#/components/schemas/PutItemRequest' required: true responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/PutItemResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - DeleteCache summary: Delete a cache description: Delete the cache specified by it's Id operationId: deleteCache parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/DeleteCacheResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' patch: tags: - ClearCache summary: Clear a cache description: Clear the cache specified by it's Id operationId: clearCache parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/ClearCacheResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/cache/timed/{cacheId}: post: tags: - PutItem summary: Put a timed item into a cache description: Put an item with a TTL on the specified key into the specified cache operationId: putTimedItem parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache requestBody: content: application/json: schema: $ref: '#/components/schemas/PutTimedItemRequest' required: true responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/PutItemResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/cache/{cacheId}/{key}: get: tags: - GetItem summary: Get an item from a cache description: Get an item by it's key from the specified cache operationId: getItem parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache - name: key in: path required: true schema: type: string description: The key of the item responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/GetItemResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - DeleteItem summary: Delete an item from a cache description: Delete an item by it's key from the specified cache operationId: deleteItem parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache - name: key in: path required: true schema: type: string description: The key of the item responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/DeleteItemResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' patch: tags: - PatchItem summary: Patch an item in a cache description: Deep-merge the supplied value into an existing item in the specified cache operationId: patchItem parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache - name: key in: path required: true schema: type: string description: The key of the item requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchItemRequest' required: true responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/PatchItemResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/cache/{cacheId}/{key}/cancel-removal: post: tags: - CancelItemRemoval summary: Cancel a scheduled removal of an item from a cache description: Cancel a previously scheduled TTL/expiry removal of an item in the specified cache operationId: cancelItemRemoval parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache - name: key in: path required: true schema: type: string description: The key of the item responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/CancelItemRemovalResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/near/cache/{cacheId}: get: tags: - GetNearCache summary: Get all items from the near cache description: >- Get all items from the specified cache, served from the local near cache. Only available when the HTTP interface is started with NEAR_CACHE_ENABLED=true. The first read of a cache subscribes to it so the local copy is kept warm; a miss falls back to the source cache. operationId: getNearCache parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/GetCacheResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - PrimeNearCache summary: Prime a near cache up front description: >- Prime the specified cache: subscribe to it (requesting a snapshot) so the local copy is warmed up front, before any read or hydrating subscription arrives. Only available when the HTTP interface is started with NEAR_CACHE_ENABLED=true. The snapshot populates the local copy asynchronously, so a SUCCESS response means priming was started, not that it is fully populated yet. Idempotent - priming a cache that is already warm succeeds with wasAlreadyWarm=true and does not re-subscribe. operationId: primeNearCache parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/PrimeNearCacheResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - StopNearCache summary: Stop near caching a cache description: >- Stop near caching the specified cache: drop the cluster subscription so updates stop flowing and remove the local copy. The source cache on the cluster is not affected. Idempotent - stopping a cache that is not currently warm succeeds with wasCached=false. operationId: stopNearCache parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/StopNearCacheResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/near/caches: get: tags: - GetNearCaches summary: List warm near caches description: >- List the caches currently held warm in the local near cache, with their local item counts. Only available when the HTTP interface is started with NEAR_CACHE_ENABLED=true. operationId: getNearCaches responses: '200': description: OK content: '*/*': schema: type: array items: $ref: '#/components/schemas/CacheDetails' /api/v1/near/cache/{cacheId}/{key}: get: tags: - GetNearItem summary: Get an item from the near cache description: >- Get an item by its key from the specified cache, served from the local near cache. Only available when the HTTP interface is started with NEAR_CACHE_ENABLED=true. A miss in the local near cache falls back to the source cache and populates the local copy. operationId: getNearItem parameters: - name: cacheId in: path required: true schema: type: string description: The ID of the cache - name: key in: path required: true schema: type: string description: The key of the item responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/GetItemResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/caches: get: tags: - GetCaches summary: Get all caches description: Get the details of all available caches operationId: getCaches responses: '200': description: OK content: '*/*': schema: type: array items: $ref: '#/components/schemas/CacheDetails' /api/v1/stats: get: tags: - Stats summary: Get cache status description: Get global stats from the Aeron cache operationId: getStats responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/CacheStatsResponse' /api/v1/timers: get: tags: - Timers summary: Get all pending timers description: Get all pending TTL removal timers across both caches and counter caches operationId: getTimers responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/GetTimersResponse' '400': description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ErrorResponse' /api/v1/shutdown: post: tags: - ClusterTools summary: Shutdown Cluster description: Shutdown the cluster operationId: shutdownCluster responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/ClusterToolsResponse' /api/v1/snapshot: post: tags: - ClusterTools summary: Take Snapshot description: Take a cluster snapshot operationId: takeSnapshot responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/ClusterToolsResponse' /api/v1/snapshot-and-purge: post: tags: - ClusterTools summary: Snapshot And Purge description: Take a cluster snapshot, wait for it to persist, then purge old log segments to reclaim disk operationId: snapshotAndPurge responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/RecordingPurgeResponse' /api/v1/snapshot-info: get: tags: - ClusterTools summary: Snapshot Info description: Latest cluster snapshot info and archive disk usage, for display in the UI operationId: getSnapshotInfo responses: '200': description: OK content: '*/*': schema: $ref: '#/components/schemas/SnapshotInfoResponse' /api/v1/aeron-counters: get: tags: - ClusterTools summary: Aeron media driver counters of every node description: >- The Aeron media driver counters scraped from each node's clustertools sidecar, with the gateway's cache mode and node count, for the UI observability dashboard. Unreachable nodes are reported with reachable=false. operationId: getAeronCounters responses: '200': description: OK content: '*/*': schema: type: object properties: mode: type: string enum: [CLUSTERED, EPHEMERAL] nodeCount: type: integer nodes: type: array items: type: object properties: host: type: string reachable: type: boolean counters: type: object /liveness/: get: tags: - Health summary: Liveness check description: Check if the application is live operationId: getLiveness responses: '200': description: OK content: '*/*': schema: type: string /readiness/: get: tags: - Health summary: Readiness check description: Check if the application is ready operationId: getReadiness responses: '200': description: OK content: '*/*': schema: type: string components: schemas: ErrorResponse: type: object properties: errorMsg: type: string example: 'Details about the error that occurred' helpMsg: type: string example: 'A user friendly help message' operationStatus: $ref: '#/components/schemas/CacheOperationStatus' CreateRequest: type: object properties: cacheId: type: string example: "SomeCacheID" CreateResponse: type: object properties: cacheId: type: string example: "CreatedCache" operationStatus: $ref: '#/components/schemas/CacheOperationStatus' GetCacheResponse: type: object properties: cacheId: type: string example: "CreatedCache" operationStatus: $ref: '#/components/schemas/CacheOperationStatus' items: type: array items: $ref: '#/components/schemas/CacheItem' CacheItem: type: object properties: key: type: string value: type: string GetTimersResponse: type: object properties: operationStatus: $ref: '#/components/schemas/CacheOperationStatus' timers: type: array items: $ref: '#/components/schemas/TimerInfo' TimerInfo: type: object properties: timerType: type: string enum: - CACHE - COUNTER example: "CACHE" cacheId: type: string example: "myCache" key: type: string example: "myKey" deadline: type: integer format: int64 description: The epoch time (millis) at which the removal is scheduled to fire. ClearCacheResponse: type: object properties: cacheId: type: string operationStatus: $ref: '#/components/schemas/CacheOperationStatus' CacheDetails: type: object properties: cacheId: type: string itemCount: type: integer format: int64 StopNearCacheResponse: type: object properties: cacheId: type: string example: "SomeCacheID" wasCached: type: boolean description: Whether a local near cache copy existed and was removed. operationStatus: $ref: '#/components/schemas/CacheOperationStatus' PrimeNearCacheResponse: type: object properties: cacheId: type: string example: "SomeCacheID" wasAlreadyWarm: type: boolean description: Whether the cache was already warm, in which case priming was a no-op. operationStatus: $ref: '#/components/schemas/CacheOperationStatus' CacheStatsResponse: type: object properties: totalOpsCount: type: integer format: int32 totalCachesCount: type: integer format: int32 totalItemsCount: type: integer format: int32 errorCount: type: integer format: int32 ClusterToolsResponse: type: object properties: tool: type: string clusterFolder: type: string exitCode: type: integer format: int32 RecordingPurgeResponse: type: object properties: success: type: boolean logRecordingId: type: integer format: int64 purgedToPosition: type: integer format: int64 reclaimedBytes: type: integer format: int64 archiveDirBytesAfter: type: integer format: int64 timestamp: type: integer format: int64 message: type: string SnapshotInfoResponse: type: object properties: snapshotPresent: type: boolean logPosition: type: integer format: int64 termBaseLogPosition: type: integer format: int64 timestamp: type: integer format: int64 recordingId: type: integer format: int64 snapshotCount: type: integer format: int32 archiveDirBytes: type: integer format: int64 lastPurge: $ref: '#/components/schemas/RecordingPurgeResponse' PutItemRequest: type: object properties: key: type: string example: 'SomeRandomKey' value: type: string example: 'SomeRandomValue' PutTimedItemRequest: type: object properties: key: type: string example: 'SomeRandomKey' value: type: string example: 'SomeRandomValue' ttl: type: integer format: int64 example: 60000 PutItemResponse: type: object properties: cacheId: type: string example: "SomeCacheID" key: type: string example: 'SomeRandomKey' operationStatus: $ref: '#/components/schemas/CacheOperationStatus' PatchItemRequest: type: object properties: value: type: string example: '{"field":"newValue"}' PatchItemResponse: type: object properties: cacheId: type: string example: "SomeCacheID" key: type: string example: 'SomeRandomKey' operationStatus: $ref: '#/components/schemas/CacheOperationStatus' DeleteCacheResponse: type: object properties: cacheId: type: string example: "SomeCacheID" operationStatus: $ref: '#/components/schemas/CacheOperationStatus' GetItemResponse: type: object properties: cacheId: type: string example: "SomeCacheID" key: type: string example: 'SomeRandomKey' value: type: string example: 'SomeRandomValue' operationStatus: $ref: '#/components/schemas/CacheOperationStatus' DeleteItemResponse: type: object properties: cacheId: type: string example: "SomeCacheID" key: type: string example: 'SomeRandomKey' operationStatus: $ref: '#/components/schemas/CacheOperationStatus' CancelItemRemovalResponse: type: object properties: cacheId: type: string example: "SomeCacheID" key: type: string example: 'SomeRandomKey' operationStatus: $ref: '#/components/schemas/CacheOperationStatus' BulkCacheOpsRequest: type: object properties: requestId: type: string operations: type: array items: $ref: '#/components/schemas/CacheOperationRequest' CacheOperationRequest: type: object properties: operationType: $ref: '#/components/schemas/BulkOperationType' ttl: type: integer format: int64 counterValue: type: integer format: int64 requestId: type: string cacheId: type: string key: type: string value: type: string BulkOperationType: type: string enum: - NONE - CREATE_CACHE - ADD_ITEM - REMOVE_ITEM - CLEAR_CACHE - GET_ITEM - DELETE_CACHE - PATCH_ITEM - CREATE_COUNTER_CACHE - ADD_COUNTER - REMOVE_COUNTER - CLEAR_COUNTER_CACHE - GET_COUNTER - DELETE_COUNTER_CACHE - INCREMENT_COUNTER - DECREMENT_COUNTER - SET_COUNTER - CANCEL_ITEM - CANCEL_COUNTER BulkCacheOpsResponse: type: object properties: requestId: type: string operationResponses: type: array items: $ref: '#/components/schemas/CacheOperationResponse' CacheOperationResponse: type: object properties: requestId: type: string status: $ref: '#/components/schemas/CacheOperationStatus' cacheId: type: string key: type: string value: type: string CacheOperationStatus: type: string enum: - NONE - SUCCESS - ERROR - UNKNOWN_CACHE - UNKNOWN_KEY - CACHE_EXISTS - DUPLICATE_SUBSCRIPTION - UNKNOWN_SUBSCRIPTION