moooofly / harborctl

A CLI tool for the Docker Registry Harbor. This project offer a command-line interface to the Harbor API, you can use it to manager your users, projects, repositories, etc. (This project aims to refactor harbor-go-client based on Harbor v1.6.0)
MIT License
28 stars 6 forks source link

[NOTE] How to trigger a specific replication #35

Open moooofly opened 6 years ago

moooofly commented 6 years ago

by harborctl

[#1084#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl policy replication get -i 1
==> GET https://localhost/api/policies/replication/1
<==
<== Rsp Status: 200 OK
<== Rsp Body: {
  "id": 1,
  "name": "sync-to-somewhere",
  "description": "",
  "filters": null,
  "replicate_deletion": false,
  "trigger": {
    "kind": "Manual",
    "schedule_param": null
  },
  "projects": [
    {
      "project_id": 10,
      "owner_id": 1,
      "name": "temp_9",
      "creation_time": "2018-11-02T06:58:29Z",
      "update_time": "2018-11-02T06:58:29Z",
      "deleted": false,
      "owner_name": "",
      "togglable": false,
      "current_user_role_id": 0,
      "repo_count": 0,
      "metadata": {
        "public": "true"
      }
    }
  ],
  "targets": [
    {
      "id": 1,
      "endpoint": "http://11.11.11.22",
      "name": "fake endpoint",
      "username": "admin",
      "password": "",
      "type": 0,
      "insecure": true,
      "creation_time": "2018-11-07T14:42:31.876842Z",
      "update_time": "2018-11-07T14:42:31.876842Z"
    }
  ],
  "creation_time": "2018-11-07T14:43:11Z",
  "update_time": "2018-11-07T14:43:11Z",
  "replicate_existing_image_now": false,
  "error_job_count": 5
}
[#1085#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$

[#1085#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl replication trigger -i 1
==> POST https://localhost/api/replications
<==
<== Rsp Status: 200 OK
<== Rsp Body:
[#1086#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$
moooofly commented 6 years ago

UPDATE: