From db36e46090495294806f8de189333185c2e13f4b Mon Sep 17 00:00:00 2001 From: Cully Wakelin Date: Wed, 28 Aug 2024 09:05:39 -0600 Subject: [PATCH 1/3] testing out API reference --- api/bundled.yml | 739 +++++++++++++++++++++++++++++++++++++++ api/combined-openapi.yml | 393 +++++++++++++++++++++ api/redoc-static.html | 487 ++++++++++++++++++++++++++ 3 files changed, 1619 insertions(+) create mode 100644 api/bundled.yml create mode 100644 api/combined-openapi.yml create mode 100644 api/redoc-static.html diff --git a/api/bundled.yml b/api/bundled.yml new file mode 100644 index 00000000..8505c6e3 --- /dev/null +++ b/api/bundled.yml @@ -0,0 +1,739 @@ +openapi: 3.0.0 +info: + title: Combined API + description: API documentation for Promises, Tasks, Locks, and Schedules. + version: 1.0.0 + license: + name: MIT + url: https://opensource.org/licenses/MIT +servers: + - url: https://resonatehq.io + description: Website +security: [] +paths: + /promises: + /promises: + post: + tags: + - Promises + summary: Create a promise + operationId: createPromise + parameters: + - $ref: '#/components/parameters/RequestIdHeader' + - $ref: '#/components/parameters/IdempotencyKeyHeader' + - $ref: '#/components/parameters/StrictHeader' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePromiseReq' + responses: + '200': + description: Operation deduplicated, Promise fetched successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Promise' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Promise' + '400': + description: Invalid request + '403': + description: Forbidden request + '409': + description: Promise already exists + get: + tags: + - Promises + summary: Search promises + operationId: searchPromises + parameters: + - $ref: '#/components/parameters/RequestIdHeader' + - name: id + in: query + description: | + Search promises for matching IDs, can include wildcards. + + For example: + - "foo/*" matches all IDs starting with "foo/" + - "*/bar" matches all IDs starting with "bar/" + - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" + schema: + type: string + - name: state + in: query + description: Search promises for matching states + schema: + type: string + enum: + - pending + - resolved + - rejected + - name: tags + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: limit + in: query + description: Number of results + schema: + type: integer + - name: cursor + in: query + description: Cursor for pagination + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SearchPromisesResp' + '400': + description: Invalid request + /promises/{id}: + get: + tags: + - Promises + summary: Get a promise + operationId: getPromise + parameters: + - $ref: '#/components/parameters/IdPath' + - $ref: '#/components/parameters/RequestIdHeader' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Promise' + '400': + description: Invalid request + '404': + description: Promise not found + patch: + tags: + - Promises + summary: Complete a promise + parameters: + - $ref: '#/components/parameters/IdPath' + - $ref: '#/components/parameters/RequestIdHeader' + - $ref: '#/components/parameters/IdempotencyKeyHeader' + - $ref: '#/components/parameters/StrictHeader' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CompletePromiseReq' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Promise' + '400': + description: Invalid request + '403': + description: Forbidden request + '404': + description: Promise not found + /tasks: + /tasks/claim: + post: + tags: + - Tasks + summary: Claim a task + operationId: claimTask + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ClaimTaskReq' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Promise' + '409': + description: Task already claimed + /tasks/complete: + post: + tags: + - Tasks + summary: Complete a task + operationId: completeTask + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CompleteTaskReq' + responses: + '200': + description: successful operation + '409': + description: Task already completed + /locks: + /locks/acquire: + post: + summary: Acquire lock + description: Acquire a distributed lock + operationId: acquireLock + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lock' + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Lock' + /locks/heartbeat: + post: + summary: heartbeat + description: update heartbeat for all locks that match the processId + operationId: heartbeat + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HeartbeatRequest' + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/HeartbeatResponse' + /locks/release: + post: + summary: Release lock + description: Release a distributed lock + operationId: releaseLock + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReleaseLockRequest' + required: true + responses: + '200': + description: successful operation + /schedules: + /schedules: + post: + tags: + - Schedules + summary: Create a new schedule + operationdId: createSchedule + parameters: + - $ref: '#/components/parameters/RequestIdHeader' + - $ref: '#/components/parameters/IdempotencyKeyHeader' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + required: true + responses: + '200': + description: Operation deduplicated, Schedule fetched successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + '400': + description: Invalid request + '403': + description: Forbidden request + '409': + description: Schedule already exists + get: + tags: + - Schedules + summary: Search schedules + operationId: searchSchedules + parameters: + - $ref: '#/components/parameters/RequestIdHeader' + - name: id + in: query + description: | + Search schedules for matching IDs, can include wildcards. + + For example: + - "foo/*" matches all IDs starting with "foo/" + - "*/bar" matches all IDs starting with "bar/" + - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" + schema: + type: string + - name: tags + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: limit + in: query + description: Number of results + schema: + type: integer + - name: cursor + in: query + description: Cursor for pagination + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SearchSchedulesResp' + '400': + description: Invalid request + /schedules/{id}: + get: + tags: + - Schedules + summary: Get a schedule + operationdId: getSchedule + parameters: + - $ref: '#/components/parameters/IdPath' + - $ref: '#/components/parameters/RequestIdHeader' + responses: + '200': + description: Successfully retrieved the schedule + content: + application/json: + schema: + $ref: '#/components/schemas/Schedule' + '404': + description: Schedule not found + delete: + tags: + - Schedules + summary: Delete a schedule + operationdId: deleteSchedule + parameters: + - $ref: '#/components/parameters/IdPath' + - $ref: '#/components/parameters/RequestIdHeader' + responses: + '204': + description: Successfully deleted the schedule + '404': + description: Schedule not found +components: + schemas: + PromiseSchemas: + $ref: '#/components/schemas/schemas' + TaskSchemas: + $ref: '#/components/schemas/components-schemas' + LockSchemas: + $ref: '#/components/schemas/locks-openapi_components-schemas' + ScheduleSchemas: + $ref: '#/components/schemas/schedules-openapi_components-schemas' + schemas: + Promise: + type: object + required: + - id + - state + - timeout + - param + - value + - tags + properties: + id: + type: string + state: + $ref: '#/components/schemas/PromiseState' + param: + $ref: '#/components/schemas/PromiseValue' + value: + $ref: '#/components/schemas/PromiseValue' + timeout: + type: integer + format: int64 + idempotencyKeyForCreate: + type: string + readOnly: true + idempotencyKeyForComplete: + type: string + readOnly: true + tags: + type: object + additionalProperties: + type: string + createdOn: + type: integer + readOnly: true + completedOn: + type: integer + readOnly: true + PromiseState: + type: string + enum: + - PENDING + - RESOLVED + - REJECTED + - REJECTED_CANCELED + - REJECTED_TIMEDOUT + PromiseStateComplete: + type: string + enum: + - RESOLVED + - REJECTED + - REJECTED_CANCELED + PromiseValue: + type: object + required: + - headers + properties: + headers: + type: object + additionalProperties: + type: string + data: + type: string + CreatePromiseReq: + type: object + required: + - id + - timeout + properties: + id: + type: string + timeout: + type: integer + format: int64 + param: + $ref: '#/components/schemas/PromiseValue' + tags: + type: object + additionalProperties: + type: string + CompletePromiseReq: + type: object + required: + - state + properties: + state: + $ref: '#/components/schemas/PromiseStateComplete' + value: + $ref: '#/components/schemas/PromiseValue' + SearchPromisesResp: + type: object + properties: + cursor: + type: string + promises: + type: array + items: + $ref: '#/components/schemas/Promise' + components-schemas: + Promise: + type: object + required: + - id + - state + - timeout + - param + - value + - tags + properties: + id: + type: string + state: + $ref: '#/components/schemas/PromiseState' + param: + $ref: '#/components/schemas/PromiseValue' + value: + $ref: '#/components/schemas/PromiseValue' + timeout: + type: integer + format: int64 + idempotencyKeyForCreate: + type: string + readOnly: true + idempotencyKeyForComplete: + type: string + readOnly: true + tags: + type: object + additionalProperties: + type: string + createdOn: + type: integer + readOnly: true + completedOn: + type: integer + readOnly: true + PromiseState: + type: string + enum: + - PENDING + - RESOLVED + - REJECTED + - REJECTED_CANCELED + - REJECTED_TIMEDOUT + PromiseStateComplete: + type: string + enum: + - RESOLVED + - REJECTED + PromiseValue: + type: object + required: + - headers + properties: + headers: + type: object + additionalProperties: + type: string + data: + type: string + ClaimTaskReq: + type: object + properties: + taskId: + type: string + description: The ID of the task to claim + counter: + type: integer + description: The counter of the task to claim + processId: + type: string + executionId: + type: string + expiryInMilliseconds: + type: integer + format: int64 + required: + - taskId + - counter + - processId + - executionId + - expiryInMilliseconds + CompleteTaskReq: + type: object + properties: + taskId: + type: string + description: The ID of the task to complete + counter: + type: integer + description: The counter of the task to claim + executionId: + type: string + state: + $ref: '#/components/schemas/PromiseStateComplete' + value: + $ref: '#/components/schemas/PromiseValue' + required: + - taskId + - counter + - executionId + - state + - value + locks-openapi_components-schemas: + Lock: + type: object + properties: + resourceId: + type: string + processId: + type: string + executionId: + type: string + expiryInSeconds: + type: integer + format: int64 + expiresAt: + type: integer + format: int64 + readOnly: true + required: + - resourceId + - processId + - executionId + - expiryInSeconds + HeartbeatRequest: + type: object + properties: + processId: + type: string + required: + - processId + HeartbeatResponse: + type: object + properties: + locksAffected: + type: integer + format: int64 + ReleaseLockRequest: + type: object + properties: + resourceId: + type: string + executionId: + type: string + required: + - resourceId + - executionId + schedules-openapi_components-schemas: + Schedule: + type: object + required: + - id + - cron + - promiseId + - promiseTimeout + properties: + id: + type: string + description: + type: string + cron: + type: string + tags: + type: object + additionalProperties: + type: string + promiseId: + type: string + promiseTimeout: + type: integer + format: int64 + promiseParam: + $ref: '#/components/schemas/PromiseValue' + promiseTags: + type: object + additionalProperties: + type: string + lastRunTime: + type: integer + readOnly: true + format: int64 + nextRunTime: + type: integer + readOnly: true + format: int64 + idempotencyKey: + type: string + readOnly: true + createdOn: + type: integer + readOnly: true + format: int64 + PromiseValue: + type: object + required: + - headers + properties: + data: + type: string + headers: + type: object + additionalProperties: + type: string + SearchSchedulesResp: + type: object + properties: + cursor: + type: string + schedules: + type: array + items: + $ref: '#/components/schemas/Schedule' + parameters: + PromiseParameters: + $ref: '#/components/parameters/parameters' + TaskParameters: + $ref: ./tasks-openapi.yml#/components/parameters + LockParameters: + $ref: ./locks-openapi.yml#/components/parameters + ScheduleParameters: + $ref: '#/components/parameters/components-parameters' + parameters: + IdPath: + name: id + in: path + required: true + description: The promise ID + schema: + type: string + IdempotencyKeyHeader: + name: idempotency-key + in: header + description: Deduplicates multiple requests + schema: + type: string + StrictHeader: + name: strict + in: header + description: If true, deduplicates only when promise state matches the request + schema: + type: boolean + RequestIdHeader: + name: request-id + in: header + description: Unique ID for each request + schema: + type: string + components-parameters: + IdPath: + name: id + in: path + required: true + description: The schedule ID + schema: + type: string + IdempotencyKeyHeader: + name: idempotency-key + in: header + description: Deduplicates multiple requests + schema: + type: string + RequestIdHeader: + name: request-id + in: header + description: Unique ID for each request + schema: + type: string + securitySchemes: + PromiseSecuritySchemes: + $ref: ./promises-openapi.yml#/components/securitySchemes + TaskSecuritySchemes: + $ref: ./tasks-openapi.yml#/components/securitySchemes + LockSecuritySchemes: + $ref: ./locks-openapi.yml#/components/securitySchemes + ScheduleSecuritySchemes: + $ref: ./schedules-openapi.yml#/components/securitySchemes diff --git a/api/combined-openapi.yml b/api/combined-openapi.yml new file mode 100644 index 00000000..faec9cfd --- /dev/null +++ b/api/combined-openapi.yml @@ -0,0 +1,393 @@ +openapi: 3.0.0 +info: + title: Combined API + description: API documentation for Promises, Tasks, Locks, and Schedules. + version: 1.0.0 + license: + name: MIT + url: https://opensource.org/licenses/MIT +servers: + - url: https://resonatehq.io # Replace with your actual API base URL + description: Website +security: [] # Explicitly state no security is required globally +paths: + /promises: + post: + tags: + - Promises + summary: Create a promise + description: Create a promise + operationId: createPromise + parameters: + - $ref: "#/components/parameters/RequestIdHeader" + - $ref: "#/components/parameters/IdempotencyKeyHeader" + - $ref: "#/components/parameters/StrictHeader" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreatePromiseReq" + responses: + 200: + description: Operation deduplicated, Promise fetched successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 201: + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 400: + description: Invalid request + 403: + description: Forbidden request + 409: + description: Promise already exists + + get: + tags: + - Promises + summary: Search promises + description: Search promises + operationId: searchPromises + parameters: + - $ref: "#/components/parameters/RequestIdHeader" + - name: id + in: query + description: | + Search promises for matching IDs, can include wildcards. + + For example: + - "foo/*" matches all IDs starting with "foo/" + - "*/bar" matches all IDs starting with "bar/" + - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" + schema: + type: string + - name: state + in: query + description: Search promises for matching states + schema: + type: string + enum: + - pending + - resolved + - rejected + - name: tags + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: limit + in: query + description: Number of results + schema: + type: integer + - name: cursor + in: query + description: Cursor for pagination + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/SearchPromisesResp" + 400: + description: Invalid request + + /promises/{id}: + get: + tags: + - Promises + summary: Get a promise + description: Get a promise + operationId: getPromise + parameters: + - $ref: "#/components/parameters/IdPath" + - $ref: "#/components/parameters/RequestIdHeader" + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 400: + description: Invalid request + 404: + description: Promise not found + + patch: + tags: + - Promises + summary: Complete a promise + description: Complete a promise + operationId: completePromise + parameters: + - $ref: "#/components/parameters/IdPath" + - $ref: "#/components/parameters/RequestIdHeader" + - $ref: "#/components/parameters/IdempotencyKeyHeader" + - $ref: "#/components/parameters/StrictHeader" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CompletePromiseReq" + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 400: + description: Invalid request + 403: + description: Forbidden request + 404: + description: Promise not found + /locks/acquire: + post: + summary: Acquire lock + description: Acquire a distributed lock + operationId: acquireLock + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Lock" + required: true + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Lock" + + /locks/heartbeat: + post: + summary: heartbeat + description: update heartbeat for all locks that match the processId + operationId: heartbeat + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/HeartbeatRequest" + required: true + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/HeartbeatResponse" + + /locks/release: + post: + summary: Release lock + description: Release a distributed lock + operationId: releaseLock + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ReleaseLockRequest" + required: true + responses: + "200": + description: successful operation +components: + parameters: + # PATH PARAMETERS + IdPath: + name: id + in: path + required: true + description: The promise ID + schema: + type: string + + # HEADER PARAMETERS + IdempotencyKeyHeader: + name: idempotency-key + in: header + description: Deduplicates multiple requests + schema: + type: string + StrictHeader: + name: strict + in: header + description: If true, deduplicates only when promise state matches the request + schema: + type: boolean + RequestIdHeader: + name: request-id + in: header + description: Unique ID for each request + schema: + type: string + + schemas: + Promise: + type: object + required: + - id + - state + - timeout + - param + - value + - tags + properties: + id: + type: string + state: + $ref: "#/components/schemas/PromiseState" + param: + $ref: "#/components/schemas/PromiseValue" + value: + $ref: "#/components/schemas/PromiseValue" + timeout: + type: integer + format: int64 + idempotencyKeyForCreate: + type: string + readOnly: true + idempotencyKeyForComplete: + type: string + readOnly: true + tags: + type: object + additionalProperties: + type: string + createdOn: + type: integer + readOnly: true + completedOn: + type: integer + readOnly: true + + PromiseState: + type: string + enum: + - PENDING + - RESOLVED + - REJECTED + - REJECTED_CANCELED + - REJECTED_TIMEDOUT + + PromiseStateComplete: + type: string + enum: + - RESOLVED + - REJECTED + - REJECTED_CANCELED + + PromiseValue: + type: object + required: + - headers + properties: + headers: + type: object + additionalProperties: + type: string + data: + type: string + + CreatePromiseReq: + type: object + required: + - id + - timeout + properties: + id: + type: string + timeout: + type: integer + format: int64 + param: + $ref: "#/components/schemas/PromiseValue" + tags: + type: object + additionalProperties: + type: string + + CompletePromiseReq: + type: object + required: + - state + properties: + state: + $ref: "#/components/schemas/PromiseStateComplete" + value: + $ref: "#/components/schemas/PromiseValue" + + SearchPromisesResp: + type: object + properties: + cursor: + type: string + promises: + type: array + items: + $ref: "#/components/schemas/Promise" + + Lock: + type: object + properties: + resourceId: + type: string + processId: + type: string + executionId: + type: string + expiryInSeconds: + type: integer + format: int64 + expiresAt: + type: integer + format: int64 + readOnly: true + required: + - resourceId + - processId + - executionId + - expiryInSeconds + + HeartbeatRequest: + type: object + properties: + processId: + type: string + required: + - processId + + HeartbeatResponse: + type: object + properties: + locksAffected: + type: integer + format: int64 + + ReleaseLockRequest: + type: object + properties: + resourceId: + type: string + executionId: + type: string + required: + - resourceId + - executionId diff --git a/api/redoc-static.html b/api/redoc-static.html new file mode 100644 index 00000000..18162b58 --- /dev/null +++ b/api/redoc-static.html @@ -0,0 +1,487 @@ + + + + + + Combined API + + + + + + + + + +

