diff --git a/api/zeebe/post-generate.sh b/api/zeebe/post-generate.sh new file mode 100644 index 00000000000..0d1cb7af776 --- /dev/null +++ b/api/zeebe/post-generate.sh @@ -0,0 +1,3 @@ +# The generator adds a version badge to the Introduction file, but +# we already have a version badge from the main docs layout. +sed -i '' '/Version: 0.1/d' docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api.info.mdx \ No newline at end of file diff --git a/api/zeebe/zeebe-openapi.yaml b/api/zeebe/zeebe-openapi.yaml new file mode 100644 index 00000000000..b59bafcb839 --- /dev/null +++ b/api/zeebe/zeebe-openapi.yaml @@ -0,0 +1,388 @@ +openapi: "3.1.0" +info: + title: Zeebe REST API + version: "0.1" + description: API for communicating with the Zeebe cluster. + license: + name: Zeebe Community License Version 1.1 + url: https://github.com/camunda/zeebe/blob/main/licenses/ZEEBE-COMMUNITY-LICENSE-1.1.txt +externalDocs: + description: Find out more + url: https://docs.camunda.io/docs/apis-tools/zeebe-api-rest/overview/ + +servers: + - url: "{schema}://{host}:{port}/v1" + variables: + host: + default: localhost + description: The hostname of a Zeebe Gateway. + port: + default: "8080" + description: The port of the Zeebe REST API server. + schema: + default: http + description: The schema of the Zeebe REST API server. + +paths: + /topology: + get: + tags: + - Cluster + summary: Get cluster topology + description: Obtains the current topology of the cluster the gateway is part of. + responses: + "200": + $ref: "#/components/responses/TopologyResponse" + /user-tasks/{userTaskKey}/completion: + post: + tags: + - User task + summary: Complete a user task + description: Completes a user task with the given key. + parameters: + - name: userTaskKey + in: path + required: true + description: The key of the user task to complete. + schema: + type: integer + format: int64 + requestBody: + required: false + content: + application/json: + schema: + $ref: "#/components/schemas/UserTaskCompletionRequest" + + responses: + "204": + description: The user task was completed successfully. + "404": + description: The user task with the given key was not found. + "409": + description: > + The user task with the given key is in the wrong state currently. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + "400": + description: > + The user task with the given key cannot be completed. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + /user-tasks/{userTaskKey}/assignment: + post: + tags: + - User task + summary: Assign a user task + description: Assigns a user task with the given key to the given assignee. + parameters: + - name: userTaskKey + in: path + required: true + description: The key of the user task to assign. + schema: + type: integer + format: int64 + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserTaskAssignmentRequest" + responses: + "204": + description: The user task's assignment was adjusted. + "404": + description: The user task with the given key was not found. + "409": + description: > + The user task with the given key is in the wrong state currently. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + "400": + description: > + The assignment of the user task with the given key cannot be completed. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + /user-tasks/{userTaskKey}: + patch: + tags: + - User task + summary: Update a user task + description: Update a user task with the given key. + parameters: + - name: userTaskKey + in: path + required: true + description: The key of the user task to update. + schema: + type: integer + format: int64 + requestBody: + required: false + content: + application/json: + schema: + $ref: "#/components/schemas/UserTaskUpdateRequest" + responses: + "204": + description: The user task was updated successfully. + "404": + description: The user task with the given key was not found. + "409": + description: > + The user task with the given key is in the wrong state currently. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + "400": + description: > + The user task with the given key cannot be updated. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + /user-tasks/{userTaskKey}/assignee: + delete: + tags: + - User task + summary: Unassign a user task + description: Removes the assignee of a task with the given key. + parameters: + - name: userTaskKey + in: path + required: true + description: The key of the user task. + schema: + type: integer + format: int64 + responses: + "204": + description: The user task was unassigned successfully. + "404": + description: The user task with the given key was not found. + "409": + description: > + The user task with the given key is in the wrong state currently. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + "400": + description: > + The user task with the given key cannot be unassigned. + More details are provided in the response body. + $ref: "#/components/responses/ProblemResponse" + +components: + responses: + TopologyResponse: + description: Obtains the current topology of the cluster the gateway is part of. + content: + application/json: + schema: + $ref: "#/components/schemas/TopologyResponse" + ProblemResponse: + description: Response for exceptional uses cases, providing more details. + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ProblemDetail" + + schemas: + TopologyResponse: + description: The response of a topology request. + type: object + properties: + brokers: + description: A list of brokers that are part of this cluster. + type: array + nullable: true + items: + $ref: "#/components/schemas/BrokerInfo" + clusterSize: + description: The number of brokers in the cluster. + type: integer + format: int32 + nullable: true + partitionsCount: + description: The number of partitions are spread across the cluster. + type: integer + format: int32 + nullable: true + replicationFactor: + description: The configured replication factor for this cluster. + type: integer + format: int32 + nullable: true + gatewayVersion: + description: The version of the Zeebe Gateway. + type: string + nullable: true + BrokerInfo: + description: Provides information on a broker node. + type: object + properties: + nodeId: + description: The unique (within a cluster) node ID for the broker. + type: integer + format: int32 + host: + description: The hostname for reaching the broker. + type: string + port: + description: The port for reaching the broker. + type: integer + format: int32 + partitions: + description: A list of partitions managed or replicated on this broker. + type: array + items: + $ref: "#/components/schemas/Partition" + version: + description: The broker version. + type: string + Partition: + description: Provides information on a partition within a broker node. + type: object + properties: + partitionId: + description: The unique ID of this partition. + type: integer + format: int32 + role: + description: Describes the Raft role of the broker for a given partition. + type: string + enum: + - leader + - follower + - inactive + health: + description: Describes the current health of the partition. + type: string + enum: + - healthy + - unhealthy + - dead + UserTaskCompletionRequest: + type: object + properties: + variables: + description: The variables to complete the user task with. + type: object + nullable: true + $ref: "#/components/schemas/Variables" + action: + description: > + A custom action value that will be accessible from user task events resulting + from this endpoint invocation. If not provided, it will default to "complete". + type: string + nullable: true + UserTaskAssignmentRequest: + type: object + properties: + assignee: + description: The assignee for the user task. The assignee must not be empty or `null`. + type: string + nullable: false + allowOverride: + description: > + By default, the task is reassigned if it was already assigned. Set this to `false` + to return an error in such cases. The task must then first be unassigned to + be assigned again. Use this when you have users picking from group task + queues to prevent race conditions. + type: boolean + nullable: true + action: + description: > + A custom action value that will be accessible from user task events resulting + from this endpoint invocation. If not provided, it will default to "assign". + type: string + nullable: true + UserTaskUpdateRequest: + type: object + properties: + changeset: + description: | + JSON object with changed task attribute values. + + The following attributes can be adjusted with this endpoint, additional attributes + will be ignored: + + * `candidateGroups` - reset by providing an empty list + * `candidateUsers` - reset by providing an empty list + * `dueDate` - reset by providing an empty String + * `followUpDate` - reset by providing an empty String + + Providing any of those attributes with a `null` value or omitting it preserves + the persisted attribute's value. + + The assignee cannot be adjusted with this endpoint, use the Assign task endpoint. + This ensures correct event emission for assignee changes. + type: object + nullable: true + $ref: "#/components/schemas/Changeset" + action: + description: > + A custom action value that will be accessible from user task events resulting + from this endpoint invocation. If not provided, it will default to "update". + type: string + nullable: true + Variables: + description: A map of variables. + type: object + additionalProperties: true + Changeset: + description: A map of changes. + type: object + additionalProperties: true + properties: + dueDate: + type: string + format: date-time + description: The due date of the task. Reset by providing an empty String. + nullable: true + followUpDate: + type: string + format: date-time + description: The follow-up date of the task. Reset by providing an empty String. + nullable: true + candidateUsers: + type: array + description: The list of candidate users of the task. Reset by providing an empty list. + items: + type: string + nullable: true + candidateGroups: + type: array + description: The list of candidate groups of the task. Reset by providing an empty list. + items: + type: string + nullable: true + ProblemDetail: + description: > + A Problem detail object as described in [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457). + There may be additional properties specific to the problem type. + type: object + properties: + type: + type: string + format: uri + description: A URI identifying the problem type. + default: about:blank + title: + type: string + description: A summary of the problem type. + status: + type: integer + format: int32 + description: The HTTP status code for this problem. + minimum: 400 + maximum: 600 + detail: + type: string + description: An explanation of the problem in more detail. + instance: + type: string + format: uri + description: A URI identifying the origin of the problem. + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT diff --git a/docs/apis-tools/zeebe-api-rest/sidebar-schema.js b/docs/apis-tools/zeebe-api-rest/sidebar-schema.js new file mode 100644 index 00000000000..2b8a3446bc4 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/sidebar-schema.js @@ -0,0 +1,11 @@ +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ + +module.exports = { + "Zeebe API (REST)": [ + "apis-tools/zeebe-api-rest/zeebe-api-rest-overview", + "apis-tools/zeebe-api-rest/zeebe-api-rest-authentication", + { + Specifications: require("./specifications/sidebar.js"), + }, + ], +}; diff --git a/docs/apis-tools/zeebe-api-rest/specifications/assign-a-user-task.api.mdx b/docs/apis-tools/zeebe-api-rest/specifications/assign-a-user-task.api.mdx new file mode 100644 index 00000000000..3dd58a62c99 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/assign-a-user-task.api.mdx @@ -0,0 +1,55 @@ +--- +id: assign-a-user-task +title: "Assign a user task" +description: "Assigns a user task with the given key to the given assignee." +sidebar_label: "Assign a user task" +hide_title: true +hide_table_of_contents: true +api: eJztWNty2zYQ/RUMXppMbVFJ3TTRm+M6rdtcPLbcTmN7xiAJSYhJgAVAySpH/96zAKl7LtPmMckkw8tiz+7inCVWDfdi7Pjgml85aZkX7p7fHvBcusyqyiuj+YAfO6fG2jHB6s6IzZSfMD+RbKymUrN7OWferD0QYY2UPX7AK2FFKb20BNRwjRt4JV9DuPpdzmGjCKgSfoJrK/+ulZU5H3hby+1ohsAgODMKcKuQgB9RCdNlE1kKPmi4n1cEp7SXY2nxamRsKXx89OyILxa3EVI6/9Lkc1qzHUFmsFp7eiWqqlCZoGCSD44ianbBTPpBZp5St6aS1ivpwtq2KHS9m1T3liHAzdR6bON9WTvPtPEslUyWlUctLLvTdVHcUeptDM5bpce4pxciLfBsJAonFwdcFIWZvZtKa1W+J5iXc5bLkagLfxDiCNVVjlnZhpAzNWLKs5kAKQo8zudddHmPXUqPZbDHhtwFyDu6tNLXFsTQDLgIWGnm6mzCMuGkixkGoJAdYDUbKetCkrVeAsNRuixFzsRYKN1jIG+EnNG6uanZRExjAR2rVHaPSrCRNSUbW1NXEQg7jj0nj5WV4KxnVmSSYa9zRZVwvRu9KmdqTCGF3qgnkYPKmcXCbdfxmGXIBaDRgE1FUVOcApVTRRESyTKJXOAthrdic4iIau6wD8vwQ5JS55UBeVHCqYlU7LGzUaAECDfFpuYHYX8Ipd1KyvOmZeAN30htD1NCZkjNK0+3oTuQWGMrKBHaRVQM5EN2CLNCxSLNn/aP9jN8md13rt1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o0WJzGewyH5WXnYmfMXB92KYwxtlf+I7cYxgfS77Jnn7y6HJMf2N4bSkJC4FTP6yQP/D/gN/uLGhFoFpYfnDceXYlyLMdlHv/TnX93IKMU= +sidebar_class_name: "post api-method" +info_path: docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api +custom_edit_url: null +hide_send_button: true +--- + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + +

