Help Center/ CodeArts Pipeline/ API Reference/ API/ Rule Management/ Obtaining Details About a Single Rule
Updated on 2024-07-04 GMT+08:00

Obtaining Details About a Single Rule

Function

This API is used to query details about a single rule.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{domain_id}/rules/{rule_id}/detail

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Tenant ID.

rule_id

Yes

String

Rule ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

id

String

Rule ID.

type

String

Rule type.

name

String

Rule name.

version

String

Rule version.

layout_content

String

Layout content.

plugin_id

String

Extension ID.

plugin_name

String

Extension name.

plugin_version

String

Extension version.

creator

String

Creator.

create_time

String

Creation time.

updater

String

Updater.

update_time

String

Update time.

content

Array of RuleContent objects

Rule attribute list.

Table 4 RuleContent

Parameter

Type

Description

group_name

String

Group name.

can_modify_when_inherit

Boolean

Whether thresholds of an inherited policy can be modified.

properties

Array of RuleProperty objects

Rule attribute list.

Table 5 RuleProperty

Parameter

Type

Description

key

String

Attribute key.

type

String

Type.

name

String

Display name.

operator

String

Comparison operators.

value

String

Attribute value.

value_type

String

Data type.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

GET https://{endpoint}/v2/ce8df55870164338a72d7e828a966a2a/rules/865b4c2d616b46ab890fff056a6f7e05/detail

Example Responses

Status code: 200

Request succeeded.

{
  "id" : "865b4c2d616b46ab890fff056a6f7e05",
  "type" : "Build",
  "name" : "New Rule-20231020103003",
  "version" : "e2db2a63b3064252874b1b5a8571e2be",
  "plugin_id" : "official_devcloud_cloudBuild",
  "plugin_name" : "official_devcloud_cloudBuild",
  "plugin_version" : "0.0.15",
  "content" : [ {
    "group_name" : "MavenUnitTest",
    "can_modify_when_inherit" : true,
    "properties" : [ {
      "key" : "build.PassRatio",
      "type" : "judge",
      "name" : "PassRatio",
      "value_type" : "float",
      "value" : "0.1",
      "operator" : "="
    }, {
      "key" : "build.TotalCases",
      "type" : "judge",
      "name" : "TotalCases",
      "value_type" : "float",
      "value" : "0.1",
      "operator" : "="
    }, {
      "key" : "build.CoverageRatio",
      "type" : "judge",
      "name" : "CoverageRatio",
      "value_type" : "float",
      "value" : "0.1",
      "operator" : "="
    } ]
  } ],
  "creator" : "847a5317086c41798469d0868535943a",
  "create_time" : "2023-10-20T10:30:20",
  "updater" : "847a5317086c41798469d0868535943a",
  "update_time" : "2023-10-20T10:30:20"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Request failed.

401

Authentication failed.

403

No permission.

404

Resource not found.

Error Codes

See Error Codes.