Skip to content

[NOTE] API "POST /projects/{project_id}/metadatas" not work properly  #23

@moooofly

Description

@moooofly

by swagger UI

image
image

by harborctl

[#677#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl project metadata add -h
This endpoint is aimed to add all metadatas for a project.

Usage:
  harborctl project metadata add [flags]

Flags:
  -a, --automatically_scan_images_on_push                        Whether scan images automatically when pushing.
  -t, --enable_content_trust                                     Whether content trust is enabled or not. If it is enabled, user cann't pull unsigned images from this project.
  -h, --help                                                     help for add
  -r, --prevent_vulnerable_images_from_running                   Whether prevent the vulnerable images from running.
  -s, --prevent_vulnerable_images_from_running_severity string   If the vulnerability is high than severity defined here, the images cann't be pulled.
  -j, --project_id int32                                         (REQUIRED) Project ID of project which will be get.
  -k, --public int32                                             The public status of the project, public(1) or private(0). (default 1)

Global Flags:
      --config string   config file (default is $HOME/, working dir (.), and ./conf dir)
[#678#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$
[#678#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl project metadata add -j 95 -k 1 -a true -t true -r true
==>  {"public":1,"enable_content_trust":true,"prevent_vulnerable_images_from_running":true,"prevent_vulnerable_images_from_running_severity":"","automatically_scan_images_on_push":true}
==> POST https://localhost/api/projects/95/metadatas
<==
<== Rsp Status: 400 Bad Request
<== Rsp Body: Invalid json request
[#679#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions