Rapid Models Statistics Module API Definition
This API definition facilitates auditing static analysis alerts using classifiers, optional adaptive heuristics, and alert prioritization. The API enables jump-starting labeled datasets using test suites. It is intended to enable a wide range of users (with widely varying datasets, static analysis tools, machine learning expertise, and amount of labeled data) to benefit from using classifiers and sophisticated prioritization to automatically triage static analysis alerts.
Version: 0.0.4
BasePath:
Software Engineering Institute - Copyright (c) 2007-2019 Carnegie Mellon University. All Rights Reserved.
http://apache.org/licenses/LICENSE-2.0.html
Access
[ Jump to Models ]
Table of Contents
Up
put /projects/{project_id}/packages/{package_id}/alerts
Forward new Alerts that have been uploaded to the DataHub and have a current open adaptive heuristic request for its respective package. Returns status message for the DataHub to track if the request was completed. (sendAlertUpdatesForClassifier)
Path parameters
project_id (required)
Path Parameter — The id of the project associated with these alerts
package_id (required)
Path Parameter — The id of the package associated with these alerts
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — Updated alert data
Request headers
Return type
Example data
Content-Type: application/json
{
"project_id" : "project_id",
"package_id" : "package_id"
}
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
OK
alert_updates_response
400
Unable to Upload Alerts
404
Invalid Package
default
Unexpected Error
error
Up
put /packages/tools/{tool_id}
Send FFSA or code metrics tool info to the Stats Module. When a new tool is uploaded, the DataHub can send new tool info for packages with open adaptive heuristic requests automatically to keep the Stats Module in sync. (sendNewTool)
Path parameters
tool_id (required)
Path Parameter — The id of the tool uploaded to the DataHub
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — Tool info, including name, version, plus FFSA checker info OR code metrics field info and package ids associated with this new tool.
Request headers
Return type
Integer
Example data
Content-Type: application/json
0
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
OK
Integer
400
Unable to Upload Tool Information
default
Unexpected Error
error
Provides Server Status (getStatus)
Request headers
Return type
Example data
Content-Type: application/json
{
"message" : "message",
"request_id" : "request_id"
}
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 Is Running
request_token
400
Database Connection Lost
default
Unexpected Error
error
Up
put /classifiers/{classifier_instance_id}/adaptive_heuristics/close
Stop adaptive heuristic forward request. Send a request to close (set to false) the adaptive heuristic for the packages listed in the classifier instance. (closeAdaptiveHeuristicDataForwarding)
Path parameters
classifier_instance_id (required)
Path Parameter — The id of the classifier instance to run on the target domain
Consumes
This API call consumes the following media types via the request header:
Request headers
Return type
Example data
Content-Type: application/json
{
"message" : "message",
"classifier_instance_id" : "classifier_instance_id"
}
Responses
200
OK
close_adaptive_heuristics_response
400
Invalid Close Request
404
Classifier Instance Unavailable
default
Unexpected Error
error
Create a new classifier instance. Send Classifier information including Automated Hyper-Parameter Optimization (AHPO) and Adaptive Heuristics to the Stats Module along with package_ids for packages to use in creating/training a classifier. Returns an id that is used to then run the classifier and any additional information for the classifier. (createClassifierInstance)
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — Classifier information to create
Request headers
Return type
Example data
Content-Type: application/json
{
"analysis_messages" : "{}",
"project_id" : "project_id",
"classifier_instance_id" : "classifier_instance_id"
}
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
OK
create_classifier_response
400
Unable to Create Classifier
default
Unexpected Error
error
Up
delete /classifiers/{classifier_instance_id}
Delete a specific classifier from the Stats module by classifier_instance_id. (deleteClassifierInstance)
Path parameters
classifier_instance_id (required)
Path Parameter — The id of the classifier to delete
Consumes
This API call consumes the following media types via the request header:
Request headers
Return type
Example data
Content-Type: application/json
{
"message" : "message",
"request_id" : "request_id"
}
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
Classifier Successfully Deleted
request_token
400
Invalid Request
404
Unable to Delete Classifier
default
Unexpected Error
error
Up
put /classifiers/{classifier_instance_id}
Edit a specific classifier from the Stats module by classifier_instance_id. (editClassifierInstance)
Path parameters
classifier_instance_id (required)
Path Parameter — The id of the classifier instance to edit
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — Classifier information to edit
Request headers
Return type
Example data
Content-Type: application/json
{
"analysis_messages" : "{}",
"project_id" : "project_id",
"classifier_instance_id" : "classifier_instance_id"
}
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
OK
create_classifier_response
400
Unable to Edit Classifier
404
Invalid Request
default
Unexpected Error
error
Up
get /classifiers/{classifier_instance_id}
Get analysis for a specific Classifier including performance metrics. (getClassifierInstanceAnalysis)
Path parameters
classifier_instance_id (required)
Path Parameter — The id of the classifier to get analysis info
Consumes
This API call consumes the following media types via the request header:
Request headers
Return type
Example data
Content-Type: application/json
{
"classifier_analysis" : "{}",
"classifier_instance_id" : "classifier_instance_id"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/json
text/html
Responses
200
OK
analysis_results
404
Classifier Information Unavailable
default
Unexpected Error
error
List all classifiers and their associated data. Use the ids returned from this request to work with classifiers. (listClassifiers)
Consumes
This API call consumes the following media types via the request header:
Request headers
Return type
Example data
Content-Type: application/json
[ {
"classifier_id" : "classifier_id",
"adaptive_heuristics" : [ {
"adaptive_heuristic_name" : "adaptive_heuristic_name",
"adaptive_heuristic_id" : "adaptive_heuristic_id",
"adaptive_heuristic_parameters" : "{}"
} ],
"ahpos" : [ {
"ahpo_id" : "ahpo_id",
"ahpo_name" : "ahpo_name",
"ahpo_parameters" : "{}"
} ],
"classifier_name" : "classifier_name"
}, {
"classifier_id" : "classifier_id",
"adaptive_heuristics" : [ {
"adaptive_heuristic_name" : "adaptive_heuristic_name",
"adaptive_heuristic_id" : "adaptive_heuristic_id",
"adaptive_heuristic_parameters" : "{}"
} ],
"ahpos" : [ {
"ahpo_id" : "ahpo_id",
"ahpo_name" : "ahpo_name",
"ahpo_parameters" : "{}"
} ],
"classifier_name" : "classifier_name"
} ]
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
OK
404
Classifiers Unavailable
default
Unexpected Error
error
Up
put /classifiers/{classifier_instance_id}/retrain
Returns new probability values if there are updates from the selected classifier_instance. (retrain)
Path parameters
classifier_instance_id (required)
Path Parameter — The id of the classifier instance to run on the target domain
Consumes
This API call consumes the following media types via the request header:
Request body
Body Parameter — Information to send close adaptive heuristic request
Request headers
Return type
Example data
Content-Type: application/json
{
"probability_data" : [ {
"probability" : 0.8008281904610115,
"meta_alert_id" : "meta_alert_id"
}, {
"probability" : 0.8008281904610115,
"meta_alert_id" : "meta_alert_id"
} ],
"project_id" : "project_id",
"classifier_analysis" : "{}",
"classifier_instance_id" : "classifier_instance_id"
}
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
OK
classifier_results
400
Unable to Run Classifier
404
Invalid Request
default
Unexpected Error
error
Up
put /classifiers/{classifier_instance_id}/projects/{project_id}
Run a specific classifier instance on the project identified by id in the path. The response contains estimated class probablities and analysis of classifier performance. (runClassifierInstance)
Path parameters
classifier_instance_id (required)
Path Parameter — The id of the classifier instance to run on the target domain
project_id (required)
Path Parameter — The id of the project containing the packages
Consumes
This API call consumes the following media types via the request header:
Request headers
Return type
Example data
Content-Type: application/json
{
"probability_data" : [ {
"probability" : 0.8008281904610115,
"meta_alert_id" : "meta_alert_id"
}, {
"probability" : 0.8008281904610115,
"meta_alert_id" : "meta_alert_id"
} ],
"project_id" : "project_id",
"classifier_analysis" : "{}",
"classifier_instance_id" : "classifier_instance_id"
}
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
OK
classifier_results
400
Unable to Run Classifier
404
Invalid Request
default
Unexpected Error
error
[ Jump to Methods ]
Table of Contents
alert -
alert_updates_response -
analysis_results -
checker_mappings -
classifier_instance -
classifier_instance_data -
classifier_results -
classifier_results_probability_data -
close_adaptive_heuristics_response -
condition -
condition_languages -
create_classifier_response -
determination -
determination_dangerous_construct_list -
determination_dead_list -
determination_flag_list -
determination_ignored_list -
determination_inapplicable_environment_list -
determination_notes_list -
determination_verdict_list -
error -
list_classifiers_response -
list_classifiers_response_adaptive_heuristics -
list_classifiers_response_ahpos -
message -
meta_alert -
multiple_alerts -
packages_with_tool_data -
packages_with_tool_data_tool_data -
request_token -
source_mappings -
secondary_message -
alert_id
tool_id
checker_id
primary_message
secondary_messages (optional)
project_id (optional)
package_id (optional)
classifier_instance_id (optional)
classifier_analysis (optional)
checker_id (optional)
checker_name (optional)
tool_id (optional)
conditions (optional)
classifier_id
classifier_type (optional)
classifier_instance_name (optional)
project_ids
ahpo_id (optional)
ahpo_parameters (optional)
adaptive_heuristic_id (optional)
adaptive_heuristic_parameters (optional)
project_id
String The id of the target project to run the classifier on
timestamp
Date The current time format: date-time
classifier_instance_id (optional)
project_id
String ID of project in the target domain
probability_data
classifier_analysis (optional)
meta_alert_id (optional)
probability (optional)
classifier_instance_id (optional)
message (optional)
condition_id (optional)
condition_name (optional)
title (optional)
platforms (optional)
condition_fields (optional)
Object Fields associated with this condition, i.e., likelihood
condition (optional)
language_ids (optional)
classifier_instance_id (optional)
project_id (optional)
analysis_messages (optional)
Object Additional information that will help to understand this classifier instance's performance
flag_list (optional)
verdict_list (optional)
ignored_list (optional)
dead_list (optional)
inapplicable_environment_list (optional)
dangerous_construct_list (optional)
notes_list (optional)
dangerous_construct (optional)
timestamp (optional)
dead (optional)
timestamp (optional)
flag (optional)
timestamp (optional)
ignored (optional)
timestamp (optional)
inapplicable_environment (optional)
timestamp (optional)
notes (optional)
timestamp (optional)
verdict (optional)
timestamp (optional)
classifier_id (optional)
classifier_type (optional)
ahpos (optional)
adaptive_heuristics (optional)
adaptive_heuristic_id (optional)
adaptive_heuristic_name (optional)
adaptive_heuristic_parameters (optional)
ahpo_id (optional)
ahpo_name (optional)
ahpo_parameters (optional)
line_start
line_end (optional)
filepath
meta_alert_id
condition_id (optional)
filepath (optional)
line_number (optional)
determination (optional)
alert_ids (optional)
auto_verdict (optional)
meta_alerts (optional)
alerts (optional)
package_ids (optional)
tool_data (optional)
tool_name (optional)
tool_version (optional)
tool_type (optional)
source_mappings (optional)
code_metrics_data (optional)
request_id
String Id used to correlate messages with each other
message (optional)
mapping_source (optional)
checker_mappings (optional)
line_start
line_end (optional)
filepath
message_text