Assign a user task

+ + + +Assigns a user task with the given key to the given assignee. + +## Request + +

Path Parameters

Body

required
+ +The user task's assignment was adjusted. + +
+ +The assignment of the user task with the given key cannot be completed. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
+ +The user task with the given key was not found. + +
+ +The user task with the given key is in the wrong state currently. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
diff --git a/docs/apis-tools/zeebe-api-rest/specifications/complete-a-user-task.api.mdx b/docs/apis-tools/zeebe-api-rest/specifications/complete-a-user-task.api.mdx new file mode 100644 index 00000000000..4c042d8eb23 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/complete-a-user-task.api.mdx @@ -0,0 +1,59 @@ +--- +id: complete-a-user-task +title: "Complete a user task" +description: "Completes a user task with the given key." +sidebar_label: "Complete a user task" +hide_title: true +hide_table_of_contents: true +api: eJztV01z2zYQ/S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C/WEJlOSwybVwZrI4hvzfk0bEnWwOiGMNOvPSOdItJBzQiU5CCfZESjPkV3WEt/ERBdvb1vRm8GdyrikSbXHlFk/HllJ1enDEfksfeTj9oVBKx71XphR9TWk3UVqKfKbe5pCs+FzOJVmZOc0r+Fg+1rUozvXshfPEP7xuU/P7ntCo09bFJO62P7wSV6nC43plnG8RVcJzrynQNlv0AqHSos7806B93QYkgiVtAR5KnVYMFMLf93WsLY0zLlIYjjh4s0aPJYr31eJGRv+827IOXYJ+9XXZcWfUga7rrAvrzWR9Gg1DgXiSCf0hNMIv1LEiESoPakA2+jMfvxr3Rp/Pzq49n0796H85G44+X4x709t2dqxJIHEhEuuNVs83tLnOHwRft78t/2v7qKjt55wJ0Dix6ZR1gUdPwmrc0xIXh/ma4w0SAyrPpmhfFTFh5ZeKypM9Ag8Hedn3bkq9ia6QsPbdr3IMhvZjUG99L9tQN897I6o8i3VSNAJsS3vAIhQdLb3kL8aUUEcBOvnqJkfeoNyU9rYbOzlkeNTdOsXJk7gHZvR9/YuW2E158upwSyeqFN8HvBr4asaYNHP8P+Q3+4kVX2ar4W30vOPr/IhcLkvd66c+/Zheduw== +sidebar_class_name: "post api-method" +info_path: docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api +custom_edit_url: null +hide_send_button: true +--- + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + +

