Package: camundactl
camundactlcamundactl (cctl) is a command line interface (cli) that interacts with the camunda rest api. It provides commands for all endpoints with the ability to filtes and different output format. The cli usaged is heavily inspired bykubeclto work with kubernetes.Featuresrequest all endpoints, defined in the camunda openapi.jsongenerateget,deleteandapplycommands from openapi.jsondedicated implementations fordescribemultiple output formats:table,json,jsonpath,template(jinja2)shell autocomplete forzsh,bash,fish)shell autocomplete for processInstanceId, incidentIds, aso.configuration for multipe camunda engines...ContentsExamplesInstallationConfigurationFormatAdd/Select/List/Remove EngineAutocompleteUsageGlobal OptionsgetCommanddescribeCommanddeleteCommandapplyCommandconfigCommandoutputOptionExamplesLoad two active process instances and use only the columns id and suspended$cctlgetprocessInstances--max-results2-otable-oHid,suspended
idsuspended
-----------------------------------------------
0027da48-0a61-11ec-bd5f-0242ac120014False
003248e7-0b05-11ec-990f-0242ac12000dFalseLoad all active process instances and use the result in a jinja2 template.$cctlgetprocessInstances-otemplate-oT'{{result|length}}'1337Load five active process instances and apply jsonpath formatting.$cctlgetprocessInstances-ojsonpath-oJ'$.[*].id'--max-results50027da48-0a61-11ec-bd5f-0242ac120014
003248e7-0b05-11ec-990f-0242ac12000d
005ec7db-0a6c-11ec-bd5f-0242ac120014
00957ceb-0b18-11ec-990f-0242ac12000d
00f522c0-0b10-11ec-990f-0242ac12000dLoad only one active process instance and ouput as json.$cctlgetprocessInstances-ojson--max-results1[{"links":[],"id":"0027da48-0a61-11ec-bd5f-0242ac120014","definitionId":"f87b25ce-0577-11ec-8801-0242ac12000a","businessKey":null,"caseInstanceId":null,"ended":false,"suspended":false,"tenantId":null}]Pipe commands together. Get all active process instances by process defintion and delete them:$cctlgetprocessInstances--process-definition-idf87b25ce-0577-11ec-8801-0242ac12000a-ojsonpath-oJ"$.[*].id"|xargs-n1cctldeleteprocessInstance-otemplate-oT"Ok"Ok
Ok
Ok
...Installationcamundactl can be installed via pip.$pipinstallcamundactlConfigurationcamundactl uses a config file. The locations differ from os. If the configuration file does not it exists, it becomes created.MacOS:$HOME/Libarary/Application Support/camundactl/config.ymlLinux:$HOME/.config/camundactl/config.ymlWindows:$HOME/Appdata/Local/camundactl/config.ymlFormatversion:beta1extra_paths:-module.to.my.plugincurrent_engine:localhostengines:-name:localhosturl:http://localhost:8080/engine-restauth:user:camundapassword:camunda-name:client-aurl:http://localhost:8080/engine-restauth:user:camundapassword:camunda-name:client-curl:https://localhost:8080/engine-restverify:falseauth:user:camundapassword:camundaversiondefines the current config file version for later update purposeextra_pathis a list of python modules that can be autodiscovered in command discovering to add user defined commands or pluginscurrent_engineis the currently selected engine to be usedenginecontains a list of engines within you can switch witchcctl config engines activate ANOTHER.namethe engines display nameurlthe urls of the camunda engine rest apiauthis an object ofuserandpasswordfor basic authenticationverifyis a boolen that ignores ssl verification (defaulttrue)Add/List/Activate/Remove EnginesAdd an engineAdd a camunda engine to the list of engines and directly select it.$cctlconfigenginesaddlocalhttp://localhost:8080/engine-rest--selectList all enginesList all engines that are configured. The*indicates the currently selected engine.$cctlconfigengineslslocal*
client-aActivate an engineActivates theclient-aengine.$cctlconfigenginesactivateclient-aRemove an engineRemoves theclient-aengine.$cctlconfigenginesremoveclient-aAutocompletecamundactl provides the functionality to autocomplete at the console.camundactl bases onclick, which
autocomplete method could be used.Example for zsh$_CCTL_COMPLETE=zsh_sourcecctl>$HOME/.cctl-completion.shYou can find more Details on the project-page:https://click.palletsprojects.com/en/8.0.x/shell-completion/UsageGloabl options--help
--log
-e, --enginegetResource InformationGet commands provides the ability to request ressource information from a given engine. It contains all OpenAPI Operations of the Verbget.deleteResource InformationDelete commands provide the ability to delete specific ressources in the camunda engine.applyResource InformationApply commands provide the ability to apply changes to the camunda engine. They combine the functionality ofputandpostverbs and these operations.Askubectlyou can useapplyin combination with files that contains the payload.You can use JSON or YAML payloads.$catEOF>>
value:hello-world
type:String
EOF>>variable.yaml

