CCS RESTful API Documentation
Code Coverage Service provides a RESTful API to work with code coverage results stored in the CCS server.
Version: 2.0.1
BasePath:/ccaas
All rights reserved
Access
HTTP Basic Authentication
[ Jump to Models ]
Table of Contents
Ping the server to receive its' status. (pingServer )
Pinging the server returns the server settings and its' version number.
Return type
Example data
Content-Type: application/json
{
"resultsDir" : "/build/ccresults/ccaas",
"ccaasversion" : "1.1.0",
"workingDir" : "/build/ccresults",
"message" : "CRRDG7410 Successful Request - Welcome to CCS!",
"updateTimeStamp" : 1650467040259
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Server Name, Version Number
PingSerializable
Up
delete /results/{resultID}
Deletes a specified result from the repository (deleteResult )
Path parameters
resultID (required)
Path Parameter — ID of the result to delete format: UUID
Responses
200
Successful Operation
400
Entry not found
Up
get /results/download/{resultID}
Downloads the code coverage result in cczip format identified by the result ID. (downloadResult )
Path parameters
resultID (required)
Path Parameter — ID of the result to delete format: UUID
Query parameters
format (optional)
Query Parameter — Optionally define which type of code coverage results file to download.
includeSource (optional)
Query Parameter — Optionally define which type of code coverage results file to download.
Return type
byte[]
Example data
Content-Type: application/json
""
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful Operation, returning the result as a stream of bytes. If the requested result format is SonarQube or Cobertura and includeSource is true, then the stream is for a zip file. Otherwise if includeSource is false, the stream is for an xml file.
byte[]
400
Specified parameter is not valid
404
Entry not found
Up
get /results/files/{resultID}
Retrieves the specified result's details and a list of files (getFileResultByID )
Path parameters
resultID (required)
Path Parameter — ID of the result to retrieve format: UUID
Return type
Example data
Content-Type: application/json
{
"name" : "ccresult_20220420_091924",
"totalLines" : 312,
"messages" : [ "CRRDG7202W Missing test ID, generated test ID is TBND009_2021_12_16_184721_0953" ],
"totalCoveredLines" : 300,
"totalPercent" : 96,
"totalUncoveredLines" : 12,
"results" : [ {
"uncoveredLines" : 10,
"children" : [ null, null ],
"name" : "TBND009",
"messages" : [ ],
"sourceAvailable" : true,
"lines" : 288,
"percent" : 97,
"fpLineNumber" : 7,
"coveredLines" : 278,
"fileUUID" : "74743ca0-8770-4ac3-b670-fcc82926c3da"
}, {
"uncoveredLines" : 10,
"children" : [ null, null ],
"name" : "TBND009",
"messages" : [ ],
"sourceAvailable" : true,
"lines" : 288,
"percent" : 97,
"fpLineNumber" : 7,
"coveredLines" : 278,
"fileUUID" : "74743ca0-8770-4ac3-b670-fcc82926c3da"
} ],
"analyzedDate" : "Thu Dec 16 18:47:21 EST 2021",
"elapsedTime" : 2970
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful Operation
CCResultSerializable
400
Entry not found
Up
get /results/modules/{resultID}
Retrieves the specified result's details and a list of modules (getModuleResultByID )
Path parameters
resultID (required)
Path Parameter — ID of the result to retrieve format: UUID
Return type
Example data
Content-Type: application/json
{
"name" : "ccresult_20220420_091924",
"totalLines" : 312,
"messages" : [ "CRRDG7202W Missing test ID, generated test ID is TBND009_2021_12_16_184721_0953" ],
"totalCoveredLines" : 300,
"totalPercent" : 96,
"totalUncoveredLines" : 12,
"results" : [ {
"uncoveredLines" : 10,
"children" : [ null, null ],
"name" : "TBND009",
"messages" : [ ],
"sourceAvailable" : true,
"lines" : 288,
"percent" : 97,
"fpLineNumber" : 7,
"coveredLines" : 278,
"fileUUID" : "74743ca0-8770-4ac3-b670-fcc82926c3da"
}, {
"uncoveredLines" : 10,
"children" : [ null, null ],
"name" : "TBND009",
"messages" : [ ],
"sourceAvailable" : true,
"lines" : 288,
"percent" : 97,
"fpLineNumber" : 7,
"coveredLines" : 278,
"fileUUID" : "74743ca0-8770-4ac3-b670-fcc82926c3da"
} ],
"analyzedDate" : "Thu Dec 16 18:47:21 EST 2021",
"elapsedTime" : 2970
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful Operation
CCResultSerializable
400
Entry not found
Up
get /results/{resultID}
Retrieves the specified result's details (getResultByID )
Path parameters
resultID (required)
Path Parameter — ID of the result to retrieve format: UUID
Return type
Example data
Content-Type: application/json
{
"coverage" : 22,
"additionalInformation" : "CRRDG9201I Generated in a debug session.",
"shared" : true,
"fileName" : "TENX003_2021_06_01_041023_0042.cczip",
"buildName" : "ApplicationA",
"creator" : "USERA",
"level" : "LINE",
"buildTime" : "1622529824729",
"resultPath" : "/tmp/cc/TENX003_2021_06_01_041023_0042.cczip",
"buildId" : "#234",
"analyzedDate" : 1622545824729,
"tags" : "defect_4533",
"testIds" : "CDR8002",
"engineKey" : "ydy",
"uploader" : "USER45",
"name" : "TENX003_2021_06_01_041023_0042",
"id" : "4a92a3ad-b8e1-4a1b-ac10-a4ae5cce113e",
"status" : "MA==",
"elapsedTime" : 25745
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful Operation
CCResultEntrySerializable
400
Entry not found
Returns a list of results (getResults )
Returns a list of result entries in this repository
Return type
Example data
Content-Type: application/json
[ {
"coverage" : 22,
"additionalInformation" : "CRRDG9201I Generated in a debug session.",
"shared" : true,
"fileName" : "TENX003_2021_06_01_041023_0042.cczip",
"buildName" : "ApplicationA",
"creator" : "USERA",
"level" : "LINE",
"buildTime" : "1622529824729",
"resultPath" : "/tmp/cc/TENX003_2021_06_01_041023_0042.cczip",
"buildId" : "#234",
"analyzedDate" : 1622545824729,
"tags" : "defect_4533",
"testIds" : "CDR8002",
"engineKey" : "ydy",
"uploader" : "USER45",
"name" : "TENX003_2021_06_01_041023_0042",
"id" : "4a92a3ad-b8e1-4a1b-ac10-a4ae5cce113e",
"status" : "MA==",
"elapsedTime" : 25745
}, {
"coverage" : 22,
"additionalInformation" : "CRRDG9201I Generated in a debug session.",
"shared" : true,
"fileName" : "TENX003_2021_06_01_041023_0042.cczip",
"buildName" : "ApplicationA",
"creator" : "USERA",
"level" : "LINE",
"buildTime" : "1622529824729",
"resultPath" : "/tmp/cc/TENX003_2021_06_01_041023_0042.cczip",
"buildId" : "#234",
"analyzedDate" : 1622545824729,
"tags" : "defect_4533",
"testIds" : "CDR8002",
"engineKey" : "ydy",
"uploader" : "USER45",
"name" : "TENX003_2021_06_01_041023_0042",
"id" : "4a92a3ad-b8e1-4a1b-ac10-a4ae5cce113e",
"status" : "MA==",
"elapsedTime" : 25745
} ]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful operation. Returned is a list of results from this repository.
Up
put /results/{resultID}
Renames a result and returns the updated result (renameResult )
Path parameters
resultID (required)
Path Parameter — ID of the result to delete format: UUID
Query parameters
name (required)
Query Parameter — The new name to give the result
Return type
Example data
Content-Type: application/json
{
"coverage" : 22,
"additionalInformation" : "CRRDG9201I Generated in a debug session.",
"shared" : true,
"fileName" : "TENX003_2021_06_01_041023_0042.cczip",
"buildName" : "ApplicationA",
"creator" : "USERA",
"level" : "LINE",
"buildTime" : "1622529824729",
"resultPath" : "/tmp/cc/TENX003_2021_06_01_041023_0042.cczip",
"buildId" : "#234",
"analyzedDate" : 1622545824729,
"tags" : "defect_4533",
"testIds" : "CDR8002",
"engineKey" : "ydy",
"uploader" : "USER45",
"name" : "TENX003_2021_06_01_041023_0042",
"id" : "4a92a3ad-b8e1-4a1b-ac10-a4ae5cce113e",
"status" : "MA==",
"elapsedTime" : 25745
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Rename successful, the modified result is returned
CCResultEntrySerializable
400
Entry not found or missing name parameter
409
Request could not be completed due to a conflict with the current state of the resource
Request to update the repository. Returns original timestamp if the repository contents remain unchanged. If the repository contents have been changed then an updated timestamp is returned and the repository should be refreshed to update previous information that may no longer be valid. (updateRepo )
Query parameters
force (optional)
Query Parameter — If true, forces the repo to update even if no changes are detected.
Return type
Example data
Content-Type: application/json
{
"repositoryPath" : "/build57/ccresults",
"message" : "",
"updateTimeStamp" : 1650450609178,
"repositoryStats" : {
"lastRefreshAddCount" : 7,
"lastRefreshElapsedTime" : 92,
"lastRefreshSizeChange" : 4,
"updateTimeStamp" : 1650450609178,
"lastRefreshDeleteCount" : 3
},
"repoSize" : 7
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful operation
UpdateSerializable
Uploads a code coverage result to the repository (uploadResult )
Consumes
This API call consumes the following media types via the request header:
Query parameters
name (required)
Query Parameter — The name of the result to be uploaded, must end in .cczip
overwrite (optional)
Query Parameter — If true, overwrites any CCResult with the same name as the result being uploaded.
Form parameters
cczip (required)
Form Parameter — format: binary
Return type
Example data
Content-Type: application/json
{
"coverage" : 22,
"additionalInformation" : "CRRDG9201I Generated in a debug session.",
"shared" : true,
"fileName" : "TENX003_2021_06_01_041023_0042.cczip",
"buildName" : "ApplicationA",
"creator" : "USERA",
"level" : "LINE",
"buildTime" : "1622529824729",
"resultPath" : "/tmp/cc/TENX003_2021_06_01_041023_0042.cczip",
"buildId" : "#234",
"analyzedDate" : 1622545824729,
"tags" : "defect_4533",
"testIds" : "CDR8002",
"engineKey" : "ydy",
"uploader" : "USER45",
"name" : "TENX003_2021_06_01_041023_0042",
"id" : "4a92a3ad-b8e1-4a1b-ac10-a4ae5cce113e",
"status" : "MA==",
"elapsedTime" : 25745
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Successful Operation. The following result was added to the repository
CCResultEntrySerializable
400
Entry not found - Missing name parameter, name must end with .cczip or name must not contain a path
409
File already exists. If you would like to overwrite this file please re-upload it with the overwrite variable set to true.
415
I/O error occured while saving the contents to a cczip file. Format of the CCZip is invalid.
500
Internal server error
[ Jump to Methods ]
Table of Contents
CCResultEntrySerializable
CCResultSerializable
CCTreeItemSerializable
DownloadFormatType
PingSerializable
UpdateSerializable
UpdateSerializable_repositoryStats
results_upload_body
id (optional)
example: 4a92a3ad-b8e1-4a1b-ac10-a4ae5cce113e
name (optional)
example: TENX003_2021_06_01_041023_0042
status (optional)
byte[] Status for this entry's code coverage level format: byte
example: [B@4e430b5
coverage (optional)
Integer The amount of coverage for this entry in percent
example: 22
level (optional)
String The type of coverage being evaluated for this entry
LINE
example: LINE
elapsedTime (optional)
Long The time in milliseconds used during code coverage collection format: int64
example: 25745
testIds (optional)
example: CDR8002
tags (optional)
example: defect_4533
analyzedDate (optional)
Long The date this entry was analyzed format: int64
example: 1622545824729
additionalInformation (optional)
String Any additional information associated with this entry, including errors and warnings.
example: CRRDG9201I Generated in a debug session.
resultPath (optional)
String The path to the result associated with this entry
example: /tmp/cc/TENX003_2021_06_01_041023_0042.cczip
fileName (optional)
String The name of the file associated with this entry
example: TENX003_2021_06_01_041023_0042.cczip
buildId (optional)
String The ID of the build associated with this entry
example: #234
buildName (optional)
String The name of the build associated with this entry
example: ApplicationA
buildTime (optional)
String Timestamp of when the build associated with this entry finished
example: 1622529824729
engineKey (optional)
String Engine key associated with this entry
example: ydy
creator (optional)
String The user id that generated the code coverage result
example: USERA
uploader (optional)
String The user id that uploaded this entry
example: USER45
shared (optional)
Boolean whether or not the entry is shared with other users
example: true
name (optional)
String The name of the CC Result
example: ccresult_20220420_091924
totalCoveredLines (optional)
example: 300
totalUncoveredLines (optional)
Integer The number of uncovered lines
example: 12
elapsedTime (optional)
example: 2970
totalLines (optional)
Integer The total number of executable lines
example: 312
totalPercent (optional)
Integer The percent of code that has been covered as indicated by the analysis
example: 96
analyzedDate (optional)
String Date the analysis was done on this result
example: Thu Dec 16 18:47:21 EST 2021
results (optional)
messages (optional)
example: ["CRRDG7202W Missing test ID, generated test ID is TBND009_2021_12_16_184721_0953"]
name (optional)
String The name of this tree item
example: TBND009
percent (optional)
Integer Percent of code coverage for this tree item
example: 97
coveredLines (optional)
Integer Number of lines hit by code coverage
example: 278
uncoveredLines (optional)
Integer Number of lines not hit by code coverage
example: 10
lines (optional)
Integer Total number of executable lines
example: 288
children (optional)
messages (optional)
array[String] The array of messages associated with this tree item
example: []
sourceAvailable (optional)
Boolean true if source is available, false otherwise and by default.
example: true
fileUUID (optional)
String The unique ID attached to the source file associated with this tree item.
example: 74743ca0-8770-4ac3-b670-fcc82926c3da
fpLineNumber (optional)
Integer The line number of the flow point associated with this tree item.
example: 7
The format for the download
message (optional)
String Any messages associated with the ping
example: CRRDG7410 Successful Request - Welcome to CCS!
ccaasversion (optional)
String The version number of the CCS server.
example: 1.1.0
workingDir (optional)
String The path to the working directory
example: /build/ccresults
resultsDir (optional)
String The path to the directory containing the results
example: /build/ccresults/ccaas
updateTimeStamp (optional)
Long The timestamp of the last update for this server format: int64
example: 1650467040259
updateTimeStamp (optional)
Long The time stamped when the update was completed. format: int64
example: 1650450609178
message (optional)
String A message associated with the update
repoSize (optional)
Integer The number of entries in this repository
example: 7
repositoryPath (optional)
String The path that points to this repository
example: /build57/ccresults
repositoryStats (optional)
The statistics for the repository associated with the update
updateTimeStamp (optional)
Long Time stamp for the occurrence of the update format: int64
example: 1650450609178
lastRefreshElapsedTime (optional)
example: 92
lastRefreshAddCount (optional)
example: 7
lastRefreshDeleteCount (optional)
example: 3
lastRefreshSizeChange (optional)
example: 4
cczip
byte[] CCZip to upload as a stream of bytes. The uploaded content will be verified to ensure it is in proper cczip format. format: binary