Combined API (1.0.0)

Download OpenAPI specification:Download

License: MIT

API documentation for Promises, Tasks, Locks, and Schedules.

+

Promises

Create a promise

Create a promise

+
header Parameters
request-id
string

Unique ID for each request

+
idempotency-key
string

Deduplicates multiple requests

+
strict
boolean

If true, deduplicates only when promise state matches the request

+
Request Body schema: application/json
required
id
required
string
timeout
required
integer <int64>
object (PromiseValue)
object

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "timeout": 0,
  • "param": {
    },
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Search promises

Search promises

+
query Parameters
id
string

Search promises for matching IDs, can include wildcards.

+

For example:

+
    +
  • "foo/*" matches all IDs starting with "foo/"
  • +
  • "*/bar" matches all IDs starting with "bar/"
  • +
  • "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar"
  • +
+
state
string
Enum: "pending" "resolved" "rejected"

Search promises for matching states

+
object
limit
integer

Number of results

+
cursor
string

Cursor for pagination

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "cursor": "string",
  • "promises": [
    ]
}

Get a promise

Get a promise

+
path Parameters
id
required
string

The promise ID

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Complete a promise

Complete a promise

+
path Parameters
id
required
string

The promise ID

+
header Parameters
request-id
string

Unique ID for each request

