mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
19f3ebd353
This patch provides a command-line tool for managing Harbor resources like users, projects, images, etc.
19 lines
508 B
Python
19 lines
508 B
Python
from harborclient import base
|
|
|
|
|
|
class TargetManager(base.Manager):
|
|
|
|
def list(self, name=None):
|
|
"""List filters targets by name."""
|
|
if name:
|
|
return self._list("/targets?name=%s" % name)
|
|
return self._list("/targets")
|
|
|
|
def ping(self, id):
|
|
"""Ping validates target."""
|
|
return self._create("/targets/%s/ping" % id)
|
|
|
|
def list_policies(self, id):
|
|
"""List the target relevant policies."""
|
|
return self._list("/targets/%s/policies" % id)
|