Skip to content

feat: added jobservice pools, workers, jobs subcommand#796

Open
NishchayRajput wants to merge 1 commit intogoharbor:mainfrom
NishchayRajput:feat/jobservice-workers-pools-jobs-subcommand
Open

feat: added jobservice pools, workers, jobs subcommand#796
NishchayRajput wants to merge 1 commit intogoharbor:mainfrom
NishchayRajput:feat/jobservice-workers-pools-jobs-subcommand

Conversation

@NishchayRajput
Copy link
Copy Markdown

Description

Briefly describe what this pull request does and why the change is needed.

This PR adds the remaining jobservice subcommands under harbor jobservice for workers, worker pools, and job logs.
It improves CLI parity with the Harbor Job Service dashboard by exposing worker pool listing, worker listing with pagination, and job log viewing from the CLI.

Type of Change

Please select the relevant type.

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Chore / maintenance

Changes

  • Added worker pool command group support: pools list.
  • Added worker command group support: workers list, workers free, workers free-all.
  • Added job log command support: jobs log.
  • Added jobservice API handlers and rendering helpers for pools, workers, and job logs.

Command and Flag Behavior

Commands added

  • harbor jobservice pools list
  • harbor jobservice workers list
  • harbor jobservice workers free
  • harbor jobservice workers free-all
  • harbor jobservice jobs log

Supported flags by command

  • harbor jobservice pools list

    • no pools-specific flags
    • supports global --output-format json|yaml
  • harbor jobservice workers list

    • --pool <pool-id|all>
    • --all
    • --pool-all (compatibility alias)
    • --page
    • --page-size
    • supports a positional [POOL_ID] for backward compatibility
    • supports global --output-format json|yaml
  • harbor jobservice workers free

    • --job-id (required)
  • harbor jobservice workers free-all

    • no workers-specific flags
  • harbor jobservice jobs log

    • --job-id (required)

Default behavior

  • workers list defaults to all pools when no pool selector is provided.
  • workers list defaults to page 1 and page-size 20.
  • workers list paginates in the CLI because the backend API only accepts pool_id.
  • workers free stops the single job identified by --job-id.
  • workers free-all stops all running jobs to free busy workers.
  • jobs log prints the selected job log and returns a clear empty-state message when no log content is available.

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@NucleoFusion
Copy link
Copy Markdown
Contributor

Can you convert this to a draft, since this would cause conflicts with the other PR #795
And we can wait till the other gets merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Implementing Jobservice Dashboard in CLI

2 participants