+
idempotency-key
string

Deduplicates multiple requests

+
strict
boolean

If true, deduplicates only when promise state matches the request

+
Request Body schema: application/json
required
state
required
string (PromiseStateComplete)
Enum: "RESOLVED" "REJECTED" "REJECTED_CANCELED"
object (PromiseValue)

Responses

Request samples

Content type
application/json
{
  • "state": "RESOLVED",
  • "value": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Acquire lock

Acquire a distributed lock

+
Request Body schema: application/json
required
resourceId
required
string
processId
required
string
executionId
required
string
expiryInSeconds
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0
}

Response samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0,
  • "expiresAt": 0
}

heartbeat

update heartbeat for all locks that match the processId

+
Request Body schema: application/json
required
processId
required
string

Responses

Request samples

Content type
application/json
{
  • "processId": "string"
}

Response samples

Content type
application/json
{
  • "locksAffected": 0
}

Release lock

Release a distributed lock

+
Request Body schema: application/json
required
resourceId
required
string
executionId
required
string

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "executionId": "string"
}
+ + + + From 842a9066d9cf8ee30893f4c3b399198be67d2c1c Mon Sep 17 00:00:00 2001 From: Cully Wakelin Date: Wed, 28 Aug 2024 09:42:05 -0600 Subject: [PATCH 2/3] generate static api reference pages --- api/{bundled.yml => bundled-openapi.yml} | 351 +++++++++---------- api/bundled.html | 156 +++++++++ api/combined-openapi.yml | 394 +-------------------- api/locks.html | 364 +++++++++++++++++++ api/{redoc-static.html => promises.html} | 69 +--- api/schedules-openapi.yml | 6 +- api/schedules.html | 425 +++++++++++++++++++++++ api/tasks.html | 390 +++++++++++++++++++++ 8 files changed, 1537 insertions(+), 618 deletions(-) rename api/{bundled.yml => bundled-openapi.yml} (95%) create mode 100644 api/bundled.html create mode 100644 api/locks.html rename api/{redoc-static.html => promises.html} (50%) create mode 100644 api/schedules.html create mode 100644 api/tasks.html diff --git a/api/bundled.yml b/api/bundled-openapi.yml similarity index 95% rename from api/bundled.yml rename to api/bundled-openapi.yml index 8505c6e3..e1c38495 100644 --- a/api/bundled.yml +++ b/api/bundled-openapi.yml @@ -245,7 +245,7 @@ paths: tags: - Schedules summary: Create a new schedule - operationdId: createSchedule + operationId: createSchedule parameters: - $ref: '#/components/parameters/RequestIdHeader' - $ref: '#/components/parameters/IdempotencyKeyHeader' @@ -324,7 +324,7 @@ paths: tags: - Schedules summary: Get a schedule - operationdId: getSchedule + operationId: getSchedule parameters: - $ref: '#/components/parameters/IdPath' - $ref: '#/components/parameters/RequestIdHeader' @@ -341,7 +341,7 @@ paths: tags: - Schedules summary: Delete a schedule - operationdId: deleteSchedule + operationId: deleteSchedule parameters: - $ref: '#/components/parameters/IdPath' - $ref: '#/components/parameters/RequestIdHeader' @@ -351,15 +351,66 @@ paths: '404': description: Schedule not found components: + parameters: + PromiseParameters: + $ref: '#/components/parameters/parameters' + ScheduleParameters: + $ref: '#/components/parameters/components-parameters' + parameters: + IdPath: + name: id + in: path + required: true + description: The promise ID + schema: + type: string + IdempotencyKeyHeader: + name: idempotency-key + in: header + description: Deduplicates multiple requests + schema: + type: string + StrictHeader: + name: strict + in: header + description: If true, deduplicates only when promise state matches the request + schema: + type: boolean + RequestIdHeader: + name: request-id + in: header + description: Unique ID for each request + schema: + type: string + components-parameters: + IdPath: + name: id + in: path + required: true + description: The schedule ID + schema: + type: string + IdempotencyKeyHeader: + name: idempotency-key + in: header + description: Deduplicates multiple requests + schema: + type: string + RequestIdHeader: + name: request-id + in: header + description: Unique ID for each request + schema: + type: string schemas: - PromiseSchemas: + PromiseSchema: $ref: '#/components/schemas/schemas' - TaskSchemas: + ScheduleSchema: $ref: '#/components/schemas/components-schemas' - LockSchemas: + LockSchema: $ref: '#/components/schemas/locks-openapi_components-schemas' - ScheduleSchemas: - $ref: '#/components/schemas/schedules-openapi_components-schemas' + TaskSchema: + $ref: '#/components/schemas/tasks-openapi_components-schemas' schemas: Promise: type: object @@ -459,6 +510,116 @@ components: items: $ref: '#/components/schemas/Promise' components-schemas: + Schedule: + type: object + required: + - id + - cron + - promiseId + - promiseTimeout + properties: + id: + type: string + description: + type: string + cron: + type: string + tags: + type: object + additionalProperties: + type: string + promiseId: + type: string + promiseTimeout: + type: integer + format: int64 + promiseParam: + $ref: '#/components/schemas/PromiseValue' + promiseTags: + type: object + additionalProperties: + type: string + lastRunTime: + type: integer + readOnly: true + format: int64 + nextRunTime: + type: integer + readOnly: true + format: int64 + idempotencyKey: + type: string + readOnly: true + createdOn: + type: integer + readOnly: true + format: int64 + PromiseValue: + type: object + required: + - headers + properties: + data: + type: string + headers: + type: object + additionalProperties: + type: string + SearchSchedulesResp: + type: object + properties: + cursor: + type: string + schedules: + type: array + items: + $ref: '#/components/schemas/Schedule' + locks-openapi_components-schemas: + Lock: + type: object + properties: + resourceId: + type: string + processId: + type: string + executionId: + type: string + expiryInSeconds: + type: integer + format: int64 + expiresAt: + type: integer + format: int64 + readOnly: true + required: + - resourceId + - processId + - executionId + - expiryInSeconds + HeartbeatRequest: + type: object + properties: + processId: + type: string + required: + - processId + HeartbeatResponse: + type: object + properties: + locksAffected: + type: integer + format: int64 + ReleaseLockRequest: + type: object + properties: + resourceId: + type: string + executionId: + type: string + required: + - resourceId + - executionId + tasks-openapi_components-schemas: Promise: type: object required: @@ -563,177 +724,3 @@ components: - executionId - state - value - locks-openapi_components-schemas: - Lock: - type: object - properties: - resourceId: - type: string - processId: - type: string - executionId: - type: string - expiryInSeconds: - type: integer - format: int64 - expiresAt: - type: integer - format: int64 - readOnly: true - required: - - resourceId - - processId - - executionId - - expiryInSeconds - HeartbeatRequest: - type: object - properties: - processId: - type: string - required: - - processId - HeartbeatResponse: - type: object - properties: - locksAffected: - type: integer - format: int64 - ReleaseLockRequest: - type: object - properties: - resourceId: - type: string - executionId: - type: string - required: - - resourceId - - executionId - schedules-openapi_components-schemas: - Schedule: - type: object - required: - - id - - cron - - promiseId - - promiseTimeout - properties: - id: - type: string - description: - type: string - cron: - type: string - tags: - type: object - additionalProperties: - type: string - promiseId: - type: string - promiseTimeout: - type: integer - format: int64 - promiseParam: - $ref: '#/components/schemas/PromiseValue' - promiseTags: - type: object - additionalProperties: - type: string - lastRunTime: - type: integer - readOnly: true - format: int64 - nextRunTime: - type: integer - readOnly: true - format: int64 - idempotencyKey: - type: string - readOnly: true - createdOn: - type: integer - readOnly: true - format: int64 - PromiseValue: - type: object - required: - - headers - properties: - data: - type: string - headers: - type: object - additionalProperties: - type: string - SearchSchedulesResp: - type: object - properties: - cursor: - type: string - schedules: - type: array - items: - $ref: '#/components/schemas/Schedule' - parameters: - PromiseParameters: - $ref: '#/components/parameters/parameters' - TaskParameters: - $ref: ./tasks-openapi.yml#/components/parameters - LockParameters: - $ref: ./locks-openapi.yml#/components/parameters - ScheduleParameters: - $ref: '#/components/parameters/components-parameters' - parameters: - IdPath: - name: id - in: path - required: true - description: The promise ID - schema: - type: string - IdempotencyKeyHeader: - name: idempotency-key - in: header - description: Deduplicates multiple requests - schema: - type: string - StrictHeader: - name: strict - in: header - description: If true, deduplicates only when promise state matches the request - schema: - type: boolean - RequestIdHeader: - name: request-id - in: header - description: Unique ID for each request - schema: - type: string - components-parameters: - IdPath: - name: id - in: path - required: true - description: The schedule ID - schema: - type: string - IdempotencyKeyHeader: - name: idempotency-key - in: header - description: Deduplicates multiple requests - schema: - type: string - RequestIdHeader: - name: request-id - in: header - description: Unique ID for each request - schema: - type: string - securitySchemes: - PromiseSecuritySchemes: - $ref: ./promises-openapi.yml#/components/securitySchemes - TaskSecuritySchemes: - $ref: ./tasks-openapi.yml#/components/securitySchemes - LockSecuritySchemes: - $ref: ./locks-openapi.yml#/components/securitySchemes - ScheduleSecuritySchemes: - $ref: ./schedules-openapi.yml#/components/securitySchemes diff --git a/api/bundled.html b/api/bundled.html new file mode 100644 index 00000000..2d66f671 --- /dev/null +++ b/api/bundled.html @@ -0,0 +1,156 @@ + + + + + + Combined API + + + + + + + + + +