Complete a user task

+ + + +Completes a user task with the given key. + +## Request + +

Path Parameters

Body

    variables objectnullable
    + +The variables to complete the user task with. + +
+ +The user task was completed successfully. + +
+ +The user task with the given key cannot be completed. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
+ +The user task with the given key was not found. + +
+ +The user task with the given key is in the wrong state currently. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
diff --git a/docs/apis-tools/zeebe-api-rest/specifications/get-cluster-topology.api.mdx b/docs/apis-tools/zeebe-api-rest/specifications/get-cluster-topology.api.mdx new file mode 100644 index 00000000000..c07bf7f8421 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/get-cluster-topology.api.mdx @@ -0,0 +1,48 @@ +--- +id: get-cluster-topology +title: "Get cluster topology" +description: "Obtains the current topology of the cluster the gateway is part of." +sidebar_label: "Get cluster topology" +hide_title: true +hide_table_of_contents: true +api: eJy1Vttu2zgQ/RWCT7uAEzndlyJvqesGXvQSJO4utoEfKHkss6VELUk5dQX/+86QlCXbai5AFzBgiRqeM8M5M8OGO5FbfnnPJ6q2DgxfjPgSbGZk5aQu+SX/lDohS8vcGlhWGwOlY05XWul8y/QqrIfN/jkXDh7ElknLKmEcmpzzETdgK11aQK6GvxqP6e//4Ml06XAnwYuqUjITBJ98tcTRcJutoRCn5HMEbF0kMtFRG/i3BusI3G0rQGOdfoXM4XtldAXGyRBVavQ3MPYU/IopaclBFk3Qf+GYMNB6jgsYRoyuxySMEVt8LWulRKpwyZkaRlw6KAaIbozeSFxislxpU/jQGf5EJGalXsLTgZDVbDl8SHUp8TjYbw8SXSbk6PTvHpvN3jJk9vkJlD02iZnJUWEjHpwLS3+84rsRX2vrhgnpSykK8LgGRIa0+TCBdQa/EVylzU/g6MszoB7zlXImCfLRVHdWrBClyGHJPGvQJL2VIesn3G3SX5zkPSXbZ+dFed/vfyL5mORWsvstzzw7o0nEx9hv/VsKofhvxcoxMmyrPgZBWRMslxsoB3lj+kccyrqglqZALKMfSukH/yhLkTmE4AtSHQjl1k/50zajYN069SwPwhZKZl12z0v0C/nRAUSg8+A3LRin1Q22CBn61WkO4mFEmwH192DfeNsZ6sQvx1K9kz8GckDY6HWK2L1GJct+331Oko+b1UHBTHRd/qQwO+5e5VCLtBWW6pKJzGhrf4E3bQkiwTvUgjbD/uAgWcm8NlipvR1s5bfEJjfYs1/iS5xhfz2W8JjpVndfAFJg12HjkPaOSHpymMeRdhsHHYpiR98LcGuNJc9z8E1BUE3wpJ2AuGTBbPxou294bRR+bcIk3V0mSUMtenfZUGvdJZsLtN8II8kH31a63r4StaLzUDoTyi8fXzYOOr6fw0fxHjT3Fu/1+PV4EMp3+4ODu53ezdnVzYyFkDxg/1LQQq6dqwYhg/FToLvdgk4NW4d02zvaEu8IgJI2V3XoOjF1kcsj03swwpXw8K6V0Z9/z30dU+P322NeD53gvQbCx+cXJ1GQo6TfTBcFdnQSNo5BGhm9kHq6Ru0DqYVuBqLoCCdhv9uy98GCRR2zC88ahELBWVRJjvh1eo6kSSZw31IkPwgmSZVOkwKvfkkkssmX6fTN9Gzy6cOHzx9n83/O3s8m04930zPEPXffnT+EClWCg7Xn1TW47oLYafcg+Ka7IP6iC2fMoYPvLqkUApKifOhNrKR7vvdm0d507nnTpMLCZ6N2O1rGuWq2uL7oiofewpCiKUal9w22lL8sg8r5KlO1vzAcX3RJfPuivp6Sav4D0YQjZg== +sidebar_class_name: "get api-method" +info_path: docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api +custom_edit_url: null +hide_send_button: true +--- + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + +

