-
Notifications
You must be signed in to change notification settings - Fork 141
[discussion]: Jobservice Dashboard Command #791
Description
What it does?
Harbor has a Jobservice dashboard that allows users to view and manage jobs that are running in the Harbor job service. It is used to view the status of job queues, the schedule of jobs, and the status of the job service pools and workers. Users can also use it to stop pending or running jobs, or pause or resume the job service queue. The jobservice command will allow users to use the features of the jobservice dashboard from the terminal.
Proposed Approach
The following is a proposed structure for the command
-
Commands
| Command | What it does |
|---|---|
harbor jobservice queue list |
List the pending jobs, latency of all the queues |
harbor jobservice queue clear <job-type> |
Clear a particular job queue |
harbor jobservice queue pause <job-type> |
Pause a particular job queue |
harbor jobservice queue resume <job-type> |
Resume a particular job queue |
harbor jobservice job stop <job-id> |
Stop a particular job |
harbor jobservice job log <job-id> |
Display logs of a particular job |
harbor jobservice pool list |
Lists all the worker pools |
harbor jobservice worker list <pool-id> |
Lists workers of a pool |
harbor jobservice queue command
harbor js queue list: list the job queues
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js queue list
┌────────────────────────────────────────────────────────────────────────┐
│ Job Type Pending Jobs Latency (s) Paused │
│ ────────────────────────────────────────────────────────────────────── │
│ AUDIT_LOGS_GDPR_COMPLIANT 0 0 Yes │
│ EXECUTION_SWEEP 0 0 No │
│ GARBAGE_COLLECTION 0 0 No │
│ IMAGE_SCAN 0 0 No │
│ P2P_PREHEAT 0 0 No │
│ PURGE_AUDIT_LOG 0 0 No │
│ REPLICATION 0 0 No │
│ RETENTION 0 0 No │
│ SCAN_DATA_EXPORT 0 0 No │
│ SCHEDULER 0 0 No │
│ SLACK 0 0 No │
│ SYSTEM_ARTIFACT_CLEANUP 0 0 No │
│ WEBHOOK 0 0 No │
└────────────────────────────────────────────────────────────────────────┘
harbor js queue clear <job-type>: to clear particular jobtype queue
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js queue clear
Select a Queue to Clear
1. All queues
2. AUDIT_LOGS_GDPR_COMPLIANT
3. EXECUTION_SWEEP
4. GARBAGE_COLLECTION
> 5. IMAGE_SCAN
6. P2P_PREHEAT
7. PURGE_AUDIT_LOG
••
↑/k up • ↓/j down • / filter • q quit • ? more
After Selection
Pending jobs in jobservice queue "IMAGE_SCAN" cleared successfully
job-type = all ,i.e harbor js queue clear all ,clears all the queues.
-
harbor js queue pause <job-type>: to pause particular jobtype queue
Same as clear -
harbor js queue resume <job-type>: to resume particular jobtype queue
Same as clear
harbor jobservice job command
harbor js job stop <job-id>: for stopping a particular job
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js job stop
Select a Running Job to Stop
> 1. IMAGE_SCAN (e2f63d0a86c8a870fd7b65c4)
2. IMAGE_SCAN (d62378849aa0b0f22b134385)
↑/k up • ↓/j down • / filter • q quit • ? more
harbor js job log <job-id>: job logging , same as the audit logging
Flags : –follow , –refresh-interval (same as current audit log) (will need research)
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js job log --follow
Following job log for "695d2d98a2486ec267f55669"... (Press Ctrl+C to stop)
2026-03-28T22:05:02Z [INFO] [/pkg/scan/job.go:396]: {
.
.
.
.
2026-03-28T22:05:02Z [INFO] [/pkg/scan/job.go:172]: Report mime types: [application/vnd.security.vulnerability.report; version=1.1]
2026-03-28T22:05:02Z [INFO] [/pkg/scan/job.go:229]: Get report for mime type: application/vnd.security.vulnerability.report; version=1.1
^C
Command for workers
harbor js pool list: list all the worker pools
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js pool list
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ Worker Pool ID Pid Started At Heartbeat At Concurrency │
│ ────────────────────────────────────────────────────────────────────────────────────── │
│ 6d8ddf7f7aa5ebe3dbf6c556 1 37 minutes ago 0 minutes ago 10 │
└────────────────────────────────────────────────────────────────────────────────────────┘
harbor js worker list <pool-id>: list workers of a particular pool
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js worker list
Select a Worker Pool
> 1. All Pools
2. bb832e2a82528670320d5f5b
↑/k up • ↓/j down • / filter • q quit • ? more
After selection
sypher@sypher845:~/Projects/harbor-cli$ ./harbor js worker list
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Worker ID Pool ID Job Name Job ID Started At Checked In At │
│ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │
│ 036a517a9802bc2490d7d10f 6d8ddf7f7aa5ebe3dbf6c556 │
│ 3760500f8bda4c68b5081a17 6d8ddf7f7aa5ebe3dbf6c556 │
│ 3b5da67e6ac12ce637492c34 6d8ddf7f7aa5ebe3dbf6c556 │
│ 3c5af0eb595d9d390ee516ee 6d8ddf7f7aa5ebe3dbf6c556 │
│ 40d994197ad4e102edd92311 6d8ddf7f7aa5ebe3dbf6c556 │
│ 470d53dd4437af8a3b122662 6d8ddf7f7aa5ebe3dbf6c556 │
│ 7efec8da93b696a012940872 6d8ddf7f7aa5ebe3dbf6c556 │
│ aed4d39e9202f611c1a3e59d 6d8ddf7f7aa5ebe3dbf6c556 │
│ b304859062562630a24e0cd2 6d8ddf7f7aa5ebe3dbf6c556 │
│ fe30604520d680ce6d91467e 6d8ddf7f7aa5ebe3dbf6c556 │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Questions
- Should we bring the “schedule” command under the jobservice command as a subcommnad, like harbor jobservice schedule, as in the UI it comes under the JS dashboard?
- Should we add a summary command for the jobservice (will require 4 API request ) ? this is present in the UI
Please have a look and suggest any required changes in the structure of the command.