public class CodeDxClient extends Object
| Constructor and Description |
|---|
CodeDxClient(String url,
String key)
Creates a new client, ready to be used for communications with CodeDx.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildBrowsableAnalysisRunUrl(int analysisRunId) |
String |
buildLatestAnalysisRunUrl(int projectId) |
AnalysisRun |
getAnalysisRun(int id)
Retrieves a specific analysis run from CodeDx
|
List<AnalysisRun> |
getAnalysisRuns(int id)
Retrieves a list of analysis runs, for a given project, from CodeDx
|
int |
getFindingsCount(int id,
Filter filter)
Retrieves the total findings count for a given run using the provided Filter
|
int |
getFindingsCount(String id)
Retrieves the total findings count for a given run.
|
List<CountGroup> |
getFindingsGroupedCounts(int id,
Filter filter,
String countBy)
Retrieves an array of CountGroups using the provided Filter and countBy field name.
|
Job |
getJob(String id)
Retrieves a specific job from CodeDx
|
String |
getJobStatus(String id)
Retrieves a job status from CodeDx.
|
Project |
getProject(int id)
Retrieves a specific project from CodeDx
|
List<Project> |
getProjects()
Retrieves a list of projects from CodeDx.
|
Map<String,TriageStatus> |
getTriageStatuses(int id)
Retrieves all Triage statuses for a given project.
|
StartAnalysisResponse |
startAnalysis(int projectId,
InputStream[] artifacts)
Kicks off a CodeDx analysis run on a specified project
|
public CodeDxClient(String url, String key)
url - URL of the CodeDx web application. The '/api' part of the URL is optional.key - The API key. Note that permissions must be set for this key on CodeDx admin page.public String buildBrowsableAnalysisRunUrl(int analysisRunId)
public String buildLatestAnalysisRunUrl(int projectId)
public List<Project> getProjects() throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
CodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic Project getProject(int id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The project IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic Map<String,TriageStatus> getTriageStatuses(int id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The project IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic AnalysisRun getAnalysisRun(int id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The run IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic List<AnalysisRun> getAnalysisRuns(int id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The project IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic Job getJob(String id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The job IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic String getJobStatus(String id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The job IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic int getFindingsCount(String id) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The run IDCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic int getFindingsCount(int id,
Filter filter)
throws CodeDxClientException,
org.apache.http.client.ClientProtocolException,
IOException
id - The run IDfilter - A Filter object (set to null to not filter)CodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic List<CountGroup> getFindingsGroupedCounts(int id, Filter filter, String countBy) throws CodeDxClientException, org.apache.http.client.ClientProtocolException, IOException
id - The run IDfilter - A Filter objectcountBy - The field to group the counts byCodeDxClientExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionpublic StartAnalysisResponse startAnalysis(int projectId, InputStream[] artifacts) throws org.apache.http.client.ClientProtocolException, IOException, CodeDxClientException
projectId - The project IDartifacts - An array of streams to send over as analysis artifactsorg.apache.http.client.ClientProtocolExceptionIOExceptionCodeDxClientExceptionCopyright © 2004-2015. All Rights Reserved.