$cctlapplyprocessInstanceVariablefoobar0027da48-0a61-11ec-bd5f-0242ac120014-yvariable.ymlSchema validationIf provided, the given payload becomes validated against the openapi schema. The openapi documentation sometimes does not fully match the api. (e.g. while updating variables. The values is describes asobjectbut values of primitive variables are also allowed.)To skip this use the option--skip-validation.describeResource Informationnot quite implemented. It's planned to use this commands to collect and output complex informationations about a given ressoure including combining multiple endpoints (e.g. process instances with all occured incidents and variable information.)outputOptionThe-o/--outputoption defines the output format. The default isttable. All other options are described in the following.Table OutputThe camunda responses are nearly all of typeapplication/json. If the response is of typearraya table will be printed. If it's anobjecta table withkeyandvalueheaders are used.Options-o table-oH,--output-headersgives the possibility to select the columns to show-oCL,--output-cell-lengthcell values of type string are limited to40characters.Example$cctlgetprocessInstances-otable-oHid,suspendedJSON OutputPrints the json API response with end indent of 2.Options-o jsonJSON-Path Output-o jsonpathactivates a jsonpath output. With-oJyou can apply the jsonpath filter which will be applied.
For thisjsonpath-ngis used. There you can find further information about the filter format.Template OutputRaw Outputroot command$python-mcamundactl--help

Usage:__main__.py[OPTIONS]COMMAND[ARGS]...

Options:-l,--log-levelTEXTactivatestheloggerwiththegivenlevel-e,--engineTEXTdefinetheenginenametobeused--helpShowthismessageandexit.

Commands:deletedescribegetdelete command$python-mcamundactldelete--help

Usage:__main__.pydelete[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:attachmentRemovesanattachmentfromataskby...deploymentDeletesadeploymentbyid.processDefinitionDeletesarunningprocessinstanceby...processDefinitionsByKeyDeletesprocessdefinitionsbyagiven...processDefinitionsByKeyAndTenantIdDeletesprocessdefinitionsbyagiven...processInstanceDeletesarunningprocessinstanceby...processInstanceVariableDeletesavariableofaprocess...taskRemovesataskbyid.taskLocalVariableRemovesalocalvariablefromatask...taskVariableRemovesavariablethatisvisibleto...get command$python-mcamundactlget--help

Usage:__main__.pyget[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:activityInstanceTreeRetrievesanActivity...activityStatisticsRetrievesruntime...activityStatisticsByProcessDefinitionKeyRetrievesruntime...activityStatisticsByProcessDefinitionKeyAndTenantIdRetrievesruntime...attachmentRetrievesatask...attachmentDataRetrievesthebinary...attachmentsGetstheattachments...commentRetrievesatask...commentsGetsthecommentsfor...deployedFormRetrievesthe...deployedStartFormRetrievesthe...deployedStartFormByKeyRetrievesthe...deployedStartFormByKeyAndTenantIdRetrievesthe...deploymentRetrievesa...deploymentResourceRetrievesa...deploymentResourceDataRetrievesthebinary...deploymentResourcesRetrievesall...deploymentsCountQueriesforthe...eventSubscriptionsQueriesforevent...eventSubscriptionsCountQueriesforthe...externalTaskRetrievesanexternal...externalTaskErrorDetailsRetrievestheerror...externalTasksQueriesforthe...externalTasksCountQueriesforthe...formRetrievestheform...formVariablesRetrievestheform...identityLinksGetstheidentity...intervalRetrievesalistof...latestProcessDefinitionByTenantIdRetrievesthelatest...metricsRetrievesthe`sum`...processDefinitionRetrievesaprocess...processDefinitionBpmn20XmlRetrievestheBPMN...processDefinitionBpmn20XmlByKeyRetrieveslatest...processDefinitionBpmn20XmlByKeyAndTenantIdRetrieveslatest...processDefinitionByKeyRetrievesthelatest...processDefinitionDiagramRetrievesthediagram...processDefinitionDiagramByKeyRetrievesthediagram...processDefinitionDiagramByKeyAndTenantIdRetrievesthediagram...processDefinitionStatisticsRetrievesruntime...processDefinitionsQueriesforprocess...processDefinitionsCountRequeststhenumber...processEngineNamesRetrievesthenames...processInstancelistsallactive...processInstanceVariableRetrievesavariable...processInstanceVariableBinaryRetrievesthecontent...processInstanceVariablesRetrievesall...processInstancesQueriesforprocess...processInstancesCountQueriesforthe...renderedFormRetrievesthe...renderedStartFormRetrievesthe...renderedStartFormByKeyRetrievesthe...renderedStartFormByKeyAndTenantIdRetrievesthe...restAPIVersionRetrievestheversion...schemaLogQueriesforschema...startFormRetrievesthekeyof...startFormByKeyRetrievesthekeyof...startFormByKeyAndTenantIdRetrievesthekeyof...startFormVariablesRetrievesthestart...startFormVariablesByKeyRetrievesthestart...startFormVariablesByKeyAndTenantIdRetrievesthestart...taskRetrievesataskby...taskLocalVariableRetrievesavariable...taskLocalVariableBinaryRetrievesabinary...taskLocalVariablesRetrievesall...taskVariableRetrievesavariable...taskVariableBinaryRetrievesabinary...taskVariablesRetrievesall...tasksQueriesfortasks...tasksCountRetrievesthenumber...topicNamesQueriesfordistinct...autocomplete_CCTL_COMPLETE=zsh_source cctlTODO / Ideasoutput column length in options or parameter (currently hard 40)displaylist of stringslist of objectsobject with keysobject with one valueuse template loader to save and load templates somewhere and let use use them or save some for defaulttemplates with more context variables. not just "result"