Re-deploys an existing deployment.

The deployment resources to re-deploy can be restricted by using the properties resourceIds or resourceNames. If no deployment resources to re-deploy are passed then all existing resources of the given deployment are re-deployed.

Security Consideration

Deployments can contain custom code in form of scripts or EL expressions to customize process behavior. This may be abused for remote execution of arbitrary code. See the section on security considerations for custom code in the user guide for details.

Method

POST /deployment/{id}/redeploy

Parameters

Path Parameters

Name Description
id The id of the deployment to re-deploy.

Request Body

A JSON object with the following properties:

Name Description
resourceIds A list of deployment resource ids to re-deploy.
resourceNames A list of deployment resource names to re-deploy.
source Sets the source of the deployment.

Result

A JSON object corresponding to the DeploymentWithDefinitions interface in the engine.Its properties are as follows:

Name Value Description
links List Link to the newly created deployment with method, href and rel.
id String The id of the deployment.
name String The name of the deployment.
source String The source of the deployment.
tenantId String The tenant id of the deployment.
deploymentTime String The time when the deployment was created.
deployedProcessDefinitions Object A JSON Object containing a property for each of the process definitions, which are successfully deployed with that deployment. The key is the process definition id, the value is a JSON Object corresponding to the process definition, which is defined in the Process Definition resource.
deployedCaseDefinitions Object A JSON Object containing a property for each of the case definitions, which are successfully deployed with that deployment. The key is the case definition id, the value is a JSON Object corresponding to the case definition, which is defined in the Case Definition resource.
deployedDecisionDefinitions Object A JSON Object containing a property for each of the decision definitions, which are successfully deployed with that deployment. The key is the decision definition id, the value is a JSON Object corresponding to the decision definition, which is defined in the Decision Definition resource.
deployedDecisionRequirementsDefinitions Object A JSON Object containing a property for each of the decision requirements definitions, which are successfully deployed with that deployment. The key is the decision requirements definition id, the value is a JSON Object corresponding to the decision requirements definition, which is defined in the Decision Requirements Definition resource.

Response Codes

Code Media type Description
200 application/json Request successful.
404 application/json Deployment or a deployment resource for the given deployment does not exist. See the Introduction for the error response format.

Example

Request

POST /deployment/anDeploymentId/redeploy

Request Body:

  1. {
  2. "resourceIds": [ "aResourceId" ],
  3. "resourceNames": [ "aResourceName" ],
  4. "source" : "cockpit"
  5. }

Response

Status 200.

  1. {
  2. "links": [
  3. {
  4. "method": "GET",
  5. "href": "http://localhost:38080/rest-test/deployment/aDeploymentId",
  6. "rel": "self"
  7. }
  8. ],
  9. "id": "aDeploymentId",
  10. "name": "aName",
  11. "source": "cockpit",
  12. "deploymentTime": "2015-10-13T13:59:43.000+0200",
  13. "tenantId": null,
  14. "deployedProcessDefinitions": {
  15. "aProcDefId": {
  16. "id": "aProcDefId",
  17. "key": "aKey",
  18. "category": "aCategory",
  19. "description": "aDescription",
  20. "name": "aName",
  21. "version": 42,
  22. "resource": "aResourceName",
  23. "deploymentId": "aDeploymentId",
  24. "diagram": "aResourceName.png",
  25. "suspended": true,
  26. "tenantId": null,
  27. "versionTag": null
  28. }
  29. },
  30. "deployedCaseDefinitions": null,
  31. "deployedDecisionDefinitions": null,
  32. "deployedDecisionRequirementsDefinitions": null
  33. }

原文: https://docs.camunda.org/manual/7.9/reference/rest/deployment/post-redeploy-deployment/