mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-12 19:00:50 +01:00
995ce30c58
1. System level Scan All; 2. Scan An Image Artifact Signed-off-by: danfengliu <danfengl@vmware.com>
14 lines
480 B
Python
14 lines
480 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import time
|
|
import base
|
|
import v2_swagger_client
|
|
from v2_swagger_client.rest import ApiException
|
|
|
|
class Scan(base.Base):
|
|
def scan_artifact(self, project_name, repo_name, reference, expect_status_code = 202, **kwargs):
|
|
client = self._get_client(**kwargs)
|
|
data, status_code, _ = client.scan_artifact_with_http_info(project_name, repo_name, reference)
|
|
base._assert_status_code(expect_status_code, status_code)
|
|
return data
|