Package io.jenkins.plugins.harbor.client
Class HarborClientImpl
- java.lang.Object
-
- io.jenkins.plugins.harbor.client.HarborClientImpl
-
- All Implemented Interfaces:
HarborClient
public class HarborClientImpl extends Object implements HarborClient
-
-
Constructor Summary
Constructors Constructor Description HarborClientImpl(String baseUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean isSkipTlsVerify, boolean debugLogging)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Artifact
getArtifact(String projectName, String repositoryName, String reference, Map<String,String> extraParams)
Get the specific artifactString
getPing()
Ping Harbor to check if it's alive.NativeReportSummary
getVulnerabilitiesAddition(String projectName, String repositoryName, String reference)
Get the vulnerabilities addition of the specific artifactRepository[]
listAllRepositories()
List all authorized repositoriesArtifact[]
listArtifacts(String projectName, String repositoryName, Map<String,String> extraParams)
-
-
-
Constructor Detail
-
HarborClientImpl
public HarborClientImpl(String baseUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, boolean isSkipTlsVerify, boolean debugLogging) throws NoSuchAlgorithmException, KeyManagementException
-
-
Method Detail
-
getVulnerabilitiesAddition
public NativeReportSummary getVulnerabilitiesAddition(String projectName, String repositoryName, String reference)
Description copied from interface:HarborClient
Get the vulnerabilities addition of the specific artifactGet the vulnerabilities addition of the artifact specified by the reference under the project and repository.
- Specified by:
getVulnerabilitiesAddition
in interfaceHarborClient
- Parameters:
projectName
- The project name of HarborrepositoryName
- The name ofreference
- The reference can be digest or tag.
-
getPing
public String getPing() throws IOException
Description copied from interface:HarborClient
Ping Harbor to check if it's alive.This API simply replies a pong to indicate the process to handle API is up, disregarding the health status of dependent components.
- Specified by:
getPing
in interfaceHarborClient
- Returns:
- If the request succeeds, the 'Pong' string is returned
- Throws:
IOException
- The HTTP request failed
-
listAllRepositories
public Repository[] listAllRepositories() throws IOException
Description copied from interface:HarborClient
List all authorized repositories- Specified by:
listAllRepositories
in interfaceHarborClient
- Returns:
- Return to the list of repositories
- Throws:
IOException
-
listArtifacts
public Artifact[] listArtifacts(String projectName, String repositoryName, @Nullable Map<String,String> extraParams) throws HarborException, IOException
- Specified by:
listArtifacts
in interfaceHarborClient
- Throws:
HarborException
IOException
-
getArtifact
public Artifact getArtifact(String projectName, String repositoryName, String reference, @Nullable Map<String,String> extraParams) throws IOException
Description copied from interface:HarborClient
Get the specific artifactGet the artifact specified by the reference under the project and repository. The reference can be digest or tag.
- Specified by:
getArtifact
in interfaceHarborClient
- Returns:
- Artifact Return artifact information
- Throws:
IOException
- The HTTP request failed
-
-