forked from camunda/camunda-bpm-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(openapi): add historic batch endpoints
Related to CAM-11556
- Loading branch information
Showing
13 changed files
with
674 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
engine-rest/engine-rest-openapi/src/main/templates/lib/commons/historic-batch-params.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/batch/get-query/index.html --> | ||
|
||
<#assign sortByValues = [ | ||
'"batchId"', | ||
'"startTime"', | ||
'"endTime"', | ||
'"tenantId"' | ||
]> | ||
|
||
|
||
<#assign params = { | ||
"batchId": { | ||
"type": "string", | ||
"desc": "Filter by batch id." | ||
}, | ||
"type": { | ||
"type": "string", | ||
"desc": "Filter by batch type. See the | ||
[User Guide](${docsUrl}/user-guide/process-engine/batch/#creating-a-batch) | ||
for more information about batch types." | ||
}, | ||
"completed": { | ||
"type": "boolean", | ||
"desc": " | ||
Filter completed or not completed batches. If the value is | ||
`true`, only completed batches, i.e., end time is set, are | ||
returned. Otherwise, if the value is `false`, only running | ||
batches, i.e., end time is null, are returned." | ||
}, | ||
"tenantIdIn": { | ||
"type": "array", | ||
"itemType": "string", | ||
"desc": "Filter by a comma-separated list of tenant ids. A batch matches if it has one of the given | ||
tenant ids." | ||
}, | ||
"withoutTenantId": { | ||
"type": "boolean", | ||
"desc": "Only include batches which belong to no tenant. Value can effectively only be `true`, as `false` is the default behavior." | ||
} | ||
}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...s/org/camunda/bpm/engine/rest/dto/history/batch/CleanableHistoricBatchReportResultDto.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/batch/get-cleanable-batch-report/index.html --> | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto > | ||
|
||
<@lib.property | ||
name = "batchType" | ||
type = "string" | ||
desc = "The type of the batch operation." | ||
/> | ||
|
||
<@lib.property | ||
name = "historyTimeToLive" | ||
type = "integer" | ||
format = "int32" | ||
desc = "The history time to live of the batch operation." | ||
/> | ||
|
||
<@lib.property | ||
name = "finishedBatchesCount" | ||
type = "integer" | ||
format = "int64" | ||
desc = "The count of the finished batch operations." | ||
/> | ||
|
||
<@lib.property | ||
name = "cleanableBatchesCount" | ||
type = "integer" | ||
format = "int64" | ||
desc = "The count of the cleanable historic batch operations, referring to history time to | ||
live." | ||
last = true | ||
/> | ||
|
||
</@lib.dto> | ||
</#macro> |
109 changes: 109 additions & 0 deletions
109
.../main/templates/models/org/camunda/bpm/engine/rest/dto/history/batch/HistoricBatchDto.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/batch/get-query/index.html --> | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto > | ||
|
||
<@lib.property | ||
name = "id" | ||
type = "string" | ||
desc = "The id of the batch." | ||
/> | ||
|
||
<@lib.property | ||
name = "type" | ||
type = "string" | ||
desc = "The type of the batch. See the | ||
[User Guide](${docsUrl}/user-guide/process-engine/batch/#creating-a-batch) | ||
for more information about batch types." | ||
/> | ||
|
||
<@lib.property | ||
name = "totalJobs" | ||
type = "integer" | ||
format = "int32" | ||
desc = " | ||
The total jobs of a batch is the number of batch execution | ||
jobs required to complete the batch. | ||
" | ||
/> | ||
|
||
<@lib.property | ||
name = "batchJobsPerSeed" | ||
type = "integer" | ||
format = "int32" | ||
desc = " | ||
The number of batch execution jobs created per seed job invocation. | ||
The batch seed job is invoked until it has created all batch | ||
execution jobs required by the batch (see `totalJobs` property). | ||
" | ||
/> | ||
|
||
<@lib.property | ||
name = "invocationsPerBatchJob" | ||
type = "integer" | ||
format = "int32" | ||
desc = " | ||
Every batch execution job invokes the command executed by the batch | ||
`invocationsPerBatchJob` times. E.g., for a process instance | ||
migration batch this specifies the number of process instances | ||
which are migrated per batch execution job. | ||
" | ||
/> | ||
|
||
<@lib.property | ||
name = "seedJobDefinitionId" | ||
type = "string" | ||
desc = "The job definition id for the seed jobs of this batch." | ||
/> | ||
|
||
<@lib.property | ||
name = "monitorJobDefinitionId" | ||
type = "string" | ||
desc = "The job definition id for the monitor jobs of this batch." | ||
/> | ||
|
||
<@lib.property | ||
name = "batchJobDefinitionId" | ||
type = "string" | ||
desc = "The job definition id for the batch execution jobs of this batch." | ||
/> | ||
|
||
<@lib.property | ||
name = "tenantId" | ||
type = "string" | ||
desc = "The tenant id of the batch." | ||
/> | ||
|
||
<@lib.property | ||
name = "createUserId" | ||
type = "string" | ||
desc = "The batch creator's user id." | ||
/> | ||
|
||
<@lib.property | ||
name = "startTime" | ||
type = "string" | ||
format = "date-time" | ||
desc = "The time the batch was started. Default format `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. | ||
For further information, please see the [documentation](${docsUrl}/reference/rest/overview/date-format/)" | ||
/> | ||
|
||
<@lib.property | ||
name = "endTime" | ||
type = "string" | ||
format = "date-time" | ||
desc = "The time the batch ended. Default format `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. | ||
For further information, please see the [documentation](${docsUrl}/reference/rest/overview/date-format/)" | ||
/> | ||
|
||
<@lib.property | ||
name = "removalTime" | ||
type = "string" | ||
format = "date-time" | ||
desc = "The time after which the historic batch should be removed by the History Cleanup | ||
job. Default format `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. | ||
For further information, please see the [documentation](${docsUrl}/reference/rest/overview/date-format/)" | ||
last = true | ||
/> | ||
|
||
</@lib.dto> | ||
</#macro> |
20 changes: 20 additions & 0 deletions
20
.../templates/models/org/camunda/bpm/engine/rest/dto/history/batch/HistoricBatchQueryDto.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto | ||
desc = "Query for the historic batches to set the removal time for." > | ||
|
||
<#include "/lib/commons/historic-batch-params.ftl" > | ||
|
||
<@lib.properties params/> | ||
"sorting": { | ||
"type": "array", | ||
"description": "An array of criteria to sort the result by. Each element of the array is | ||
an object that specifies one ordering. The position in the array | ||
identifies the rank of an ordering, i.e., whether it is primary, secondary, | ||
etc. Has no effect for the `/count` endpoint", | ||
"items": | ||
<#assign last = true> | ||
<#include "/lib/commons/sort-props.ftl"> | ||
} | ||
|
||
</@lib.dto> | ||
</#macro> |
22 changes: 22 additions & 0 deletions
22
...unda/bpm/engine/rest/dto/history/batch/removaltime/SetRemovalTimeToHistoricBatchesDto.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/batch/post-batch-set-removal-time/index.html --> | ||
<#macro dto_macro docsUrl=""> | ||
<@lib.dto extends="AbstractSetRemovalTimeDto"> | ||
|
||
<@lib.property | ||
name = "historicBatchQuery" | ||
type = "object" | ||
dto = "HistoricBatchQueryDto" | ||
desc = "Query for the historic batches to set the removal time for." | ||
/> | ||
|
||
|
||
<@lib.property | ||
name = "historicBatchIds" | ||
type = "array" | ||
itemType = "string" | ||
desc = "The ids of the historic batches to set the removal time for." | ||
last = true | ||
/> | ||
|
||
</@lib.dto> | ||
</#macro> |
53 changes: 53 additions & 0 deletions
53
...-rest-openapi/src/main/templates/paths/history/batch/cleanable-batch-report/count/get.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/batch/get-cleanable-batch-report-count/index.html --> | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "getCleanableHistoricBatchesReportCount" | ||
tag = "Historic Batch" | ||
summary = "Get Cleanable Batch Report Count" | ||
desc = "Queries for the number of report results about a historic batch operations relevant | ||
to history cleanup (see | ||
[History cleanup](${docsUrl}/user-guide/process-engine/history/#history-cleanup) | ||
). | ||
Takes the same parameters as the | ||
[Get Cleanable Batch Report](${docsUrl}/reference/rest/history/batch/get-cleanable-batch-report/) | ||
method." | ||
/> | ||
|
||
"parameters" : [ | ||
|
||
<#assign last = false > | ||
<#include "/lib/commons/sort-params.ftl"> | ||
<#assign last = true > | ||
<#include "/lib/commons/pagination-params.ftl"> | ||
|
||
], | ||
|
||
"responses": { | ||
|
||
<@lib.response | ||
code = "200" | ||
dto = "CountResultDto" | ||
desc = "Request successful." | ||
examples = ['"example-1": { | ||
"summary": "GET `/history/batch/cleanable-batch-report/count`", | ||
"description": "GET `/history/batch/cleanable-batch-report/count`", | ||
"value": { | ||
"count": 10 | ||
} | ||
}'] | ||
/> | ||
|
||
<@lib.response | ||
code = "500" | ||
dto = "ExceptionDto" | ||
desc = "See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." | ||
last = true | ||
/> | ||
|
||
} | ||
|
||
} | ||
</#macro> |
77 changes: 77 additions & 0 deletions
77
...engine-rest-openapi/src/main/templates/paths/history/batch/cleanable-batch-report/get.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/batch/get-cleanable-batch-report/index.html --> | ||
<#macro endpoint_macro docsUrl=""> | ||
{ | ||
<@lib.endpointInfo | ||
id = "getCleanableHistoricBatchesReport" | ||
tag = "Historic Batch" | ||
summary = "Get Cleanable Batch Report" | ||
desc = "Retrieves a report about a historic batch operations relevant to history cleanup | ||
(see | ||
[History cleanup](${docsUrl}/user-guide/process-engine/history/#history-cleanup) | ||
) so that you can tune the history time to live. | ||
These reports include the count of the finished batches, cleanable | ||
batches and type of the batch. | ||
The size of the result set can be retrieved by using the | ||
[Get Cleanable Batch Report Count](${docsUrl}/reference/rest/history/batch/get-cleanable-batch-report-count/) | ||
method. | ||
|
||
**Please note:** | ||
The history time to live for batch operations does not support [Multi-Tenancy](${docsUrl}/user-guide/process-engine/multi-tenancy.md). | ||
The report will return an information for all batch operations (for all tenants) if you have permissions | ||
to see the history. | ||
" | ||
/> | ||
|
||
"parameters" : [ | ||
<#assign sortByValues = [ | ||
'"finished"' | ||
]> | ||
<#assign last = false > | ||
<#include "/lib/commons/sort-params.ftl"> | ||
<#assign last = true > | ||
<#include "/lib/commons/pagination-params.ftl"> | ||
|
||
], | ||
|
||
"responses": { | ||
|
||
<@lib.response | ||
code = "200" | ||
dto = "CleanableHistoricBatchReportResultDto" | ||
array = true | ||
desc = "Request successful." | ||
examples = ['"example-1": { | ||
"summary": "GET `/history/batch/cleanable-batch-report`", | ||
"description": "GET `/history/batch/cleanable-batch-report` | ||
|
||
An array containing finished batches information relevant to history cleanup.", | ||
"value": [ | ||
{ | ||
"batchType": "instance-modification", | ||
"historyTimeToLive": 5, | ||
"finishedBatchCount": 100, | ||
"cleanableBatchCount": 53 | ||
}, | ||
{ | ||
"batchType": "instance-deletion", | ||
"historyTimeToLive": 5, | ||
"finishedBatchCount": 1000, | ||
"cleanableBatchCount": 13 | ||
} | ||
] | ||
}'] | ||
/> | ||
|
||
<@lib.response | ||
code = "500" | ||
dto = "ExceptionDto" | ||
desc = "See the | ||
[Introduction](${docsUrl}/reference/rest/overview/#error-handling) | ||
for the error response format." | ||
last = true | ||
/> | ||
|
||
} | ||
|
||
} | ||
</#macro> |
Oops, something went wrong.