Get cluster topology

+ + + +Obtains the current topology of the cluster the gateway is part of. + +## Request + +
+ +Obtains the current topology of the cluster the gateway is part of. + +
Schema
    brokers object[]nullable
    + +A list of brokers that are part of this cluster. + +
  • Array [
  • partitions object[]
    + +A list of partitions managed or replicated on this broker. + +
  • Array [
  • ]
  • ]
diff --git a/docs/apis-tools/zeebe-api-rest/specifications/sidebar.js b/docs/apis-tools/zeebe-api-rest/specifications/sidebar.js new file mode 100644 index 00000000000..25b13ac45ac --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/sidebar.js @@ -0,0 +1,48 @@ +module.exports = [ + { + type: "doc", + id: "apis-tools/zeebe-api-rest/specifications/zeebe-rest-api", + }, + { + type: "category", + label: "Cluster", + items: [ + { + type: "doc", + id: "apis-tools/zeebe-api-rest/specifications/get-cluster-topology", + label: "Get cluster topology", + className: "api-method get", + }, + ], + }, + { + type: "category", + label: "User task", + items: [ + { + type: "doc", + id: "apis-tools/zeebe-api-rest/specifications/complete-a-user-task", + label: "Complete a user task", + className: "api-method post", + }, + { + type: "doc", + id: "apis-tools/zeebe-api-rest/specifications/assign-a-user-task", + label: "Assign a user task", + className: "api-method post", + }, + { + type: "doc", + id: "apis-tools/zeebe-api-rest/specifications/update-a-user-task", + label: "Update a user task", + className: "api-method patch", + }, + { + type: "doc", + id: "apis-tools/zeebe-api-rest/specifications/unassign-a-user-task", + label: "Unassign a user task", + className: "api-method delete", + }, + ], + }, +]; diff --git a/docs/apis-tools/zeebe-api-rest/specifications/unassign-a-user-task.api.mdx b/docs/apis-tools/zeebe-api-rest/specifications/unassign-a-user-task.api.mdx new file mode 100644 index 00000000000..b9b6246ae24 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/unassign-a-user-task.api.mdx @@ -0,0 +1,55 @@ +--- +id: unassign-a-user-task +title: "Unassign a user task" +description: "Removes the assignee of a task with the given key." +sidebar_label: "Unassign a user task" +hide_title: true +hide_table_of_contents: true +api: eJztV01z2zYQ/SsYnJKpJcqpmya6qY7SurUTjyy107g6gORKQkwCDD4kqxz+9+4SpL5bdzI5+uAxAe6+t4vdBy1L7sTc8v49n1gwzAn7wKdnPAWbGFk4qRXv8xHkegmWuQUwYa2cKwCmZ0zU9mwl3aJ+N5dLUOwB1l1+xgthRA4ODKGXXOECoTyyjNHpN1ijjST0QrgFPhv44qWBlPed8XAYwhjhEZhYicm3wRKTTRaQC94vuVsXRCKVgzkYfDXTJhcubL2+4FU1JSJbaGXBkser3gX9OybbMLCVsMyrJu+UWZ8kYO3MZxnmWZ3xi17vSYijE2KJUEo7FsMOdpfdaAMsBSdkZpnA58LopUyRVqoaoA2exTpdd/9SmGOiMV3lKAZRFJlMBMUQoWecQf7dZ0sBlTuntB/pgN0Gy4aX6fgzJA4LzYJhHNjvR+8v2duLH36cvlg4V9h+FK1Wq66ZJR1IpdOmq808wiX9kd3LLsNTwBxysaY8RYpmyCkyyqoA4yT2lC0gkTOZMKfrBJuwGZUy5NcUNYRFjbVx3pZ8U3rrjFTz3cp7I/lhNw3YZHTF8FyVk7M1OhxT1z4z4TPCELH2rh9nQj1QxZ102UnSQxbr81yYTdfuEyCQdcJ5+2Tnfv/qCJv665fx+JYFCJboFBj6II+0LRElkUslc5/zPrYprsRjWL3u9SrCpIr/j0wUg8cC069b6zAdbI5827d1YlJhXCr5VpXRRs7lIS8SbWvBmyZ+FzKqqqpW5tPiPlYm6Z2kOdNepY3C334FDtahEe3KaEyEKgUs8cZgcnh3PIv9WezPYv9GYseXOGwsNI4PSJLh3FGPIDhZ9HlEMu2QTG1U7gwgVdQOMzREgFm2s4o3eEy8DCKqsPfLhbau6peFNq6KludovxRGCgyiLii9DmJrmyjTicjq7VPFpBc0EIUh6hMAKuZnvB1WIowUxLOP96b3pncSikzbswpAo+HdmA1ur1hIKfTezn3QQpKwT0IG46dA61nKAt5n0q3vyCWcRQx4lZmBp6Pf9EPDVSPTOhjhTnh433bJr3+M60JLNdO1e1Pw/SDo+LFWIeJe9/y4sTBQ0kei89yr+pLE5trc0QEtybx1lMoZx3sU8J4lxmZODSaXwd+t2XWwYL8HXnZes4ZGaW/IOeL7uIukUSLQLxXR3wQTxZmOo1xIFTVENvo0HP407Fx+vLmZfLga/9m5vrocfrgbdhC36x5dfQgFdkku1E5Uk2ZUxKbZ/PQcJl9ufyO+bnBvSubg0UV4DeCMXjWZlo2i7vlWUejQ3x/qN6LC/gjCuOdlGQsLE5NVFW1/8WDWuD/d6qgWXiotPaOIZyKzhx8Bu5m9GDWfCy/Zf30anMyl2RRqXes487TCRwQ5+EKppmi+AJFir1J8wWKAHwCF2/H9119iksjmWno3vB6Oh1jZfwDR0aEr +sidebar_class_name: "delete api-method" +info_path: docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api +custom_edit_url: null +hide_send_button: true +--- + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + +

