harbor_cli.harbor.artifact
Attributes
AttrType = TypeVar('AttrType')
module-attribute
Classes
ArtifactName
Bases: NamedTuple
Source code in harbor_cli/harbor/artifact.py
Attributes
domain: str | None
instance-attribute
project: str
instance-attribute
repository: str
instance-attribute
reference: str
instance-attribute
Functions
parse_artifact_name(s: str) -> ArtifactName
Splits an artifact string into domain name (optional), project, repo, and reference (tag or digest).
Raises ValueError if the string is not in the correct format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s |
str
|
Artifact string in the form of [domain/] |
required |
Returns:
Type | Description |
---|---|
ArtifactName
|
Named tuple of domain name (optional), project, repo, and reference (tag or digest). |
Source code in harbor_cli/harbor/artifact.py
get_artifact_architecture(artifact: Artifact) -> str | None
get_artifact_os(artifact: Artifact) -> str | None
get_artifact_severity(artifact: Artifact) -> str | None
Attempt to get the severity string for an artifact. Not every artifact has a scan overview, and not every scan overview has a severity string.