Combined API (1.0.0)

Download OpenAPI specification:Download

License: MIT

API documentation for Promises, Tasks, Locks, and Schedules.

+
+ + + + diff --git a/api/combined-openapi.yml b/api/combined-openapi.yml index faec9cfd..78f3ad91 100644 --- a/api/combined-openapi.yml +++ b/api/combined-openapi.yml @@ -12,382 +12,26 @@ servers: security: [] # Explicitly state no security is required globally paths: /promises: - post: - tags: - - Promises - summary: Create a promise - description: Create a promise - operationId: createPromise - parameters: - - $ref: "#/components/parameters/RequestIdHeader" - - $ref: "#/components/parameters/IdempotencyKeyHeader" - - $ref: "#/components/parameters/StrictHeader" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/CreatePromiseReq" - responses: - 200: - description: Operation deduplicated, Promise fetched successfully - content: - application/json: - schema: - $ref: "#/components/schemas/Promise" - 201: - description: Created - content: - application/json: - schema: - $ref: "#/components/schemas/Promise" - 400: - description: Invalid request - 403: - description: Forbidden request - 409: - description: Promise already exists + $ref: "./promises-openapi.yml#/paths" + /tasks: + $ref: "./tasks-openapi.yml#/paths" + /locks: + $ref: "./locks-openapi.yml#/paths" + /schedules: + $ref: "./schedules-openapi.yml#/paths" - get: - tags: - - Promises - summary: Search promises - description: Search promises - operationId: searchPromises - parameters: - - $ref: "#/components/parameters/RequestIdHeader" - - name: id - in: query - description: | - Search promises for matching IDs, can include wildcards. - - For example: - - "foo/*" matches all IDs starting with "foo/" - - "*/bar" matches all IDs starting with "bar/" - - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" - schema: - type: string - - name: state - in: query - description: Search promises for matching states - schema: - type: string - enum: - - pending - - resolved - - rejected - - name: tags - in: query - style: deepObject - explode: true - schema: - type: object - additionalProperties: - type: string - - name: limit - in: query - description: Number of results - schema: - type: integer - - name: cursor - in: query - description: Cursor for pagination - schema: - type: string - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/SearchPromisesResp" - 400: - description: Invalid request - - /promises/{id}: - get: - tags: - - Promises - summary: Get a promise - description: Get a promise - operationId: getPromise - parameters: - - $ref: "#/components/parameters/IdPath" - - $ref: "#/components/parameters/RequestIdHeader" - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/Promise" - 400: - description: Invalid request - 404: - description: Promise not found - - patch: - tags: - - Promises - summary: Complete a promise - description: Complete a promise - operationId: completePromise - parameters: - - $ref: "#/components/parameters/IdPath" - - $ref: "#/components/parameters/RequestIdHeader" - - $ref: "#/components/parameters/IdempotencyKeyHeader" - - $ref: "#/components/parameters/StrictHeader" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/CompletePromiseReq" - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/Promise" - 400: - description: Invalid request - 403: - description: Forbidden request - 404: - description: Promise not found - /locks/acquire: - post: - summary: Acquire lock - description: Acquire a distributed lock - operationId: acquireLock - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/Lock" - required: true - responses: - "200": - description: successful operation - content: - application/json: - schema: - $ref: "#/components/schemas/Lock" - - /locks/heartbeat: - post: - summary: heartbeat - description: update heartbeat for all locks that match the processId - operationId: heartbeat - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/HeartbeatRequest" - required: true - responses: - "200": - description: successful operation - content: - application/json: - schema: - $ref: "#/components/schemas/HeartbeatResponse" - - /locks/release: - post: - summary: Release lock - description: Release a distributed lock - operationId: releaseLock - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ReleaseLockRequest" - required: true - responses: - "200": - description: successful operation components: parameters: - # PATH PARAMETERS - IdPath: - name: id - in: path - required: true - description: The promise ID - schema: - type: string - - # HEADER PARAMETERS - IdempotencyKeyHeader: - name: idempotency-key - in: header - description: Deduplicates multiple requests - schema: - type: string - StrictHeader: - name: strict - in: header - description: If true, deduplicates only when promise state matches the request - schema: - type: boolean - RequestIdHeader: - name: request-id - in: header - description: Unique ID for each request - schema: - type: string - + PromiseParameters: + $ref: "./promises-openapi.yml#/components/parameters" + ScheduleParameters: + $ref: "./schedules-openapi.yml#/components/parameters" schemas: - Promise: - type: object - required: - - id - - state - - timeout - - param - - value - - tags - properties: - id: - type: string - state: - $ref: "#/components/schemas/PromiseState" - param: - $ref: "#/components/schemas/PromiseValue" - value: - $ref: "#/components/schemas/PromiseValue" - timeout: - type: integer - format: int64 - idempotencyKeyForCreate: - type: string - readOnly: true - idempotencyKeyForComplete: - type: string - readOnly: true - tags: - type: object - additionalProperties: - type: string - createdOn: - type: integer - readOnly: true - completedOn: - type: integer - readOnly: true - - PromiseState: - type: string - enum: - - PENDING - - RESOLVED - - REJECTED - - REJECTED_CANCELED - - REJECTED_TIMEDOUT - - PromiseStateComplete: - type: string - enum: - - RESOLVED - - REJECTED - - REJECTED_CANCELED - - PromiseValue: - type: object - required: - - headers - properties: - headers: - type: object - additionalProperties: - type: string - data: - type: string - - CreatePromiseReq: - type: object - required: - - id - - timeout - properties: - id: - type: string - timeout: - type: integer - format: int64 - param: - $ref: "#/components/schemas/PromiseValue" - tags: - type: object - additionalProperties: - type: string - - CompletePromiseReq: - type: object - required: - - state - properties: - state: - $ref: "#/components/schemas/PromiseStateComplete" - value: - $ref: "#/components/schemas/PromiseValue" - - SearchPromisesResp: - type: object - properties: - cursor: - type: string - promises: - type: array - items: - $ref: "#/components/schemas/Promise" - - Lock: - type: object - properties: - resourceId: - type: string - processId: - type: string - executionId: - type: string - expiryInSeconds: - type: integer - format: int64 - expiresAt: - type: integer - format: int64 - readOnly: true - required: - - resourceId - - processId - - executionId - - expiryInSeconds - - HeartbeatRequest: - type: object - properties: - processId: - type: string - required: - - processId - - HeartbeatResponse: - type: object - properties: - locksAffected: - type: integer - format: int64 - - ReleaseLockRequest: - type: object - properties: - resourceId: - type: string - executionId: - type: string - required: - - resourceId - - executionId + PromiseSchema: + $ref: "./promises-openapi.yml#/components/schemas" + ScheduleSchema: + $ref: "./schedules-openapi.yml#/components/schemas" + LockSchema: + $ref: "./locks-openapi.yml#/components/schemas" + TaskSchema: + $ref: "./tasks-openapi.yml#/components/schemas" diff --git a/api/locks.html b/api/locks.html new file mode 100644 index 00000000..5681de96 --- /dev/null +++ b/api/locks.html @@ -0,0 +1,364 @@ + + + + + + Distributed Lock API + + + + + + + + + +

Distributed Lock API (1.0.0)

Download OpenAPI specification:Download

Manage Distributed Locks

+

Acquire lock

Acquire a distributed lock

+
Request Body schema: application/json
required
resourceId
required
string
processId
required
string
executionId
required
string
expiryInSeconds
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0
}

Response samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0,
  • "expiresAt": 0
}

heartbeat

update heartbeat for all locks that match the processId

+
Request Body schema: application/json
required
processId
required
string

Responses

Request samples

Content type
application/json
{
  • "processId": "string"
}

Response samples

Content type
application/json
{
  • "locksAffected": 0
}

Release lock

Release a distributed lock

+
Request Body schema: application/json
required
resourceId
required
string
executionId
required
string

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "executionId": "string"
}
+ + + + diff --git a/api/redoc-static.html b/api/promises.html similarity index 50% rename from api/redoc-static.html rename to api/promises.html index 18162b58..a83b6c31 100644 --- a/api/redoc-static.html +++ b/api/promises.html @@ -3,7 +3,7 @@ - Combined API + Promise API + + + + + + +

