更新时间:2024-08-22 GMT+08:00
分享

查询策略详情

功能介绍

查询策略详情

调用方法

请参见如何调用API

URI

GET /v2/{cloudProjectId}/rule-sets/{ruleSetId}/detail

表1 路径参数

参数

是否必选

参数类型

描述

cloudProjectId

String

项目ID

ruleSetId

String

策略ID

请求参数

响应参数

状态码: 200

表2 响应Body参数

参数

参数类型

描述

data

Array of SimpleRuleSetVO objects

数据

total

Long

总数

表3 SimpleRuleSetVO

参数

参数类型

描述

id

String

策略ID

name

String

策略名称

level

String

范围标识: tenant -- 租户,其他 -- 非租户

is_valid

Boolean

是否生效,true-生效,false-不生效

version

String

规则模板版本

operator

String

最近操作人员

is_public

Boolean

是否为系统策略

is_legacy

Boolean

是否为1.0数据

operate_time

Integer

最近操作时间

请求示例

GET https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/rule-sets/842cacd3424a470eb410300b537fa756/detail

响应示例

状态码: 200

查询策略详情响应体

{
  "id" : "842cacd3424a470eb410300b537fa756",
  "name" : "创建策略-20240625194201",
  "level" : "project",
  "version" : "efaddbfff5c742f781802004b888eccb",
  "is_valid" : true,
  "is_public" : false,
  "creator" : "05d8ca972f114765a8984795a8aa4d41",
  "create_time" : "2024-06-25 19:42:07",
  "updater" : "05d8ca972f114765a8984795a8aa4d41",
  "update_time" : "2024-06-25 19:42:07",
  "rule_instances" : [ {
    "id" : "46db451f3a204a9cafdebf820968041f",
    "type" : "Gate",
    "name" : "代码检查-通过",
    "is_valid" : true,
    "version" : "3f13237656524cc48dd4e8f2e489b060",
    "plugin_id" : "official_devcloud_codeCheck",
    "plugin_name" : "official_devcloud_codeCheck",
    "plugin_version" : "0.0.4",
    "content" : [ {
      "group_name" : "检查缺陷统计",
      "can_modify_when_inherit" : true,
      "editable" : true,
      "properties" : [ {
        "key" : "codecheck.deadly",
        "type" : "judge",
        "name" : "致命",
        "value_type" : "float",
        "value" : "0",
        "operator" : ">=",
        "is_valid" : true
      }, {
        "key" : "codecheck.important",
        "type" : "judge",
        "name" : "严重",
        "value_type" : "float",
        "value" : "0",
        "operator" : ">=",
        "is_valid" : true
      }, {
        "key" : "codecheck.common",
        "type" : "judge",
        "name" : "一般",
        "value_type" : "float",
        "value" : "0",
        "operator" : ">=",
        "is_valid" : true
      }, {
        "key" : "codecheck.prompt",
        "type" : "judge",
        "name" : "提示",
        "value_type" : "float",
        "value" : "0",
        "operator" : ">=",
        "is_valid" : true
      }, {
        "key" : "new_issue_count",
        "type" : "judge",
        "name" : "问题总数",
        "value_type" : "float",
        "value" : "0",
        "operator" : ">=",
        "is_valid" : true
      } ]
    } ],
    "creator" : "05d8ca972f114765a8984795a8aa4d41",
    "create_time" : "2024-05-27 10:57:12",
    "updater" : "05d8ca972f114765a8984795a8aa4d41",
    "update_time" : "2024-05-27 10:57:12"
  }, {
    "id" : "df6f4de49cf14d738ce34ec63e5039ff",
    "type" : "Test",
    "name" : "测试-通过",
    "is_valid" : true,
    "version" : "17258d9993b44a7db86d36e51b2e3b1c",
    "plugin_id" : "official_devcloud_apiTest",
    "plugin_name" : "official_devcloud_apiTest",
    "plugin_version" : "0.0.1",
    "content" : [ {
      "group_name" : "API测试通过率门禁",
      "can_modify_when_inherit" : true,
      "editable" : true,
      "properties" : [ {
        "key" : "pass_ratio",
        "type" : "judge",
        "name" : "api测试通过率",
        "value_type" : "float",
        "value" : "0",
        "operator" : ">=",
        "is_valid" : true
      } ]
    } ],
    "creator" : "05d8ca972f114765a8984795a8aa4d41",
    "create_time" : "2024-05-27 11:01:39",
    "updater" : "05d8ca972f114765a8984795a8aa4d41",
    "update_time" : "2024-05-27 11:01:39"
  } ]
}

状态码

状态码

描述

200

查询策略详情响应体

错误码

请参见错误码

相关文档