Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result Presentation in YAML, JSON and Table #11

Open
5 tasks
Vad1mo opened this issue Feb 6, 2024 · 2 comments · May be fixed by #74
Open
5 tasks

Result Presentation in YAML, JSON and Table #11

Vad1mo opened this issue Feb 6, 2024 · 2 comments · May be fixed by #74

Comments

@Vad1mo
Copy link
Member

Vad1mo commented Feb 6, 2024

Similar to kubectl we want users of the harbor-cli users to provide the same representations and output options.

YAML, JSON, Table.

Currently, only JSON output is supported:

 ./harbor get project testproject-832165132
{
  "Payload": {
    "chart_count": 0,
    "creation_time": "2024-02-05T14:58:53.974Z",
    "current_user_role_ids": null,
    "cve_allowlist": {
      "creation_time": "0001-01-01T00:00:00.000Z",
      "id": 21,
      "items": [],
      "project_id": 20,
      "update_time": "0001-01-01T00:00:00.000Z"
    },
    "metadata": {
      "public": "true"
    },
    "name": "testproject-832165132",
    "owner_id": 20,
    "owner_name": "koenc",
    "project_id": 20,
    "repo_count": 2,
    "update_time": "2024-02-05T14:58:53.974Z"
  }
}
  • Support YAML, JSON and Table output
  • Make Table output default
  • -o wide: This parameter allows us to display extra information (if needed, otherwise -o wide should have no effect)
  • In doubt, follow kubectl approach

Bonus points

  • --sort-by: This parameter allows us to sort the output based on the resource attribute we specify.

Out of Scope

  • Support of JSONPath, or GO template.
  • -f, --field-selector==: This parameter allows us to filter the output using some resource attributes.
@Vad1mo Vad1mo changed the title Result Presentation in YAML, JSON and Tabular Result Presentation in YAML, JSON and Table Feb 6, 2024
@bishal7679
Copy link
Contributor

@Vad1mo Assign this issue to me!
Would like to give it a try

@hanshal101
Copy link

Hey @Vad1mo I would like to work on this issue.

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