Schedules API (1.0.0)

Download OpenAPI specification:Download

Schedules

Create a new schedule

header Parameters
request-id
string

Unique ID for each request

+
idempotency-key
string

Deduplicates multiple requests

+
Request Body schema: application/json
required
id
required
string
description
string
cron
required
string
object
promiseId
required
string
promiseTimeout
required
integer <int64>
object (PromiseValue)
object

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    },
  • "lastRunTime": 0,
  • "nextRunTime": 0,
  • "idempotencyKey": "string",
  • "createdOn": 0
}

Search schedules

query Parameters
id
string

Search schedules for matching IDs, can include wildcards.

+

For example:

+
    +
  • "foo/*" matches all IDs starting with "foo/"
  • +
  • "*/bar" matches all IDs starting with "bar/"
  • +
  • "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar"
  • +
+
object
limit
integer

Number of results

+
cursor
string

Cursor for pagination

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "cursor": "string",
  • "schedules": [
    ]
}

Get a schedule

path Parameters
id
required
string

The schedule ID

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    },
  • "lastRunTime": 0,
  • "nextRunTime": 0,
  • "idempotencyKey": "string",
  • "createdOn": 0
}

Delete a schedule

path Parameters
id
required
string

The schedule ID

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

+ + + + diff --git a/api/tasks.html b/api/tasks.html new file mode 100644 index 00000000..e771a93d --- /dev/null +++ b/api/tasks.html @@ -0,0 +1,390 @@ + + + + + + Tasks API + + + + + + + + + +

Tasks API (1.0.0)

Download OpenAPI specification:Download

Manage Tasks

+

Tasks

Claim a task

Request Body schema: application/json
required
taskId
required
string

The ID of the task to claim

+
counter
required
integer

The counter of the task to claim

+
processId
required
string
executionId
required
string
expiryInMilliseconds
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "taskId": "string",
  • "counter": 0,
  • "processId": "string",
  • "executionId": "string",
  • "expiryInMilliseconds": 0
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Complete a task

Request Body schema: application/json
required
taskId
required
string

The ID of the task to complete

+
counter
required
integer

The counter of the task to claim

+
executionId
required
string
state
required
string (PromiseStateComplete)
Enum: "RESOLVED" "REJECTED"
required
object (PromiseValue)

Responses

Request samples

Content type
application/json
{
  • "taskId": "string",
  • "counter": 0,
  • "executionId": "string",
  • "state": "RESOLVED",
  • "value": {
    }
}
+ + + + From 73156127a4dfb9002e6b5d08c93dc57999421cf0 Mon Sep 17 00:00:00 2001 From: Cully Wakelin Date: Wed, 28 Aug 2024 12:21:12 -0600 Subject: [PATCH 3/3] combined file, updated to pass linter --- api/bundled-openapi.yml | 726 -------------------------------------- api/bundled.html | 156 -------- api/combined-openapi.yml | 605 +++++++++++++++++++++++++++++-- api/combined.html | 558 +++++++++++++++++++++++++++++ api/locks-openapi.yml | 54 +++ api/locks.html | 364 ------------------- api/promises-openapi.yml | 8 + api/promises.html | 440 ----------------------- api/schedules-openapi.yml | 7 + api/schedules.html | 425 ---------------------- api/tasks.html | 390 -------------------- 11 files changed, 1212 insertions(+), 2521 deletions(-) delete mode 100644 api/bundled-openapi.yml delete mode 100644 api/bundled.html create mode 100644 api/combined.html delete mode 100644 api/locks.html delete mode 100644 api/promises.html delete mode 100644 api/schedules.html delete mode 100644 api/tasks.html diff --git a/api/bundled-openapi.yml b/api/bundled-openapi.yml deleted file mode 100644 index e1c38495..00000000 --- a/api/bundled-openapi.yml +++ /dev/null @@ -1,726 +0,0 @@ -openapi: 3.0.0 -info: - title: Combined API - description: API documentation for Promises, Tasks, Locks, and Schedules. - version: 1.0.0 - license: - name: MIT - url: https://opensource.org/licenses/MIT -servers: - - url: https://resonatehq.io - description: Website -security: [] -paths: - /promises: - /promises: - post: - tags: - - Promises - summary: Create a promise - operationId: createPromise - parameters: - - $ref: '#/components/parameters/RequestIdHeader' - - $ref: '#/components/parameters/IdempotencyKeyHeader' - - $ref: '#/components/parameters/StrictHeader' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePromiseReq' - responses: - '200': - description: Operation deduplicated, Promise fetched successfully - content: - application/json: - schema: - $ref: '#/components/schemas/Promise' - '201': - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/Promise' - '400': - description: Invalid request - '403': - description: Forbidden request - '409': - description: Promise already exists - get: - tags: - - Promises - summary: Search promises - operationId: searchPromises - parameters: - - $ref: '#/components/parameters/RequestIdHeader' - - name: id - in: query - description: | - Search promises for matching IDs, can include wildcards. - - For example: - - "foo/*" matches all IDs starting with "foo/" - - "*/bar" matches all IDs starting with "bar/" - - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" - schema: - type: string - - name: state - in: query - description: Search promises for matching states - schema: - type: string - enum: - - pending - - resolved - - rejected - - name: tags - in: query - style: deepObject - explode: true - schema: - type: object - additionalProperties: - type: string - - name: limit - in: query - description: Number of results - schema: - type: integer - - name: cursor - in: query - description: Cursor for pagination - schema: - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SearchPromisesResp' - '400': - description: Invalid request - /promises/{id}: - get: - tags: - - Promises - summary: Get a promise - operationId: getPromise - parameters: - - $ref: '#/components/parameters/IdPath' - - $ref: '#/components/parameters/RequestIdHeader' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Promise' - '400': - description: Invalid request - '404': - description: Promise not found - patch: - tags: - - Promises - summary: Complete a promise - parameters: - - $ref: '#/components/parameters/IdPath' - - $ref: '#/components/parameters/RequestIdHeader' - - $ref: '#/components/parameters/IdempotencyKeyHeader' - - $ref: '#/components/parameters/StrictHeader' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CompletePromiseReq' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Promise' - '400': - description: Invalid request - '403': - description: Forbidden request - '404': - description: Promise not found - /tasks: - /tasks/claim: - post: - tags: - - Tasks - summary: Claim a task - operationId: claimTask - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ClaimTaskReq' - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Promise' - '409': - description: Task already claimed - /tasks/complete: - post: - tags: - - Tasks - summary: Complete a task - operationId: completeTask - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CompleteTaskReq' - responses: - '200': - description: successful operation - '409': - description: Task already completed - /locks: - /locks/acquire: - post: - summary: Acquire lock - description: Acquire a distributed lock - operationId: acquireLock - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Lock' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Lock' - /locks/heartbeat: - post: - summary: heartbeat - description: update heartbeat for all locks that match the processId - operationId: heartbeat - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/HeartbeatRequest' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/HeartbeatResponse' - /locks/release: - post: - summary: Release lock - description: Release a distributed lock - operationId: releaseLock - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ReleaseLockRequest' - required: true - responses: - '200': - description: successful operation - /schedules: - /schedules: - post: - tags: - - Schedules - summary: Create a new schedule - operationId: createSchedule - parameters: - - $ref: '#/components/parameters/RequestIdHeader' - - $ref: '#/components/parameters/IdempotencyKeyHeader' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Schedule' - required: true - responses: - '200': - description: Operation deduplicated, Schedule fetched successfully - content: - application/json: - schema: - $ref: '#/components/schemas/Schedule' - '201': - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/Schedule' - '400': - description: Invalid request - '403': - description: Forbidden request - '409': - description: Schedule already exists - get: - tags: - - Schedules - summary: Search schedules - operationId: searchSchedules - parameters: - - $ref: '#/components/parameters/RequestIdHeader' - - name: id - in: query - description: | - Search schedules for matching IDs, can include wildcards. - - For example: - - "foo/*" matches all IDs starting with "foo/" - - "*/bar" matches all IDs starting with "bar/" - - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" - schema: - type: string - - name: tags - in: query - style: deepObject - explode: true - schema: - type: object - additionalProperties: - type: string - - name: limit - in: query - description: Number of results - schema: - type: integer - - name: cursor - in: query - description: Cursor for pagination - schema: - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SearchSchedulesResp' - '400': - description: Invalid request - /schedules/{id}: - get: - tags: - - Schedules - summary: Get a schedule - operationId: getSchedule - parameters: - - $ref: '#/components/parameters/IdPath' - - $ref: '#/components/parameters/RequestIdHeader' - responses: - '200': - description: Successfully retrieved the schedule - content: - application/json: - schema: - $ref: '#/components/schemas/Schedule' - '404': - description: Schedule not found - delete: - tags: - - Schedules - summary: Delete a schedule - operationId: deleteSchedule - parameters: - - $ref: '#/components/parameters/IdPath' - - $ref: '#/components/parameters/RequestIdHeader' - responses: - '204': - description: Successfully deleted the schedule - '404': - description: Schedule not found -components: - parameters: - PromiseParameters: - $ref: '#/components/parameters/parameters' - ScheduleParameters: - $ref: '#/components/parameters/components-parameters' - parameters: - IdPath: - name: id - in: path - required: true - description: The promise ID - schema: - type: string - IdempotencyKeyHeader: - name: idempotency-key - in: header - description: Deduplicates multiple requests - schema: - type: string - StrictHeader: - name: strict - in: header - description: If true, deduplicates only when promise state matches the request - schema: - type: boolean - RequestIdHeader: - name: request-id - in: header - description: Unique ID for each request - schema: - type: string - components-parameters: - IdPath: - name: id - in: path - required: true - description: The schedule ID - schema: - type: string - IdempotencyKeyHeader: - name: idempotency-key - in: header - description: Deduplicates multiple requests - schema: - type: string - RequestIdHeader: - name: request-id - in: header - description: Unique ID for each request - schema: - type: string - schemas: - PromiseSchema: - $ref: '#/components/schemas/schemas' - ScheduleSchema: - $ref: '#/components/schemas/components-schemas' - LockSchema: - $ref: '#/components/schemas/locks-openapi_components-schemas' - TaskSchema: - $ref: '#/components/schemas/tasks-openapi_components-schemas' - schemas: - Promise: - type: object - required: - - id - - state - - timeout - - param - - value - - tags - properties: - id: - type: string - state: - $ref: '#/components/schemas/PromiseState' - param: - $ref: '#/components/schemas/PromiseValue' - value: - $ref: '#/components/schemas/PromiseValue' - timeout: - type: integer - format: int64 - idempotencyKeyForCreate: - type: string - readOnly: true - idempotencyKeyForComplete: - type: string - readOnly: true - tags: - type: object - additionalProperties: - type: string - createdOn: - type: integer - readOnly: true - completedOn: - type: integer - readOnly: true - PromiseState: - type: string - enum: - - PENDING - - RESOLVED - - REJECTED - - REJECTED_CANCELED - - REJECTED_TIMEDOUT - PromiseStateComplete: - type: string - enum: - - RESOLVED - - REJECTED - - REJECTED_CANCELED - PromiseValue: - type: object - required: - - headers - properties: - headers: - type: object - additionalProperties: - type: string - data: - type: string - CreatePromiseReq: - type: object - required: - - id - - timeout - properties: - id: - type: string - timeout: - type: integer - format: int64 - param: - $ref: '#/components/schemas/PromiseValue' - tags: - type: object - additionalProperties: - type: string - CompletePromiseReq: - type: object - required: - - state - properties: - state: - $ref: '#/components/schemas/PromiseStateComplete' - value: - $ref: '#/components/schemas/PromiseValue' - SearchPromisesResp: - type: object - properties: - cursor: - type: string - promises: - type: array - items: - $ref: '#/components/schemas/Promise' - components-schemas: - Schedule: - type: object - required: - - id - - cron - - promiseId - - promiseTimeout - properties: - id: - type: string - description: - type: string - cron: - type: string - tags: - type: object - additionalProperties: - type: string - promiseId: - type: string - promiseTimeout: - type: integer - format: int64 - promiseParam: - $ref: '#/components/schemas/PromiseValue' - promiseTags: - type: object - additionalProperties: - type: string - lastRunTime: - type: integer - readOnly: true - format: int64 - nextRunTime: - type: integer - readOnly: true - format: int64 - idempotencyKey: - type: string - readOnly: true - createdOn: - type: integer - readOnly: true - format: int64 - PromiseValue: - type: object - required: - - headers - properties: - data: - type: string - headers: - type: object - additionalProperties: - type: string - SearchSchedulesResp: - type: object - properties: - cursor: - type: string - schedules: - type: array - items: - $ref: '#/components/schemas/Schedule' - locks-openapi_components-schemas: - Lock: - type: object - properties: - resourceId: - type: string - processId: - type: string - executionId: - type: string - expiryInSeconds: - type: integer - format: int64 - expiresAt: - type: integer - format: int64 - readOnly: true - required: - - resourceId - - processId - - executionId - - expiryInSeconds - HeartbeatRequest: - type: object - properties: - processId: - type: string - required: - - processId - HeartbeatResponse: - type: object - properties: - locksAffected: - type: integer - format: int64 - ReleaseLockRequest: - type: object - properties: - resourceId: - type: string - executionId: - type: string - required: - - resourceId - - executionId - tasks-openapi_components-schemas: - Promise: - type: object - required: - - id - - state - - timeout - - param - - value - - tags - properties: - id: - type: string - state: - $ref: '#/components/schemas/PromiseState' - param: - $ref: '#/components/schemas/PromiseValue' - value: - $ref: '#/components/schemas/PromiseValue' - timeout: - type: integer - format: int64 - idempotencyKeyForCreate: - type: string - readOnly: true - idempotencyKeyForComplete: - type: string - readOnly: true - tags: - type: object - additionalProperties: - type: string - createdOn: - type: integer - readOnly: true - completedOn: - type: integer - readOnly: true - PromiseState: - type: string - enum: - - PENDING - - RESOLVED - - REJECTED - - REJECTED_CANCELED - - REJECTED_TIMEDOUT - PromiseStateComplete: - type: string - enum: - - RESOLVED - - REJECTED - PromiseValue: - type: object - required: - - headers - properties: - headers: - type: object - additionalProperties: - type: string - data: - type: string - ClaimTaskReq: - type: object - properties: - taskId: - type: string - description: The ID of the task to claim - counter: - type: integer - description: The counter of the task to claim - processId: - type: string - executionId: - type: string - expiryInMilliseconds: - type: integer - format: int64 - required: - - taskId - - counter - - processId - - executionId - - expiryInMilliseconds - CompleteTaskReq: - type: object - properties: - taskId: - type: string - description: The ID of the task to complete - counter: - type: integer - description: The counter of the task to claim - executionId: - type: string - state: - $ref: '#/components/schemas/PromiseStateComplete' - value: - $ref: '#/components/schemas/PromiseValue' - required: - - taskId - - counter - - executionId - - state - - value diff --git a/api/bundled.html b/api/bundled.html deleted file mode 100644 index 2d66f671..00000000 --- a/api/bundled.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - Combined API - - - - - - - - - -

