Help Center> CodeArts Pipeline> API Reference> API> Project-level open source governance policy management> Querying Details About a Project-Level Open Source Governance Policy
Updated on 2023-11-28 GMT+08:00

Querying Details About a Project-Level Open Source Governance Policy

Function

Querying Details About a Project-Level Open Source Governance Policy

URI

GET /v2/{project_id}/open-source/rule-sets/{rule_set_id}/detail

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

rule_set_id

Yes

String

Policy ID.

Request Parameters

Table 2 Request header 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).

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

id

String

Policy ID.

name

String

Policy Name

level

String

Policy Level

parent_id

String

Parent Policy ID

version

String

Policy Versions

is_valid

Boolean

Enable Configuration

is_public

Boolean

Indicates whether the policy is a system-level policy.

creator

String

Created By

create_time

String

Created

updater

String

User who updated the data

update_time

String

Updated

content

OpenSourceRuleContent object

Policy Rule Details

Table 4 OpenSourceRuleContent

Parameter

Type

Description

version_set

VersionSetProperty object

Open-source dependencies

security

SecurityProperty object

Vulnerability

license

LicenseProperty object

License

Table 5 VersionSetProperty

Parameter

Type

Description

enable

Boolean

Enable Configuration

rules

Array of VersionSetRule objects

Rule list.

Table 6 VersionSetRule

Parameter

Type

Description

enable

Boolean

Health Check

ecosystem

String

Dependency Degree

package_name

String

Package name

package_version

String

Package Version

description

String

Rules

predicate

String

Comparison Rule

Table 7 SecurityProperty

Parameter

Type

Description

enable

Boolean

Enable Configuration

rules

SecurityRule object

Rule Details

Table 8 SecurityRule

Parameter

Type

Description

severity

severity object

Severity

cve

cve object

Vulnerability ID

Table 9 severity

Parameter

Type

Description

enable

Boolean

Enable Configuration

values

Array of strings

Severity

Table 10 cve

Parameter

Type

Description

enable

Boolean

Enable Configuration

values

Array of strings

Vulnerability ID

Table 11 LicenseProperty

Parameter

Type

Description

enable

Boolean

Health Check

rules

Array of rules objects

Rule list.

Table 12 rules

Parameter

Type

Description

values

Array of strings

License Details

predicate

String

Comparison Rule

Status code: 400

Table 13 Response body parameters

Parameter

Type

Description

error_msg

String

Error Message

error_code

String

Error code.

Example Requests

GET https://{endpoint}/v2/d80a8a6530324b7bac972cbb8a9f28ec/open-source/rule-sets/60eab9fd2b144f619a3563b2e0036a61/detail

Example Responses

Status code: 200

OK

{
  "id" : "60eab9fd2b144f619a3563b2e0036a61",
  "name" : "Creating an Open Source Governance Policy - 20231020154413",
  "level" : "project",
  "version" : "a108f6b1effb4b03a9505288f8801e65",
  "is_valid" : true,
  "is_public" : false,
  "creator" : "847a5317086c41798469d0868535943a",
  "create_time" : "2023-10-20T15:44:41",
  "updater" : "847a5317086c41798469d0868535943a",
  "update_time" : "2023-10-20T15:44:41",
  "content" : {
    "version_set" : {
      "enable" : true,
      "rules" : [ {
        "enable" : true,
        "ecosystem" : "Maven",
        "package_name" : "springboot",
        "package_version" : "2.5",
        "description" : "",
        "predicate" : "eq"
      } ]
    },
    "security" : {
      "enable" : true,
      "rules" : {
        "severity" : {
          "enable" : true,
          "values" : [ "Critical", "High", "Medium" ]
        },
        "cve" : {
          "enable" : false,
          "values" : [ "" ]
        }
      }
    },
    "license" : {
      "enable" : true,
      "rules" : [ {
        "predicate" : "contain",
        "values" : [ ]
      } ]
    }
  }
}

Status Codes

Status Code

Description

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.