文档首页/ 代码托管 CodeArts Repo/ API参考/ API/ V4/ Group/ 获取代码组继承设置项
更新时间:2025-09-29 GMT+08:00
分享

获取代码组继承设置项

功能介绍

获取代码组继承设置项

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v4/groups/{group_id}/inherit-setting

表1 路径参数

参数

是否必选

参数类型

描述

group_id

Integer

参数解释:

代码组id,代码组首页,Group ID后的数字Id

取值范围:

1-2147483647

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制:

必传。

取值范围:

字符串长度不少于1,不超过10万。

默认取值:

不涉及。

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

[数组元素]

Array of ProjectSettingsInheritCfgDto objects

代码组继承设置

表4 ProjectSettingsInheritCfgDto

参数

参数类型

描述

name

String

参数解释:

设置源类型。

约束限制:

不涉及。

取值范围:

  • protected_branches,保护分支设置。

  • protected_tags,保护Tag设置。

  • repository_settings,仓库设置。

  • push_rules,提交规则设置。

  • merge_requests,合并请求设置。

  • e2e_settings,E2E设置。

  • watermark,水印设置。

  • webhook_settings,webhook设置。

  • mr_branch_policies,合并分支策略设置。

  • reviews,检视设置。

  • deploy_keys,部署参数设置。

默认取值:

不涉及。

枚举值:

  • protected_branches

  • protected_tags

  • repository_settings

  • push_rules

  • merge_requests

  • e2e_settings

  • watermark

  • webhook_settings

  • mr_branch_policies

  • reviews

  • deploy_keys

inherit_mod

String

参数解释:

继承设置。

约束限制:

不涉及。

取值范围:

  • force_inherit,强制继承配置。

  • custom,使用当前配置。

默认取值:

不涉及。

枚举值:

  • force_inherit

  • custom

状态码:401

表5 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码。

error_msg

String

参数解释:

错误信息。

状态码:403

表6 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码。

error_msg

String

参数解释:

错误信息。

状态码:404

表7 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码。

error_msg

String

参数解释:

错误信息。

请求示例

GET https://{endpoint}/v4/groups/{group_id}/inherit-setting

响应示例

状态码:200

Get Group Inheritance Settings

[ {
  "name" : "protected_branches",
  "inherit_mod" : "custom"
}, {
  "name" : "protected_tags",
  "inherit_mod" : "custom"
}, {
  "name" : "repository_settings",
  "inherit_mod" : "inherit"
}, {
  "name" : "push_rules",
  "inherit_mod" : "inherit"
}, {
  "name" : "merge_requests",
  "inherit_mod" : "inherit"
}, {
  "name" : "e2e_settings",
  "inherit_mod" : "inherit"
}, {
  "name" : "watermark",
  "inherit_mod" : "inherit"
}, {
  "name" : "webhook_settings",
  "inherit_mod" : "inherit"
}, {
  "name" : "mr_branch_policies",
  "inherit_mod" : "inherit"
}, {
  "name" : "reviews",
  "inherit_mod" : "inherit"
}, {
  "name" : "deploy_keys",
  "inherit_mod" : "inherit"
} ]

状态码:401

Unauthorized

{
  "error_code" : "DEV.00000003",
  "error_msg" : "认证信息过期"
}

状态码:403

Bad Request

{
  "error_code" : "CH.004403",
  "error_msg" : "您没有操作权限,请升级权限后重试。"
}

状态码:404

Not Found

{
  "error_code" : "CH.004404",
  "error_msg" : "Group Not Found。Group Not Found"
}

状态码

状态码

描述

200

Get Group Inheritance Settings

401

Unauthorized

403

Bad Request

404

Not Found

错误码

请参见错误码

相关文档