Combined API (1.0.0)

Download OpenAPI specification:Download

License: MIT

API documentation for Promises, Tasks, Locks, and Schedules.

-
- - - - diff --git a/api/combined-openapi.yml b/api/combined-openapi.yml index 78f3ad91..99f06458 100644 --- a/api/combined-openapi.yml +++ b/api/combined-openapi.yml @@ -4,34 +4,599 @@ info: description: API documentation for Promises, Tasks, Locks, and Schedules. version: 1.0.0 license: - name: MIT - url: https://opensource.org/licenses/MIT + name: Apache 2.0 + url: https://opensource.org/license/apache-2-0 servers: - url: https://resonatehq.io # Replace with your actual API base URL description: Website security: [] # Explicitly state no security is required globally paths: /promises: - $ref: "./promises-openapi.yml#/paths" - /tasks: - $ref: "./tasks-openapi.yml#/paths" - /locks: - $ref: "./locks-openapi.yml#/paths" + post: + tags: + - Promises + summary: Create a promise + operationId: createPromise + parameters: + - $ref: "#/components/parameters/RequestIdHeader" + - $ref: "#/components/parameters/IdempotencyKeyHeader" + - $ref: "#/components/parameters/StrictHeader" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreatePromiseReq" + responses: + 200: + description: Operation deduplicated, Promise fetched successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 201: + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 400: + description: Invalid request + 403: + description: Forbidden request + 409: + description: Promise already exists + + get: + tags: + - Promises + summary: Search promises + operationId: searchPromises + parameters: + - $ref: "#/components/parameters/RequestIdHeader" + - name: id + in: query + description: | + Search promises for matching IDs, can include wildcards. + + For example: + - "foo/*" matches all IDs starting with "foo/" + - "*/bar" matches all IDs starting with "bar/" + - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" + schema: + type: string + - name: state + in: query + description: Search promises for matching states + schema: + type: string + enum: + - pending + - resolved + - rejected + - name: tags + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: limit + in: query + description: Number of results + schema: + type: integer + - name: cursor + in: query + description: Cursor for pagination + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/SearchPromisesResp" + 400: + description: Invalid request + + /promises/{id}: + get: + tags: + - Promises + summary: Get a promise + operationId: getPromise + parameters: + - $ref: "#/components/parameters/IdPath" + - $ref: "#/components/parameters/RequestIdHeader" + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 400: + description: Invalid request + 404: + description: Promise not found + + patch: + tags: + - Promises + summary: Complete a promise + operationId: completePromise + parameters: + - $ref: "#/components/parameters/IdPath" + - $ref: "#/components/parameters/RequestIdHeader" + - $ref: "#/components/parameters/IdempotencyKeyHeader" + - $ref: "#/components/parameters/StrictHeader" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CompletePromiseReq" + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Promise" + 400: + description: Invalid request + 403: + description: Forbidden request + 404: + description: Promise not found + + /locks/acquire: + post: + summary: Acquire lock + description: Acquire a distributed lock + operationId: acquireLock + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Lock" + required: true + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Lock" + "400": + description: Bad request - Invalid input or missing required fields + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: Not found - The specified lock could not be found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + + /locks/heartbeat: + post: + summary: heartbeat + description: update heartbeat for all locks that match the processId + operationId: heartbeat + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/HeartbeatRequest" + required: true + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/HeartbeatResponse" + "400": + description: Bad request - Invalid input or missing required fields + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: Not found - The specified lock could not be found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + + /locks/release: + post: + summary: Release lock + description: Release a distributed lock + operationId: releaseLock + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ReleaseLockRequest" + required: true + responses: + "200": + description: successful operation + "400": + description: Bad request - Invalid input or missing required fields + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: Not found - The specified lock could not be found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" /schedules: - $ref: "./schedules-openapi.yml#/paths" + post: + tags: + - Schedules + summary: Create a new schedule + operationId: createSchedule + parameters: + - $ref: "#/components/parameters/RequestIdHeader" + - $ref: "#/components/parameters/IdempotencyKeyHeader" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Schedule" + required: true + responses: + 200: + description: Operation deduplicated, Schedule fetched successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Schedule" + 201: + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/Schedule" + 400: + description: Invalid request + 403: + description: Forbidden request + 409: + description: Schedule already exists + get: + tags: + - Schedules + summary: Search schedules + operationId: searchSchedules + parameters: + - $ref: "#/components/parameters/RequestIdHeader" + - name: id + in: query + description: | + Search schedules for matching IDs, can include wildcards. + + For example: + - "foo/*" matches all IDs starting with "foo/" + - "*/bar" matches all IDs starting with "bar/" + - "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar" + schema: + type: string + - name: tags + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: limit + in: query + description: Number of results + schema: + type: integer + - name: cursor + in: query + description: Cursor for pagination + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/SearchSchedulesResp" + 400: + description: Invalid request + + /schedules/{id}: + get: + tags: + - Schedules + summary: Get a schedule + operationId: getSchedule + parameters: + - $ref: "#/components/parameters/IdPath" + - $ref: "#/components/parameters/RequestIdHeader" + responses: + "200": + description: Successfully retrieved the schedule + content: + application/json: + schema: + $ref: "#/components/schemas/Schedule" + "404": + description: Schedule not found + + delete: + tags: + - Schedules + summary: Delete a schedule + operationId: deleteSchedule + parameters: + - $ref: "#/components/parameters/IdPath" + - $ref: "#/components/parameters/RequestIdHeader" + responses: + "204": + description: Successfully deleted the schedule + "404": + description: Schedule not found components: parameters: - PromiseParameters: - $ref: "./promises-openapi.yml#/components/parameters" - ScheduleParameters: - $ref: "./schedules-openapi.yml#/components/parameters" + IdPath: + name: id + in: path + required: true + description: The ID of the resource + schema: + type: string + # HEADER PARAMETERS + IdempotencyKeyHeader: + name: idempotency-key + in: header + description: Deduplicates multiple requests + schema: + type: string + RequestIdHeader: + name: request-id + in: header + description: Unique ID for each request + schema: + type: string + StrictHeader: + name: strict + in: header + description: If true, deduplicates only when promise state matches the request + schema: + type: boolean schemas: - PromiseSchema: - $ref: "./promises-openapi.yml#/components/schemas" - ScheduleSchema: - $ref: "./schedules-openapi.yml#/components/schemas" - LockSchema: - $ref: "./locks-openapi.yml#/components/schemas" - TaskSchema: - $ref: "./tasks-openapi.yml#/components/schemas" + Promise: + type: object + required: + - id + - state + - timeout + - param + - value + - tags + properties: + id: + type: string + state: + $ref: "#/components/schemas/PromiseState" + param: + $ref: "#/components/schemas/PromiseValue" + value: + $ref: "#/components/schemas/PromiseValue" + timeout: + type: integer + format: int64 + idempotencyKeyForCreate: + type: string + readOnly: true + idempotencyKeyForComplete: + type: string + readOnly: true + tags: + type: object + additionalProperties: + type: string + createdOn: + type: integer + readOnly: true + completedOn: + type: integer + readOnly: true + + PromiseState: + type: string + enum: + - PENDING + - RESOLVED + - REJECTED + - REJECTED_CANCELED + - REJECTED_TIMEDOUT + + PromiseStateComplete: + type: string + enum: + - RESOLVED + - REJECTED + - REJECTED_CANCELED + + PromiseValue: + type: object + required: + - headers + properties: + headers: + type: object + additionalProperties: + type: string + data: + type: string + + CreatePromiseReq: + type: object + required: + - id + - timeout + properties: + id: + type: string + timeout: + type: integer + format: int64 + param: + $ref: "#/components/schemas/PromiseValue" + tags: + type: object + additionalProperties: + type: string + + CompletePromiseReq: + type: object + required: + - state + properties: + state: + $ref: "#/components/schemas/PromiseStateComplete" + value: + $ref: "#/components/schemas/PromiseValue" + + SearchPromisesResp: + type: object + properties: + cursor: + type: string + promises: + type: array + items: + $ref: "#/components/schemas/Promise" + + Schedule: + type: object + required: + - id + - cron + - promiseId + - promiseTimeout + properties: + id: + type: string + description: + type: string + cron: + type: string + tags: + type: object + additionalProperties: + type: string + promiseId: + type: string + promiseTimeout: + type: integer + format: int64 + promiseParam: + $ref: "#/components/schemas/PromiseValue" + promiseTags: + type: object + additionalProperties: + type: string + lastRunTime: + type: integer + readOnly: true + format: int64 + nextRunTime: + type: integer + readOnly: true + format: int64 + idempotencyKey: + type: string + readOnly: true + createdOn: + type: integer + readOnly: true + format: int64 + + SearchSchedulesResp: + type: object + properties: + cursor: + type: string + schedules: + type: array + items: + $ref: "#/components/schemas/Schedule" + + Lock: + type: object + properties: + resourceId: + type: string + processId: + type: string + executionId: + type: string + expiryInSeconds: + type: integer + format: int64 + expiresAt: + type: integer + format: int64 + readOnly: true + required: + - resourceId + - processId + - executionId + - expiryInSeconds + + HeartbeatRequest: + type: object + properties: + processId: + type: string + required: + - processId + + HeartbeatResponse: + type: object + properties: + locksAffected: + type: integer + format: int64 + + ReleaseLockRequest: + type: object + properties: + resourceId: + type: string + executionId: + type: string + required: + - resourceId + - executionId + + ErrorResponse: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: string diff --git a/api/combined.html b/api/combined.html new file mode 100644 index 00000000..ee8117a0 --- /dev/null +++ b/api/combined.html @@ -0,0 +1,558 @@ + + + + + + Combined API + + + + + + + + + +