Unassign a user task

+ + + +Removes the assignee of a task with the given key. + +## Request + +

Path Parameters

+ +The user task was unassigned successfully. + +
+ +The user task with the given key cannot be unassigned. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
+ +The user task with the given key was not found. + +
+ +The user task with the given key is in the wrong state currently. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
diff --git a/docs/apis-tools/zeebe-api-rest/specifications/update-a-user-task.api.mdx b/docs/apis-tools/zeebe-api-rest/specifications/update-a-user-task.api.mdx new file mode 100644 index 00000000000..ce1134c0bd6 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/update-a-user-task.api.mdx @@ -0,0 +1,73 @@ +--- +id: update-a-user-task +title: "Update a user task" +description: "Update a user task with the given key." +sidebar_label: "Update a user task" +hide_title: true +hide_table_of_contents: true +api: eJztWFtT3DYU/isavzRp2QuXpGHfCCEJaUgYWNppgBm0tnZXiS25ksyy3dn/3u9I9tp7IdA0fQsMjG2d+znfOZJmkeMjG/UuowsrDHPcfomut6JE2NjI3Emtol50kSfcCcZZUdGwiXRj5saCjeStUOyLmLajrSjnhmfCCUMSZ5HCC9iJqw+m38QUNJIk5tyN8WzEX4U0Iol6zhRiVW0f4iGY6aHXVCt3mhXeJNJp47HIeNSbRW6akzqpnBgJg6WhNhl34dPzvWg+vw4qhXUvdTIlntqCIU8tTIg12JWjNZ7nqYw5WdP5bMmk2bo2PfgsYke+G50L46SwtBqPuRoJK7ygZbfenX/8wAJbCGOgTYJv3DkjBwXCfctTWNq+UleKIjHUaaonUo1qEstirtgAmUk+F9ZBRJkWaZlQSa7h9xYWE0mqedrgvFITmabEK0dKIwA90vMzu4HERFJs3xhd5PaGtZghP9hgyuDirUy8CYqJLHdTlkrrlvmojh7PlhTiFZgeoj+H3WrkOUIcLvJ/w3alThuLZUVpK5qh9KHj7EYVaXoTgs+0YTqTzhGfdNAAXeaWokcFiXRb6cO+EPOTDZyLrHFrEWAhKFNKuweThSL3xX7g+UJJVKttEumpbWEo+doYKiIBBOJ/JsGjFQrFNNSGOgQrSnS1ZMlVPkhFBb+6Uk4bxRzWlsu7TFsDB9aHugk6KoaWk2gBm4ANCcx3lRLd5GmbnT2YzPaa3XPSWdfEf7ApiGkV+fezbBkWDdu4MXy60QrCBul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/xNYjqDVA86GZeqUyqynU9HRy+PWocfT04uPhz3/2y9Pz48+nB+1ILctrtzPo85Cj3jqmHV+m3YquuzerQ9/u6srDMn7lwHHUsqSoH3bVai/zKq0Q+GXvNeDfkNEL6MZrMBt+LCpPM5fUYJmim+X9eI9y0ikZae65uve114clZekj1lj7uS2+hKdZ5UU997cBDDGx4hbuWOcE71OBY8Ab7I0kBxGOxp9UlOLWHtkm6+VXEc4GSTu3tol3YZ1AgWLff0oH/4loBdXhFmmFD4bPiEbizxvxdd4Rcv2gfL9wz/fRZh0owKPiL6IJh+/gEN7nDR +sidebar_class_name: "patch api-method" +info_path: docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api +custom_edit_url: null +hide_send_button: true +--- + +import ApiTabs from "@theme/ApiTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; +import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import Markdown from "@theme/Markdown"; +import OperationTabs from "@theme/OperationTabs"; +import TabItem from "@theme/TabItem"; + +

