REST API¶
NOTE: The REST API is currently in alpha version. This means we are likely to make breaking changes in the next release. We also plan to expand the API to make more analysis information available. Contact Empear, and we are happy to share our detailed plans and get your feedback.
You can get the following information from the API:
The access user
The rest api documentation url
Project lists
Single project details
Analyses List of a project
Single analysis details
Hotspot list from an analysis, optionally you can you filter the output by numberofdefects, size, number of revisions
Architecture hotspot lists and system health for an analysis
The REST API user¶
The REST API documentation URL¶
Project lists¶
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects'
Single project details¶
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}'
Replace
{project-id}
with a valid id taken from the project list results.
Analysis List of a project¶
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses'
Replace
{project-id}
with a valid id taken from the project list results.
Single analysis details¶
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/{analysis-id}'
Replace
{project-id}
with a valid id taken from the project list results.Replace
{analysis-id}
with a valid id taken from the analysis list results.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest'
Replace
{project-id}
with a valid id taken from the project list results.
Hotspot list from an analysis¶
number_of_defects
, lines_of_code
and change_frequency
, in any combination of them.curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/{analysis-id}/hotspots'
Replace
{project-id}
with a valid id taken from the project list results.Replace
{analysis-id}
with a valid id taken from the analysis list results.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest/hotspots?change_frequency=70&lines_of_code=100'
Replace
{project-id}
with a valid id taken from the project list results.Replace
{analysis-id}
with a valid id taken from the analyses list results.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/{analysis-id}/hotspots/numberofdefectspercentage/top/15'
Replace
{project-id}
with a valid id taken from the project list results.Replace
{analysis-id}
with a valid id taken from the analyses list results.Replace 15 with whatever percentage you like.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/{analysis-id}/hotspots/changefrequencypercentage/top/25'
Replace
{project-id}
with a valid id taken from the project list results.Replace
{analysis-id}
with a valid id taken from the analysis list results.Replace 25 with whatever percentage you like.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest/hotspots'
Replace
{project-id}
with a valid id taken from the project list results.
number_of_defects >= 10 and lines_of_code => 100
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest/hotspots?number_of_defects=10&lines_of_code=100'
Replace
{project-id}
with a valid id taken from the project list results.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest/hotspots/numberofdefectspercentage/top/5'
Replace
{project-id}
with a valid id taken from the project list results.Replace 5 with whatever percentage you like.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest/hotspots/changefrequencypercentage/top/10'
Replace
{project-id}
with a valid id taken from the project list results.Replace 10 with whatever percentage you like.
Architecture hotspot lists and system health for an analysis¶
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/{analysis-id}/architecture/hotspots'
Replace
{project-id}
with a valid id taken from the project list results.Replace
{analysis-id}
with a valid id taken from the analysis list results.
curl -X GET --header 'Accept: application/json' -u username:password \
'http://localhost:3003/api/v1/projects/{project-id}/analyses/latest/architecture/hotspots'
Replace
{project-id}
with a valid id taken from the project list results.