Combined API (1.0.0)

Download OpenAPI specification:Download

License: Apache 2.0

API documentation for Promises, Tasks, Locks, and Schedules.

+

Promises

Create a promise

header Parameters
request-id
string

Unique ID for each request

+
idempotency-key
string

Deduplicates multiple requests

+
strict
boolean

If true, deduplicates only when promise state matches the request

+
Request Body schema: application/json
required
id
required
string
timeout
required
integer <int64>
object (PromiseValue)
object

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "timeout": 0,
  • "param": {
    },
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Search promises

query Parameters
id
string

Search promises for matching IDs, can include wildcards.

+

For example:

+
    +
  • "foo/*" matches all IDs starting with "foo/"
  • +
  • "*/bar" matches all IDs starting with "bar/"
  • +
  • "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar"
  • +
+
state
string
Enum: "pending" "resolved" "rejected"

Search promises for matching states

+
object
limit
integer

Number of results

+
cursor
string

Cursor for pagination

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "cursor": "string",
  • "promises": [
    ]
}

Get a promise

path Parameters
id
required
string

The ID of the resource

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Complete a promise

path Parameters
id
required
string

The ID of the resource

+
header Parameters
request-id
string

Unique ID for each request

+
idempotency-key
string

Deduplicates multiple requests

+
strict
boolean

If true, deduplicates only when promise state matches the request

+
Request Body schema: application/json
required
state
required
string (PromiseStateComplete)
Enum: "RESOLVED" "REJECTED" "REJECTED_CANCELED"
object (PromiseValue)

Responses

Request samples

Content type
application/json
{
  • "state": "RESOLVED",
  • "value": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Acquire lock

Acquire a distributed lock

+
Request Body schema: application/json
required
resourceId
required
string
processId
required
string
executionId
required
string
expiryInSeconds
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0
}

Response samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0,
  • "expiresAt": 0
}

heartbeat

update heartbeat for all locks that match the processId

+
Request Body schema: application/json
required
processId
required
string

Responses

Request samples

Content type
application/json
{
  • "processId": "string"
}

Response samples

Content type
application/json
{
  • "locksAffected": 0
}

Release lock

Release a distributed lock

+
Request Body schema: application/json
required
resourceId
required
string
executionId
required
string

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "executionId": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string",
  • "details": "string"
}

Schedules

Create a new schedule

header Parameters
request-id
string

Unique ID for each request

+
idempotency-key
string

Deduplicates multiple requests

+
Request Body schema: application/json
required
id
required
string
description
string
cron
required
string
object
promiseId
required
string
promiseTimeout
required
integer <int64>
object (PromiseValue)
object

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    },
  • "lastRunTime": 0,
  • "nextRunTime": 0,
  • "idempotencyKey": "string",
  • "createdOn": 0
}

Search schedules

query Parameters
id
string

Search schedules for matching IDs, can include wildcards.

+

For example:

+
    +
  • "foo/*" matches all IDs starting with "foo/"
  • +
  • "*/bar" matches all IDs starting with "bar/"
  • +
  • "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar"
  • +
+
object
limit
integer

Number of results

+
cursor
string

Cursor for pagination

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "cursor": "string",
  • "schedules": [
    ]
}

Get a schedule

