Creating a Tenant-Level Open Source Governance Policy
Function
Creating a Tenant-Level Open Source Governance Policy
URI
POST /v2/{domain_id}/tenant/open-source/rule-sets/create
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
domain_id |
Yes |
String |
Indicates the tenant ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Can be obtained by calling the IAM API for obtaining the user token (the value of X-Subject-Token in the response header). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Open Source Governance Policy Name |
content |
Yes |
OpenSourceRuleContent object |
Open Source Governance Policy Rule Details |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version_set |
No |
VersionSetProperty object |
Open-source dependencies |
security |
No |
SecurityProperty object |
Vulnerability |
license |
No |
LicenseProperty object |
License |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Enable Configuration |
rules |
No |
Array of VersionSetRule objects |
Rule list. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Health Check |
ecosystem |
No |
String |
Dependency Degree |
package_name |
No |
String |
Package name |
package_version |
No |
String |
Package Version |
description |
No |
String |
Rules |
predicate |
No |
String |
Comparison Rule |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Enable Configuration |
rules |
No |
SecurityRule object |
Rule Details |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
severity |
No |
severity object |
Severity |
cve |
No |
cve object |
Vulnerability ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Enable Configuration |
values |
No |
Array of strings |
Severity |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Enable Configuration |
values |
No |
Array of strings |
Vulnerability ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Health Check |
rules |
No |
Array of rules objects |
Rule list. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
status |
Boolean |
Status |
rule_set_id |
String |
Rule Set ID |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error Message |
error_code |
String |
Error code. |
Example Requests
POST https://{endpoint}/v2/ce8df55870164338a72d7e828a966a2a/tenant/open-source/rule-sets/create { "name" : "Creating an Open Source Governance Policy - 20231020180239", "content" : { "version_set" : { "enable" : true, "rules" : [ { "ecosystem" : "Maven", "package_name" : "sboot", "predicate" : "eq", "package_version" : "1.1", "description" : "", "enable" : true } ] }, "security" : { "enable" : true, "rules" : { "severity" : { "enable" : false, "values" : [ ] }, "cve" : { "enable" : false, "values" : [ "" ] } } }, "license" : { "enable" : true, "rules" : [ { "values" : [ ], "predicate" : "contain" } ] } } }
Example Responses
Status code: 200
OK
{ "status" : true, "rule_set_id" : "1ea8a33ca6d64efab19a99057625a14d" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.