13.2. Deployment REST API

The kieModule jar files can be deployed or undeployed using the UI or REST API calls. This section details about the REST API deployment calls and their components.

Note

Configuration options like the runtime strategy should be defined before deploying the JAR files and cannot be changed post deployment.
A standard regular expression for a deploymentid call is:
  	[\w\.-]+(:[\w\.-]+){2,2}(:[\w\.-]*){0,2}
Where the "\w" refers to a character set that can contain the following character sets:
  • [A-Z]
  • [a-z]
  • [0-9]
  • _
  • .
  • -
Following are the elements of a Deployment ID and are separated from each other by a (:) character:
  1. Group Id
  2. Artifact Id
  3. Version
  4. kbase Id (optional)
  5. ksession Id (optional)

13.2.1. Asynchronous calls

Deployment calls perform 2 [POST] asynchronous REST operations:
  1. /deployment/{deploymentId}/deploy
  2. /deployment/{deploymentId}/undeploy
Asynchronous calls can allow a user to issue a request and jump to the next task before the previous task in the queue is finished. So the information received after posting a call does not reflect the actual state or eventual status of the operation. This returns a status 202 upon the completion of the request which says that "The request has been accepted for processing, but the processing has not been completed.".
This even means that:
  • The posted request would have been successfully accepted but the actual operation (deploying or undeploying the deployment unit) may have failed.
  • The deployment information retrieved on calling the GET operations may even have changed (including the status of the deployment unit).

13.2.2. Deployment calls

The following deployment calls are provided:
/deployment/
returns a list of all available deployed instances [GET]
/deployment/{deploymentId}
returns a JaxbDeploymentUnit instance containing the information (including the configuration) of the deployment unit [GET]
/deployment/{deploymentId}/deploy
deploys the deployment unit which is referenced by the deploymentid and returns a JaxbDeploymentJobResult instance with the status of the request [POST]
/deployment/{deploymentId}/undeploy
Undeploys the deployment unit referenced by the deploymentId and returns a JaxbDeploymentJobResult instance with the status of the request [POST]

Note

The deploy and undeploy operations can fail if one of the following is true:
  • An identical job has already been submitted to the queue and has not yet completed.
  • The amount of (deploy/undeploy) jobs submitted but not yet processed exceeds the job cache size.