path Parameters
id
required
string

The ID of the resource

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    },
  • "lastRunTime": 0,
  • "nextRunTime": 0,
  • "idempotencyKey": "string",
  • "createdOn": 0
}

Delete a schedule

path Parameters
id
required
string

The ID of the resource

+
header Parameters
request-id
string

Unique ID for each request

+

Responses

+ + + + diff --git a/api/locks-openapi.yml b/api/locks-openapi.yml index 604c7463..a98681e9 100644 --- a/api/locks-openapi.yml +++ b/api/locks-openapi.yml @@ -3,6 +3,13 @@ info: title: Distributed Lock API description: Manage Distributed Locks version: 1.0.0 + license: + name: Apache 2.0 + url: https://opensource.org/license/apache-2-0 +servers: + - url: https://resonatehq.io # Replace with your actual API base URL + description: Website +security: [] # Explicitly state no security is required globally paths: /locks/acquire: post: @@ -22,6 +29,18 @@ paths: application/json: schema: $ref: "#/components/schemas/Lock" + "400": + description: Bad request - Invalid input or missing required fields + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: Not found - The specified lock could not be found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" /locks/heartbeat: post: @@ -41,6 +60,18 @@ paths: application/json: schema: $ref: "#/components/schemas/HeartbeatResponse" + "400": + description: Bad request - Invalid input or missing required fields + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: Not found - The specified lock could not be found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" /locks/release: post: @@ -56,6 +87,18 @@ paths: responses: "200": description: successful operation + "400": + description: Bad request - Invalid input or missing required fields + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: Not found - The specified lock could not be found + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" components: schemas: @@ -106,3 +149,14 @@ components: required: - resourceId - executionId + + ErrorResponse: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: string diff --git a/api/locks.html b/api/locks.html deleted file mode 100644 index 5681de96..00000000 --- a/api/locks.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - Distributed Lock API - - - - - - - - - -

Distributed Lock API (1.0.0)

Download OpenAPI specification:Download

Manage Distributed Locks

-

Acquire lock

Acquire a distributed lock

-
Request Body schema: application/json
required
resourceId
required
string
processId
required
string
executionId
required
string
expiryInSeconds
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0
}

Response samples

Content type
application/json
{
  • "resourceId": "string",
  • "processId": "string",
  • "executionId": "string",
  • "expiryInSeconds": 0,
  • "expiresAt": 0
}

heartbeat

update heartbeat for all locks that match the processId

-
Request Body schema: application/json
required
processId
required
string

Responses

Request samples

Content type
application/json
{
  • "processId": "string"
}

Response samples

Content type
application/json
{
  • "locksAffected": 0
}

Release lock

Release a distributed lock

-
Request Body schema: application/json
required
resourceId
required
string
executionId
required
string

Responses

Request samples

Content type
application/json
{
  • "resourceId": "string",
  • "executionId": "string"
}
- - - - diff --git a/api/promises-openapi.yml b/api/promises-openapi.yml index 3122e5a4..09a85b1d 100644 --- a/api/promises-openapi.yml +++ b/api/promises-openapi.yml @@ -3,6 +3,13 @@ info: title: Promise API description: Manage promises version: 1.0.0 + license: + name: Apache 2.0 + url: https://opensource.org/license/apache-2-0 +servers: + - url: https://resonatehq.io # Replace with your actual API base URL + description: Website +security: [] # Explicitly state no security is required globally paths: /promises: post: @@ -120,6 +127,7 @@ paths: tags: - Promises summary: Complete a promise + operationId: completePromise parameters: - $ref: "#/components/parameters/IdPath" - $ref: "#/components/parameters/RequestIdHeader" diff --git a/api/promises.html b/api/promises.html deleted file mode 100644 index a83b6c31..00000000 --- a/api/promises.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - Promise API - - - - - - - - - -

Promise API (1.0.0)

Download OpenAPI specification:Download

Manage promises

-

Promises

Create a promise

header Parameters
request-id
string

Unique ID for each request

-
idempotency-key
string

Deduplicates multiple requests

-
strict
boolean

If true, deduplicates only when promise state matches the request

-
Request Body schema: application/json
required
id
required
string
timeout
required
integer <int64>
object (PromiseValue)
object

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "timeout": 0,
  • "param": {
    },
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Search promises

query Parameters
id
string

Search promises for matching IDs, can include wildcards.

-

For example:

-
    -
  • "foo/*" matches all IDs starting with "foo/"
  • -
  • "*/bar" matches all IDs starting with "bar/"
  • -
  • "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar"
  • -
-
state
string
Enum: "pending" "resolved" "rejected"

Search promises for matching states

-
object
limit
integer

Number of results

-
cursor
string

Cursor for pagination

-
header Parameters
request-id
string

Unique ID for each request

-

Responses

Response samples

Content type
application/json
{
  • "cursor": "string",
  • "promises": [
    ]
}

Get a promise

path Parameters
id
required
string

The promise ID

-
header Parameters
request-id
string

Unique ID for each request

-

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Complete a promise

path Parameters
id
required
string

The promise ID

-
header Parameters
request-id
string

Unique ID for each request

-
idempotency-key
string

Deduplicates multiple requests

-
strict
boolean

If true, deduplicates only when promise state matches the request

-
Request Body schema: application/json
required
state
required
string (PromiseStateComplete)
Enum: "RESOLVED" "REJECTED" "REJECTED_CANCELED"
object (PromiseValue)

Responses

Request samples

Content type
application/json
{
  • "state": "RESOLVED",
  • "value": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}
- - - - diff --git a/api/schedules-openapi.yml b/api/schedules-openapi.yml index 359b5980..fef17c2e 100644 --- a/api/schedules-openapi.yml +++ b/api/schedules-openapi.yml @@ -2,6 +2,13 @@ openapi: 3.0.0 info: title: Schedules API version: 1.0.0 + license: + name: Apache 2.0 + url: https://opensource.org/license/apache-2-0 +servers: + - url: https://resonatehq.io # Replace with your actual API base URL + description: Website +security: [] # Explicitly state no security is required globally paths: /schedules: post: diff --git a/api/schedules.html b/api/schedules.html deleted file mode 100644 index a729d731..00000000 --- a/api/schedules.html +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - Schedules API - - - - - - - - - -

Schedules API (1.0.0)

Download OpenAPI specification:Download

Schedules

Create a new schedule

header Parameters
request-id
string

Unique ID for each request

-
idempotency-key
string

Deduplicates multiple requests

-
Request Body schema: application/json
required
id
required
string
description
string
cron
required
string
object
promiseId
required
string
promiseTimeout
required
integer <int64>
object (PromiseValue)
object

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    },
  • "lastRunTime": 0,
  • "nextRunTime": 0,
  • "idempotencyKey": "string",
  • "createdOn": 0
}

Search schedules

query Parameters
id
string

Search schedules for matching IDs, can include wildcards.

-

For example:

-
    -
  • "foo/*" matches all IDs starting with "foo/"
  • -
  • "*/bar" matches all IDs starting with "bar/"
  • -
  • "foo/*/bar" matches all IDs starting with "foo/" and ending with "/bar"
  • -
-
object
limit
integer

Number of results

-
cursor
string

Cursor for pagination

-
header Parameters
request-id
string

Unique ID for each request

-

Responses

Response samples

Content type
application/json
{
  • "cursor": "string",
  • "schedules": [
    ]
}

Get a schedule

path Parameters
id
required
string

The schedule ID

-
header Parameters
request-id
string

Unique ID for each request

-

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "description": "string",
  • "cron": "string",
  • "tags": {
    },
  • "promiseId": "string",
  • "promiseTimeout": 0,
  • "promiseParam": {
    },
  • "promiseTags": {
    },
  • "lastRunTime": 0,
  • "nextRunTime": 0,
  • "idempotencyKey": "string",
  • "createdOn": 0
}

Delete a schedule

path Parameters
id
required
string

The schedule ID

-
header Parameters
request-id
string

Unique ID for each request

-

Responses

- - - - diff --git a/api/tasks.html b/api/tasks.html deleted file mode 100644 index e771a93d..00000000 --- a/api/tasks.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - Tasks API - - - - - - - - - -

Tasks API (1.0.0)

Download OpenAPI specification:Download

Manage Tasks

-

Tasks

Claim a task

Request Body schema: application/json
required
taskId
required
string

The ID of the task to claim

-
counter
required
integer

The counter of the task to claim

-
processId
required
string
executionId
required
string
expiryInMilliseconds
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "taskId": "string",
  • "counter": 0,
  • "processId": "string",
  • "executionId": "string",
  • "expiryInMilliseconds": 0
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "PENDING",
  • "param": {
    },
  • "value": {
    },
  • "timeout": 0,
  • "idempotencyKeyForCreate": "string",
  • "idempotencyKeyForComplete": "string",
  • "tags": {
    },
  • "createdOn": 0,
  • "completedOn": 0
}

Complete a task

Request Body schema: application/json
required
taskId
required
string

The ID of the task to complete

-
counter
required
integer

The counter of the task to claim

-
executionId
required
string
state
required
string (PromiseStateComplete)
Enum: "RESOLVED" "REJECTED"
required
object (PromiseValue)

Responses

Request samples

Content type
application/json
{
  • "taskId": "string",
  • "counter": 0,
  • "executionId": "string",
  • "state": "RESOLVED",
  • "value": {
    }
}
- - - -