Add new rule with either file info or rule info.
Note: Value for detectionCriteria is an array of string Eg. detectionCriteria: ["filepath1 or folderpath1","filepath2 or folderpath2"].
Parameters fileInfo and ruleInfo are mutually exclusive. Only users with Library Manager role can create rules.
Security
bearerAuth
Add new rule.
url
Example:"https://www.flexera.com/"
asFoundLicenseText
Example:"Sample from file LICENSE.txt in file @file in the materials"
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/rules
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/rules
curl -i -X POST \
https://codeinsightapi.redocly.app/_mock/swagger/rules \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"inventoryName": "Custom Inventory Name",
"componentId": 1,
"versionId": 1,
"licenseId": 1,
"licenseExpression": "7 OR 20",
"licenseIds": [
7,
20
],
"description": "description",
"url": "https://www.flexera.com/",
"noticesText": "Sample Notices Text",
"auditNotes": "Sample Audit Notes",
"asFoundLicenseText": "Sample from file LICENSE.txt in file @file in the materials",
"fileInfo": [
{
"name": "fileName",
"md5": "md5"
}
],
"ruleInfo": [
{
"detectionType": "filePath",
"detectionCriteria": "[filepath]"
}
]
}'