mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* Add create, show, and cancel subcommands to mmctl job The `mmctl job` command previously only supported `list` and `update`. This adds three subcommands backed by existing client methods: - `job create [type] [--data k=v]` triggers a new job (CreateJob) - `job show [job]` displays a single job (GetJob) - `job cancel [job]` requests cancellation via the dedicated cancel endpoint (CancelJob), which uses the create-job permission and emits its own audit event, unlike `update [job] cancel_requested` Also fixes the leftover "import jobs" wording in the `list` flag help and regenerates the mmctl docs. * Exercise --data flag parsing in mmctl job create test The create-job test passed the Data map as the flag's default value, so GetStringToString returned the default without ever exercising pflag's stringToString parser. Declare the flag empty and Set the value explicitly so the test validates the real parse path. * Don't gate mmctl job create on model.AllJobTypes model.AllJobTypes (which IsValidJobType checks against) is a curated subset that omits creatable job types such as access_control_sync, so validating the type client-side wrongly rejected jobs the server can schedule. Drop the client-side check and let the server validate the type per its create-job permissions; it returns a clear error for anything unschedulable. Tab-completion still suggests AllJobTypes as an advisory hint. * Remove explanatory AllJobTypes comments from mmctl job * Add e2e tests for mmctl job create, show, and cancel Cover the no-permission, not-found, and success paths for the new generic job subcommands against a running server, mirroring the existing export job e2e tests. --------- Co-authored-by: Hanzo Dev <[email protected]>
46 lines
1.4 KiB
ReStructuredText
46 lines
1.4 KiB
ReStructuredText
.. _mmctl_job:
|
|
|
|
mmctl job
|
|
---------
|
|
|
|
Management of jobs
|
|
|
|
Synopsis
|
|
~~~~~~~~
|
|
|
|
|
|
Management of jobs
|
|
|
|
Options
|
|
~~~~~~~
|
|
|
|
::
|
|
|
|
-h, --help help for job
|
|
|
|
Options inherited from parent commands
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
::
|
|
|
|
--config string path to the configuration file (default "$XDG_CONFIG_HOME/mmctl/config")
|
|
--disable-pager disables paged output
|
|
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
|
|
--insecure-tls-version allows to use TLS versions 1.0 and 1.1
|
|
--json the output format will be in json format
|
|
--local allows communicating with the server through a unix socket
|
|
--quiet prevent mmctl to generate output for the commands
|
|
--strict will only run commands if the mmctl version matches the server one
|
|
--suppress-warnings disables printing warning messages
|
|
|
|
SEE ALSO
|
|
~~~~~~~~
|
|
|
|
* `mmctl <mmctl.rst>`_ - Remote client for the Open Source, self-hosted Slack-alternative
|
|
* `mmctl job cancel <mmctl_job_cancel.rst>`_ - Cancel a job
|
|
* `mmctl job create <mmctl_job_create.rst>`_ - Create a new job
|
|
* `mmctl job list <mmctl_job_list.rst>`_ - List the latest jobs
|
|
* `mmctl job show <mmctl_job_show.rst>`_ - Show a job
|
|
* `mmctl job update <mmctl_job_update.rst>`_ - Update the status of a job
|
|
|