Update a user task

+ + + +Update a user task with the given key. + +## Request + +

Path Parameters

Body

    changeset objectnullable
    + +JSON object with changed task attribute values. + +The following attributes can be adjusted with this endpoint, additional attributes +will be ignored: + +- `candidateGroups` - reset by providing an empty list +- `candidateUsers` - reset by providing an empty list +- `dueDate` - reset by providing an empty String +- `followUpDate` - reset by providing an empty String + +Providing any of those attributes with a `null` value or omitting it preserves +the persisted attribute's value. + +The assignee cannot be adjusted with this endpoint, use the Assign task endpoint. +This ensures correct event emission for assignee changes. + +
+ +The user task was updated successfully. + +
+ +The user task with the given key cannot be updated. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
+ +The user task with the given key was not found. + +
+ +The user task with the given key is in the wrong state currently. More details are provided in the response body. + +
Schema
    = 400` and `<= 600`"} schema={{"type":"integer","format":"int32","description":"The HTTP status code for this problem.","minimum":400,"maximum":600}}>
diff --git a/docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api.info.mdx b/docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api.info.mdx new file mode 100644 index 00000000000..7d59a4970c6 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/specifications/zeebe-rest-api.info.mdx @@ -0,0 +1,56 @@ +--- +id: zeebe-rest-api +title: "Zeebe REST API" +description: "API for communicating with the Zeebe cluster." +sidebar_label: Introduction +sidebar_position: 0 +hide_title: true +custom_edit_url: null +--- + +import ApiLogo from "@theme/ApiLogo"; +import SchemaTabs from "@theme/SchemaTabs"; +import TabItem from "@theme/TabItem"; +import Export from "@theme/ApiExplorer/Export"; + +

Zeebe REST API

+ +API for communicating with the Zeebe cluster. + +
+

+ Authentication +

+ + +
+ + + + + + + + + + + + + + + +
Security Scheme Type:http
HTTP Authorization Scheme:bearer
Bearer format:JWT
+
+
+
+
+
+

License

+ + Zeebe Community License Version 1.1 + +
diff --git a/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-authentication.md b/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-authentication.md new file mode 100644 index 00000000000..96b0d0922d6 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-authentication.md @@ -0,0 +1,62 @@ +--- +id: zeebe-api-rest-authentication +title: "Authentication" +description: "Describes authentication options that can be used to access Zeebe REST API." +--- + +## Authentication in the cloud + +To access the API endpoint, you need an access token. + +Your client must send a header in each request: + +`Authorization: Bearer ` + +For example, send a request using _curl_: + +```shell +curl -X POST -H -H :accept: application/json" -H "Authorization: Bearer " -d '' http://localhost:8080/v1/topology +``` + +### How to obtain the access token + +You must obtain a token to use the Zeebe REST API. When you create a Zeebe [client](/guides/setup-client-connection-credentials.md), you get all the information needed to connect to Zeebe. + +Refer to our guide on [building your own client](../build-your-own-client.md). + +The following settings are needed: + +| Name | Description | Default value | +| ------------------------ | ----------------------------------------------- | ------------------ | +| client id | Name of your registered client | - | +| client secret | Password for your registered client | - | +| audience | Permission name; if not given use default value | `zeebe.camunda.io` | +| authorization server url | Token issuer server | - | + +Send a token issue _POST_ request to the authorization server with the following content: + +```json +{ + "client_id": "", + "client_secret": "", + "audience": "", + "grant_type": "client_credentials" +} +``` + +Refer to the following example with _curl_: + +```shell +curl -X POST --header 'content-type: application/json' --data '{"client_id": "", "client_secret":"","audience":"","grant_type":"client_credentials"}' https:// +``` + +If the authentication is successful, the authorization server sends back the access token, when it expires, scope, and type: + +```json +{ + "access_token": "ey...", + "scope": "...", + "expires_in": 86400, + "token_type": "Bearer" +} +``` diff --git a/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-overview.md b/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-overview.md new file mode 100644 index 00000000000..c9cd259e0a8 --- /dev/null +++ b/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-overview.md @@ -0,0 +1,13 @@ +--- +id: zeebe-api-rest-overview +title: "Overview" +description: "The Zeebe REST API enables clients to communicate with the cluster. Activate jobs, cancel and create process instances, and more." +--- + +## Introduction + +The Zeebe REST API is a REST API designed to interact with the Zeebe process automation engine. + +:::note +Ensure you [authenticate](./zeebe-api-rest-authentication.md) before accessing the Zeebe REST API. +::: diff --git a/docusaurus.config.js b/docusaurus.config.js index 1828af77032..703188436de 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -148,6 +148,24 @@ module.exports = { }, }, ], + [ + // Zeebe REST API docs generation + "docusaurus-plugin-openapi-docs", + { + id: "api-zeebe-openapi", + docsPluginId: "default", + config: { + zeebe: { + specPath: "api/zeebe/zeebe-openapi.yaml", + outputDir: "docs/apis-tools/zeebe-api-rest/specifications", + sidebarOptions: { + groupPathsBy: "tag", + }, + hideSendButton: true, + }, + }, + }, + ], ], scripts: [ { @@ -396,6 +414,8 @@ module.exports = { banner: "none", }, }, + docLayoutComponent: "@theme/DocPage", + docItemComponent: "@theme/ApiItem", }, blog: false, theme: { diff --git a/package.json b/package.json index 596515401b4..0b5dcbba27e 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,15 @@ "serve": "docusaurus serve", "format": "prettier --write .", "format:check": "prettier --check .", + "prettier": "prettier", "prepare": "husky install", "test": "jest", "test:regression": "playwright test spec/", "test:watch": "jest --watch", - "api:generate:operate": "docusaurus clean-api-docs operate -p api-operate-openapi && docusaurus gen-api-docs operate -p api-operate-openapi && prettier --write api/operate/docs/", - "api:generate:tasklist": "docusaurus clean-api-docs tasklist -p api-tasklist-openapi && docusaurus gen-api-docs tasklist -p api-tasklist-openapi && prettier --write api/tasklist/docs/" + "": "", + "api:generate:operate": "docusaurus clean-api-docs operate -p api-operate-openapi && docusaurus gen-api-docs operate -p api-operate-openapi && prettier --write api/operate/docs/ && prettier --write api/operate/docs/", + "api:generate:tasklist": "docusaurus clean-api-docs tasklist -p api-tasklist-openapi && docusaurus gen-api-docs tasklist -p api-tasklist-openapi && prettier --write api/tasklist/docs/ && prettier --write api/operate/docs/", + "api:generate:zeebe": "docusaurus clean-api-docs zeebe -p api-zeebe-openapi && docusaurus gen-api-docs zeebe -p api-zeebe-openapi && bash ./api/zeebe/post-generate.sh && prettier --write docs/apis-tools/zeebe-api-rest/specifications && prettier --write docs/apis-tools/zeebe-api-rest/specifications" }, "dependencies": { "@auth0/auth0-react": "^2.2.1", diff --git a/sidebars.js b/sidebars.js index 4ae2cb9d364..7ff9b007878 100644 --- a/sidebars.js +++ b/sidebars.js @@ -717,6 +717,7 @@ module.exports = { require("./docs/apis-tools/tasklist-api-rest/sidebar-schema"), require("./docs/apis-tools/web-modeler-api/sidebar-schema"), require("./docs/apis-tools/zeebe-api/sidebar-schema"), + require("./docs/apis-tools/zeebe-api-rest/sidebar-schema"), ], }, { diff --git a/src/theme/SchemaItem/index.js b/src/theme/SchemaItem/index.js new file mode 100644 index 00000000000..646cab79de3 --- /dev/null +++ b/src/theme/SchemaItem/index.js @@ -0,0 +1,22 @@ +// Why is this swizzled? +// The OpenAPI plugin does not properly handle the `additionalProperties` property on a schema -- +// it duplicates the parent description into the additional properties map, which is confusing. +// This component overrides the schema description when it looks like +// the additional properties map is being rendered. +// Swizzled from docusaurus-theme-openapi-docs version 2.0.4. + +import React from "react"; +import SchemaItem from "@theme-original/SchemaItem"; + +export default function SchemaItemWrapper(props) { + const { name, schema } = props; + if (name === "property name*" && schema.additionalProperties) { + schema.description = "Additional properties allowed."; + } + + return ( + <> + + + ); +}