Skip to content
代码片段 群组 项目

Update GitLab docs to 16.2- 0821

已合并 Qi Zhao requested to merge update_gitlab_docs_to_16.2 into main-jh
24 文件
+ 1038
31
比较变更
  • 并排
  • 内联
文件
24
@@ -14,6 +14,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - 自定义 HTTP headers API 一般可用于 15.3 版本。功能标志 `streaming_audit_event_headers` 已删除。
> - 用户指定的验证令牌 API 支持引入于 15.4 版本。
> - 用于实例级流目的地的自定义 HTTP header 的 API 引入于 16.1 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 功能标志 `ff_external_audit_events` 默认启用于极狐GitLab 16.2。
> - 对用户指定的目的名称 API 的支持引入于极狐GitLab 16.2。
您可以使用 GraphQL API 维护审计事件流目的地。
@@ -38,6 +40,7 @@ mutation {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
@@ -56,6 +59,26 @@ mutation {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
name
}
}
}
}
```
您可以选择使用 GraphQL `externalAuditEventDestinationCreate` 变更指定您自己的目标名称(而不是默认的极狐GitLab 生成的名称)。名称长度不得超过 72 个字符,并且不会删掉尾部空格。该值对群组来说应该是唯一的。例如:
```graphql
mutation {
externalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest", name: "destination-name-here", groupPath: "my-group" }) {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
@@ -85,10 +108,11 @@ mutation {
### 添加实例级流目的地
> 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 功能标志 `ff_external_audit_events` 默认启用于极狐GitLab 16.2。
FLAG:
在私有化部署版上,此功能默认不可用。要使其可用,需要管理员[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 SaaS 版上,此功能可用。此功能尚未准备好用于生产。
在私有化部署版上,此功能默认启用。如果要禁用此功能,管理员可以[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 JiHuLab.com 上,此功能可用,但只能由 JiHuLab.com 管理员配置。此功能已经准备好用于生产。
先决条件:
@@ -103,6 +127,7 @@ mutation {
instanceExternalAuditEventDestination {
destinationUrl
id
name
verificationToken
}
}
@@ -114,6 +139,22 @@ mutation {
- 返回的 `errors` 对象为空。
- API 响应 `200 OK`
您可以选择使用 GraphQL `instanceExternalAuditEventDestinationCreate` 变更指定您自己的目标名称(而不是默认的极狐GitLab 生成的名称)。名称长度不得超过 72 个字符,并且不会删除尾部空格。该值应该是唯一的。例如:
```graphql
mutation {
instanceExternalAuditEventDestinationCreate(input: { destinationUrl: "https://mydomain.io/endpoint/ingest", name: "destination-name-here"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
name
verificationToken
}
}
}
```
实例管理员可以使用 GraphQL `auditEventsStreamingInstanceHeadersCreate` mutation 添加 HTTP header。您可以通过[列出实例的所有流传输目的地](#list-streaming-destinations)或从上面的 mutation 中检索目的地 ID。
```graphql
@@ -136,6 +177,38 @@ mutation {
如果返回的 `errors` 对象为空,则创建 header。
### Google Cloud Logging 流
> 引入于极狐GitLab 16.1。
先决条件:
- 顶级群组的所有者角色。
- 具有创建服务账号和启用 Google Cloud Logging 所需权限的 Google Cloud 项目。
要启用流并添加配置,请使用 GraphQL API 中的 `googleCloudLoggingConfigurationCreate` 变更。
```graphql
mutation {
googleCloudLoggingConfigurationCreate(input: { groupPath: "my-group", googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events" } ) {
errors
googleCloudLoggingConfiguration {
id
googleProjectIdName
logIdName
privateKey
clientEmail
}
errors
}
}
```
如果满足以下条件,则启用事件流:
- 返回的 `errors` 对象为空。
- API 响应 `200 OK`
<a id="list-streaming-destinations"></a>
## 列出流目的地
@@ -159,6 +232,7 @@ query {
destinationUrl
verificationToken
id
name
headers {
nodes {
key
@@ -177,10 +251,11 @@ query {
### 列出实例级流目的地
> 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 功能标志 `ff_external_audit_events` 默认启用于极狐GitLab 16.2。
FLAG:
在私有化部署版上,此功能默认不可用。要使其可用,需要管理员[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 SaaS 版上,此功能可用。此功能尚未准备好用于生产。
在私有化部署版上,此功能默认启用。如果想禁用此功能,管理员可以[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 JiHuLab.com 上,此功能可用,但只能由 JiHuLab.com 管理员配置。此功能已经准备好用于生产。
先决条件:
@@ -193,6 +268,7 @@ query {
instanceExternalAuditEventDestinations {
nodes {
id
name
destinationUrl
verificationToken
headers {
@@ -211,6 +287,37 @@ query {
您需要此查询返回的 ID 值来进行更新和删除 mutation。
### Google Cloud Logging 配置
> 引入于极狐GitLab 16.1。
先决条件:
- 顶级群组的所有者角色。
您可以使用 `googleCloudLoggingConfigurations` 查询类型查看顶级群组的流配置列表。
```graphql
query {
group(fullPath: "my-group") {
id
googleCloudLoggingConfigurations {
nodes {
id
logIdName
googleProjectIdName
privateKey
clientEmail
}
}
}
}
```
如果结果列表为空,则不会为该群组启用审核流。
您需要此查询返回的 ID 值来更新和删除变更。
<a id="update-streaming-destinations"></a>
## 更新流目的地
@@ -227,8 +334,20 @@ query {
```graphql
mutation {
externalAuditEventDestinationDestroy(input: { id: destination }) {
externalAuditEventDestinationUpdate(input: {
id:"gid://gitlab/AuditEvents::ExternalAuditEventDestination/1",
destinationUrl: "https://www.new-domain.com/webhook",
name: "destination-name"} ) {
errors
externalAuditEventDestination {
id
name
destinationUrl
verificationToken
group {
name
}
}
}
}
```
@@ -252,10 +371,11 @@ mutation {
### 更新实例级流目的地
> 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 功能标志 `ff_external_audit_events` 默认启用于极狐GitLab 16.2。
FLAG:
在私有化部署版上,此功能默认不可用。要使其可用,需要管理员[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 SaaS 版上,此功能可用。此功能尚未准备好用于生产。
在私有化部署版上,此功能默认启用。如果想禁用此功能,管理员可以[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 JiHuLab.com 上,此功能可用,但只能由 JiHuLab.com 管理员配置。此功能已经准备好用于生产。
先决条件:
@@ -265,11 +385,15 @@ FLAG:
```graphql
mutation {
instanceExternalAuditEventDestinationUpdate(input: { id: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/1", destinationUrl: "https://www.new-domain.com/webhook"}) {
instanceExternalAuditEventDestinationUpdate(input: {
id: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/1",
destinationUrl: "https://www.new-domain.com/webhook",
name: "destination-name"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
name
verificationToken
}
}
@@ -298,6 +422,38 @@ mutation {
如果返回的 `errors` 对象为空,则更新 header。
### Google Cloud Logging 配置
> 引入于极狐GitLab 16.1。
先决条件:
- 顶级群组的拥有者角色。
要更新顶级群组的流配置,请使用 `googleCloudLoggingConfigurationUpdate` 变更类型。您可以通过[列出所有外部目标](#list-streaming-destinations)来检索配置 ID。
```graphql
mutation {
googleCloudLoggingConfigurationUpdate(
input: {id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/1", googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events"}
) {
errors
googleCloudLoggingConfiguration {
id
logIdName
privateKey
googleProjectIdName
clientEmail
}
}
}
```
如果满足以下条件,则更新流配置:
- 返回的 `errors` 对象为空。
- API 响应 `200 OK`
## 删除流目的地
删除顶级群组或整个实例的流目的地。成功删除最后一个目的地后,该群组或实例的流传输将被禁用。
@@ -337,10 +493,11 @@ mutation {
### 删除实例级流目的地
> 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 引入于 16.0 版本,[功能标志](../feature_flags.md)为 `ff_external_audit_events`。默认禁用。
> - 功能标志 `ff_external_audit_events` 默认启用于极狐GitLab 16.2。
FLAG:
在私有化部署版上,此功能默认不可用。要使其可用,需要管理员[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 SaaS 版上,此功能可用。此功能尚未准备好用于生产。
在私有化部署版上,此功能默认启用。如果想禁用此功能,管理员可以[用功能标志](../feature_flags.md) `ff_external_audit_events`。在 JiHuLab.com 上,此功能可用,但只能由 JiHuLab.com 管理员配置。此功能已经准备好用于生产。
先决条件:
@@ -361,6 +518,42 @@ mutation {
- 返回的 `errors` 对象为空。
- API 响应 `200 OK`
要删除 HTTP header,请使用 GraphQL `auditEventsStreamingInstanceHeadersDestroy` 变更。
要检索 header ID,[列出实例的所有自定义 HTTP header](#list-streaming-destinations)
```graphql
mutation {
auditEventsStreamingInstanceHeadersDestroy(input: { headerId: "gid://gitlab/AuditEvents::Streaming::InstanceHeader/<id>" }) {
errors
}
}
```
如果返回的 `errors` 对象为空,则删除 header。
### Google Cloud Logging 配置
> 引入于极狐GitLab 16.1。
先决条件:
- 顶级群组的拥有者角色。
具有群组所有者角色的用户可以使用 `googleCloudLoggingConfigurationDestroy` 变更类型删除流配置。您可以通过[列出该群组的所有流媒体目的地](#list-streaming-destinations)检索配置 ID。
```graphql
mutation {
googleCloudLoggingConfigurationDestroy(input: { id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/1" }) {
errors
}
}
```
如果满足以下条件,则删除流配置:
- 返回的 `errors` 对象为空。
- API 响应 `200 OK`
## 事件类型过滤器
> 事件类型过滤器 API 引入于 15.7 版本。
加载中