多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# Services API > 原文:[https://docs.gitlab.com/ee/api/services.html](https://docs.gitlab.com/ee/api/services.html) * [List all active services](#list-all-active-services) * [Asana](#asana) * [Create/Edit Asana service](#createedit-asana-service) * [Delete Asana service](#delete-asana-service) * [Get Asana service settings](#get-asana-service-settings) * [Assembla](#assembla) * [Create/Edit Assembla service](#createedit-assembla-service) * [Delete Assembla service](#delete-assembla-service) * [Get Assembla service settings](#get-assembla-service-settings) * [Atlassian Bamboo CI](#atlassian-bamboo-ci) * [Create/Edit Atlassian Bamboo CI service](#createedit-atlassian-bamboo-ci-service) * [Delete Atlassian Bamboo CI service](#delete-atlassian-bamboo-ci-service) * [Get Atlassian Bamboo CI service settings](#get-atlassian-bamboo-ci-service-settings) * [Bugzilla](#bugzilla) * [Create/Edit Bugzilla service](#createedit-bugzilla-service) * [Delete Bugzilla Service](#delete-bugzilla-service) * [Get Bugzilla Service Settings](#get-bugzilla-service-settings) * [Buildkite](#buildkite) * [Create/Edit Buildkite service](#createedit-buildkite-service) * [Delete Buildkite service](#delete-buildkite-service) * [Get Buildkite service settings](#get-buildkite-service-settings) * [Campfire](#campfire) * [Create/Edit Campfire service](#createedit-campfire-service) * [Delete Campfire service](#delete-campfire-service) * [Get Campfire service settings](#get-campfire-service-settings) * [Unify Circuit](#unify-circuit) * [Create/Edit Unify Circuit service](#createedit-unify-circuit-service) * [Delete Unify Circuit service](#delete-unify-circuit-service) * [Get Unify Circuit service settings](#get-unify-circuit-service-settings) * [Webex Teams](#webex-teams) * [Create/Edit Webex Teams service](#createedit-webex-teams-service) * [Delete Webex Teams service](#delete-webex-teams-service) * [Get Webex Teams service settings](#get-webex-teams-service-settings) * [Custom Issue Tracker](#custom-issue-tracker) * [Create/Edit Custom Issue Tracker service](#createedit-custom-issue-tracker-service) * [Delete Custom Issue Tracker service](#delete-custom-issue-tracker-service) * [Get Custom Issue Tracker service settings](#get-custom-issue-tracker-service-settings) * [Drone CI](#drone-ci) * [Create/Edit Drone CI service](#createedit-drone-ci-service) * [Delete Drone CI service](#delete-drone-ci-service) * [Get Drone CI service settings](#get-drone-ci-service-settings) * [Emails on push](#emails-on-push) * [Create/Edit Emails on push service](#createedit-emails-on-push-service) * [Delete Emails on push service](#delete-emails-on-push-service) * [Get Emails on push service settings](#get-emails-on-push-service-settings) * [Confluence service](#confluence-service) * [Create/Edit Confluence service](#createedit-confluence-service) * [Delete Confluence service](#delete-confluence-service) * [Get Confluence service settings](#get-confluence-service-settings) * [External Wiki](#external-wiki) * [Create/Edit External Wiki service](#createedit-external-wiki-service) * [Delete External Wiki service](#delete-external-wiki-service) * [Get External Wiki service settings](#get-external-wiki-service-settings) * [Flowdock](#flowdock) * [Create/Edit Flowdock service](#createedit-flowdock-service) * [Delete Flowdock service](#delete-flowdock-service) * [Get Flowdock service settings](#get-flowdock-service-settings) * [GitHub](#github-premium) * [Create/Edit GitHub service](#createedit-github-service) * [Delete GitHub service](#delete-github-service) * [Get GitHub service settings](#get-github-service-settings) * [Hangouts Chat](#hangouts-chat) * [Create/Edit Hangouts Chat service](#createedit-hangouts-chat-service) * [Delete Hangouts Chat service](#delete-hangouts-chat-service) * [Get Hangouts Chat service settings](#get-hangouts-chat-service-settings) * [HipChat](#hipchat) * [Create/Edit HipChat service](#createedit-hipchat-service) * [Delete HipChat service](#delete-hipchat-service) * [Get HipChat service settings](#get-hipchat-service-settings) * [Irker (IRC gateway)](#irker-irc-gateway) * [Create/Edit Irker (IRC gateway) service](#createedit-irker-irc-gateway-service) * [Delete Irker (IRC gateway) service](#delete-irker-irc-gateway-service) * [Get Irker (IRC gateway) service settings](#get-irker-irc-gateway-service-settings) * [Jira](#jira) * [Get Jira service settings](#get-jira-service-settings) * [Create/Edit Jira service](#createedit-jira-service) * [Delete Jira service](#delete-jira-service) * [Slack slash commands](#slack-slash-commands) * [Get Slack slash command service settings](#get-slack-slash-command-service-settings) * [Create/Edit Slack slash command service](#createedit-slack-slash-command-service) * [Delete Slack slash command service](#delete-slack-slash-command-service) * [Mattermost slash commands](#mattermost-slash-commands) * [Get Mattermost slash command service settings](#get-mattermost-slash-command-service-settings) * [Create/Edit Mattermost slash command service](#createedit-mattermost-slash-command-service) * [Delete Mattermost slash command service](#delete-mattermost-slash-command-service) * [Packagist](#packagist) * [Create/Edit Packagist service](#createedit-packagist-service) * [Delete Packagist service](#delete-packagist-service) * [Get Packagist service settings](#get-packagist-service-settings) * [Pipeline-Emails](#pipeline-emails) * [Create/Edit Pipeline-Emails service](#createedit-pipeline-emails-service) * [Delete Pipeline-Emails service](#delete-pipeline-emails-service) * [Get Pipeline-Emails service settings](#get-pipeline-emails-service-settings) * [PivotalTracker](#pivotaltracker) * [Create/Edit PivotalTracker service](#createedit-pivotaltracker-service) * [Delete PivotalTracker service](#delete-pivotaltracker-service) * [Get PivotalTracker service settings](#get-pivotaltracker-service-settings) * [Prometheus](#prometheus) * [Create/Edit Prometheus service](#createedit-prometheus-service) * [Delete Prometheus service](#delete-prometheus-service) * [Get Prometheus service settings](#get-prometheus-service-settings) * [Pushover](#pushover) * [Create/Edit Pushover service](#createedit-pushover-service) * [Delete Pushover service](#delete-pushover-service) * [Get Pushover service settings](#get-pushover-service-settings) * [Redmine](#redmine) * [Create/Edit Redmine service](#createedit-redmine-service) * [Delete Redmine service](#delete-redmine-service) * [Get Redmine service settings](#get-redmine-service-settings) * [Slack notifications](#slack-notifications) * [Create/Edit Slack service](#createedit-slack-service) * [Delete Slack service](#delete-slack-service) * [Get Slack service settings](#get-slack-service-settings) * [Microsoft Teams](#microsoft-teams) * [Create/Edit Microsoft Teams service](#createedit-microsoft-teams-service) * [Delete Microsoft Teams service](#delete-microsoft-teams-service) * [Get Microsoft Teams service settings](#get-microsoft-teams-service-settings) * [Mattermost notifications](#mattermost-notifications) * [Create/Edit Mattermost notifications service](#createedit-mattermost-notifications-service) * [Delete Mattermost notifications service](#delete-mattermost-notifications-service) * [Get Mattermost notifications service settings](#get-mattermost-notifications-service-settings) * [JetBrains TeamCity CI](#jetbrains-teamcity-ci) * [Create/Edit JetBrains TeamCity CI service](#createedit-jetbrains-teamcity-ci-service) * [Delete JetBrains TeamCity CI service](#delete-jetbrains-teamcity-ci-service) * [Get JetBrains TeamCity CI service settings](#get-jetbrains-teamcity-ci-service-settings) * [Jenkins CI](#jenkins-ci-starter) * [Create/Edit Jenkins CI service](#createedit-jenkins-ci-service) * [Delete Jenkins CI service](#delete-jenkins-ci-service) * [Get Jenkins CI service settings](#get-jenkins-ci-service-settings) * [Jenkins CI (Deprecated) Service](#jenkins-ci-deprecated-service) * [Create/Edit Jenkins CI (Deprecated) service](#createedit-jenkins-ci-deprecated-service) * [Delete Jenkins CI (Deprecated) service](#delete-jenkins-ci-deprecated-service) * [Get Jenkins CI (Deprecated) service settings](#get-jenkins-ci-deprecated-service-settings) * [MockCI](#mockci) * [Create/Edit MockCI service](#createedit-mockci-service) * [Delete MockCI service](#delete-mockci-service) * [Get MockCI service settings](#get-mockci-service-settings) * [YouTrack](#youtrack) * [Create/Edit YouTrack service](#createedit-youtrack-service) * [Delete YouTrack Service](#delete-youtrack-service) * [Get YouTrack Service Settings](#get-youtrack-service-settings) # Services API[](#services-api "Permalink") > **注意:**此 API 需要具有维护者或所有者权限的访问令牌 ## List all active services[](#list-all-active-services "Permalink") 在 GitLab 12.7 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21330) . 获取所有活动项目服务的列表. ``` GET /projects/:id/services ``` 响应示例: ``` [ { "id": 75, "title": "Jenkins CI", "slug": "jenkins", "created_at": "2019-11-20T11:20:25.297Z", "updated_at": "2019-11-20T12:24:37.498Z", "active": true, "commit_events": true, "push_events": true, "issues_events": true, "confidential_issues_events": true, "merge_requests_events": true, "tag_push_events": false, "note_events": true, "confidential_note_events": true, "pipeline_events": true, "wiki_page_events": true, "job_events": true, "comment_on_event_enabled": true } { "id": 76, "title": "Alerts endpoint", "slug": "alerts", "created_at": "2019-11-20T11:20:25.297Z", "updated_at": "2019-11-20T12:24:37.498Z", "active": true, "commit_events": true, "push_events": true, "issues_events": true, "confidential_issues_events": true, "merge_requests_events": true, "tag_push_events": true, "note_events": true, "confidential_note_events": true, "pipeline_events": true, "wiki_page_events": true, "job_events": true, "comment_on_event_enabled": true } ] ``` ## Asana[](#asana "Permalink") Asana-无需电子邮件的团队合作 ### Create/Edit Asana service[](#createedit-asana-service "Permalink") 为项目设置 Asana 服务. > 该服务将提交消息添加为 Asana 任务的注释. 启用后,将检查提交消息中的 Asana 任务 URL(例如`https://app.asana.com/0/123456/987654` )或以#开头的任务 ID(例如`#987654` ). 找到的每个任务 ID 都会在其中添加提交注释. 您还可以通过以下消息关闭任务: `fix #123456` . 您可以在以下位置找到您的 API 密钥: [https](https://developers.asana.com/docs/#authentication-basics) : [//developers.asana.com/docs/#authentication-basics](https://developers.asana.com/docs/#authentication-basics) . ``` PUT /projects/:id/services/asana ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `api_key` | string | true | 用户 API 令牌. 用户必须有权访问任务,所有评论都将归于该用户. | | `restrict_to_branch` | string | false | 以逗号分隔的分支列表,将自动对其进行检查. 保留空白以包括所有分支. | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Asana service[](#delete-asana-service "Permalink") 删除项目的 Asana 服务. ``` DELETE /projects/:id/services/asana ``` ### Get Asana service settings[](#get-asana-service-settings "Permalink") 获取项目的 Asana 服务设置. ``` GET /projects/:id/services/asana ``` ## Assembla[](#assembla "Permalink") 项目管理软件(源提交端点) ### Create/Edit Assembla service[](#createedit-assembla-service "Permalink") 为项目设置 Assembla 服务. ``` PUT /projects/:id/services/assembla ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | 认证令牌 | | `subdomain` | string | false | 子域设置 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Assembla service[](#delete-assembla-service "Permalink") 删除项目的 Assembla 服务. ``` DELETE /projects/:id/services/assembla ``` ### Get Assembla service settings[](#get-assembla-service-settings "Permalink") 获取项目的 Assembla 服务设置. ``` GET /projects/:id/services/assembla ``` ## Atlassian Bamboo CI[](#atlassian-bamboo-ci "Permalink") 持续集成和构建服务器 ### Create/Edit Atlassian Bamboo CI service[](#createedit-atlassian-bamboo-ci-service "Permalink") 为项目设置 Atlassian Bamboo CI 服务. > 您必须在 Bamboo 中设置自动修订标签和存储库触发器. ``` PUT /projects/:id/services/bamboo ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `bamboo_url` | string | true | 竹根 URL. 例如, `https://bamboo.example.com` . | | `build_key` | string | true | 竹构建计划密钥,如 KEY | | `username` | string | true | 具有 API 访问权限的用户(如果适用) | | `password` | string | true | 用户密码 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Atlassian Bamboo CI service[](#delete-atlassian-bamboo-ci-service "Permalink") 删除项目的 Atlassian Bamboo CI 服务. ``` DELETE /projects/:id/services/bamboo ``` ### Get Atlassian Bamboo CI service settings[](#get-atlassian-bamboo-ci-service-settings "Permalink") 获取项目的 Atlassian Bamboo CI 服务设置. ``` GET /projects/:id/services/bamboo ``` ## Bugzilla[](#bugzilla "Permalink") Bugzilla 问题追踪器 ### Create/Edit Bugzilla service[](#createedit-bugzilla-service "Permalink") 为项目设置 Bugzilla 服务. ``` PUT /projects/:id/services/bugzilla ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `new_issue_url` | string | true | 新发行网址 | | `issues_url` | string | true | 发行网址 | | `project_url` | string | true | 项目网址 | | `description` | string | false | Description | | `title` | string | false | Title | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Bugzilla Service[](#delete-bugzilla-service "Permalink") 删除项目的 Bugzilla 服务. ``` DELETE /projects/:id/services/bugzilla ``` ### Get Bugzilla Service Settings[](#get-bugzilla-service-settings "Permalink") 获取项目的 Bugzilla 服务设置. ``` GET /projects/:id/services/bugzilla ``` ## Buildkite[](#buildkite "Permalink") 持续集成和部署 ### Create/Edit Buildkite service[](#createedit-buildkite-service "Permalink") 为项目设置 Buildkite 服务. ``` PUT /projects/:id/services/buildkite ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | Buildkite 项目 GitLab 令牌 | | `project_url` | string | true | `https://buildkite.com/example/project` | | `enable_ssl_verification` | boolean | false | 启用 S​​SL 验证 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Buildkite service[](#delete-buildkite-service "Permalink") 删除项目的 Buildkite 服务. ``` DELETE /projects/:id/services/buildkite ``` ### Get Buildkite service settings[](#get-buildkite-service-settings "Permalink") 获取项目的 Buildkite 服务设置. ``` GET /projects/:id/services/buildkite ``` ## Campfire[](#campfire "Permalink") 基于网络的简单实时群聊 ### Create/Edit Campfire service[](#createedit-campfire-service "Permalink") 为项目设置篝火服务. ``` PUT /projects/:id/services/campfire ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | 篝火令牌 | | `subdomain` | string | false | 篝火子域 | | `room` | string | false | 篝火室 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Campfire service[](#delete-campfire-service "Permalink") 删除项目的 Campfire 服务. ``` DELETE /projects/:id/services/campfire ``` ### Get Campfire service settings[](#get-campfire-service-settings "Permalink") 获取项目的 Campfire 服务设置. ``` GET /projects/:id/services/campfire ``` ## Unify Circuit[](#unify-circuit "Permalink") 统一电路 RTC 和协作工具. ### Create/Edit Unify Circuit service[](#createedit-unify-circuit-service "Permalink") 为项目设置"统一电路"服务. ``` PUT /projects/:id/services/unify-circuit ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `webhook` | string | true | 统一电路网络挂钩. 例如, `https://circuit.com/rest/v2/webhooks/incoming/...` | | `notify_only_broken_pipelines` | boolean | false | 发送有关管道中断的通知 | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `push_events` | boolean | false | 启用推送事件通知 | | `issues_events` | boolean | false | 启用问题事件通知 | | `confidential_issues_events` | boolean | false | 启用机密问题事件的通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `note_events` | boolean | false | 启用笔记事件通知 | | `confidential_note_events` | boolean | false | 启用机密笔记事件的通知 | | `pipeline_events` | boolean | false | 启用管道事件通知 | | `wiki_page_events` | boolean | false | 启用 Wiki 页面事件的通知 | ### Delete Unify Circuit service[](#delete-unify-circuit-service "Permalink") 删除项目的统一电路服务. ``` DELETE /projects/:id/services/unify-circuit ``` ### Get Unify Circuit service settings[](#get-unify-circuit-service-settings "Permalink") 获取项目的统一电路服务设置. ``` GET /projects/:id/services/unify-circuit ``` ## Webex Teams[](#webex-teams "Permalink") Webex Teams 协作工具. ### Create/Edit Webex Teams service[](#createedit-webex-teams-service "Permalink") 为项目设置 Webex Teams 服务. ``` PUT /projects/:id/services/webex-teams ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `webhook` | string | true | Webex Teams Webhook. 例如, `https://api.ciscospark.com/v1/webhooks/incoming/...` | | `notify_only_broken_pipelines` | boolean | false | 发送有关管道中断的通知 | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `push_events` | boolean | false | 启用推送事件通知 | | `issues_events` | boolean | false | 启用问题事件通知 | | `confidential_issues_events` | boolean | false | 启用机密问题事件的通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `note_events` | boolean | false | 启用笔记事件通知 | | `confidential_note_events` | boolean | false | 启用机密笔记事件的通知 | | `pipeline_events` | boolean | false | 启用管道事件通知 | | `wiki_page_events` | boolean | false | 启用 Wiki 页面事件的通知 | ### Delete Webex Teams service[](#delete-webex-teams-service "Permalink") 删除项目的 Webex Teams 服务. ``` DELETE /projects/:id/services/webex-teams ``` ### Get Webex Teams service settings[](#get-webex-teams-service-settings "Permalink") 获取项目的 Webex Teams 服务设置. ``` GET /projects/:id/services/webex-teams ``` ## Custom Issue Tracker[](#custom-issue-tracker "Permalink") 自定义问题跟踪器 ### Create/Edit Custom Issue Tracker service[](#createedit-custom-issue-tracker-service "Permalink") 为项目设置自定义问题跟踪服务. ``` PUT /projects/:id/services/custom-issue-tracker ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `new_issue_url` | string | true | 新发行网址 | | `issues_url` | string | true | 发行网址 | | `project_url` | string | true | 项目网址 | | `description` | string | false | Description | | `title` | string | false | Title | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Custom Issue Tracker service[](#delete-custom-issue-tracker-service "Permalink") 删除项目的自定义问题跟踪服务. ``` DELETE /projects/:id/services/custom-issue-tracker ``` ### Get Custom Issue Tracker service settings[](#get-custom-issue-tracker-service-settings "Permalink") 获取项目的自定义问题跟踪服务设置. ``` GET /projects/:id/services/custom-issue-tracker ``` ## Drone CI[](#drone-ci "Permalink") Drone 是一个基于 Go 编写的基于 Docker 的持续集成平台 ### Create/Edit Drone CI service[](#createedit-drone-ci-service "Permalink") 为项目设置 Drone CI 服务. ``` PUT /projects/:id/services/drone-ci ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | 无人机 CI 项目专用令牌 | | `drone_url` | string | true | `http://drone.example.com` | | `enable_ssl_verification` | boolean | false | 启用 S​​SL 验证 | | `push_events` | boolean | false | 启用推送事件通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | ### Delete Drone CI service[](#delete-drone-ci-service "Permalink") 删除项目的 Drone CI 服务. ``` DELETE /projects/:id/services/drone-ci ``` ### Get Drone CI service settings[](#get-drone-ci-service-settings "Permalink") 获取项目的 Drone CI 服务设置. ``` GET /projects/:id/services/drone-ci ``` ## Emails on push[](#emails-on-push "Permalink") 通过电子邮件将每次推送的提交和差异发送到收件人列表. ### Create/Edit Emails on push service[](#createedit-emails-on-push-service "Permalink") 在项目的推送服务上设置电子邮件. ``` PUT /projects/:id/services/emails-on-push ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `recipients` | string | true | 用空格分隔的电子邮件 | | `disable_diffs` | boolean | false | 禁用代码差异 | | `send_from_committer_email` | boolean | false | 从提交者发送 | | `push_events` | boolean | false | 启用推送事件通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected". 推送标签会始终触发通知. | ### Delete Emails on push service[](#delete-emails-on-push-service "Permalink") 删除项目的推送服务电子邮件. ``` DELETE /projects/:id/services/emails-on-push ``` ### Get Emails on push service settings[](#get-emails-on-push-service-settings "Permalink") 获取有关项目的推送服务设置的电子邮件. ``` GET /projects/:id/services/emails-on-push ``` ## Confluence service[](#confluence-service "Permalink") 版本历史 * 在 GitLab 13.2 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/220934) . 将到内部 Wiki 的链接替换为到 Confluence Cloud Workspace 的链接. ### Create/Edit Confluence service[](#createedit-confluence-service "Permalink") 为项目设置 Confluence 服务. ``` PUT /projects/:id/services/confluence ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `confluence_url` | string | true | Confluence Cloud Workspace 的 URL 托管在 atlassian.net 上. | ### Delete Confluence service[](#delete-confluence-service "Permalink") 删除项目的 Confluence 服务. ``` DELETE /projects/:id/services/confluence ``` ### Get Confluence service settings[](#get-confluence-service-settings "Permalink") 获取项目的 Confluence 服务设置. ``` GET /projects/:id/services/confluence ``` ## External Wiki[](#external-wiki "Permalink") 将指向内部 Wiki 的链接替换为指向外部 Wiki 的链接. ### Create/Edit External Wiki service[](#createedit-external-wiki-service "Permalink") 为项目设置外部 Wiki 服务. ``` PUT /projects/:id/services/external-wiki ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `external_wiki_url` | string | true | 外部 Wiki 的 URL | ### Delete External Wiki service[](#delete-external-wiki-service "Permalink") 删除项目的外部 Wiki 服务. ``` DELETE /projects/:id/services/external-wiki ``` ### Get External Wiki service settings[](#get-external-wiki-service-settings "Permalink") 获取项目的外部 Wiki 服务设置. ``` GET /projects/:id/services/external-wiki ``` ## Flowdock[](#flowdock "Permalink") Flowdock 是面向技术团队的协作 Web 应用程序. ### Create/Edit Flowdock service[](#createedit-flowdock-service "Permalink") 为项目设置 Flowdock 服务. ``` PUT /projects/:id/services/flowdock ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | Flowdock Git 源令牌 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Flowdock service[](#delete-flowdock-service "Permalink") 删除项目的 Flowdock 服务. ``` DELETE /projects/:id/services/flowdock ``` ### Get Flowdock service settings[](#get-flowdock-service-settings "Permalink") 获取项目的 Flowdock 服务设置. ``` GET /projects/:id/services/flowdock ``` ## GitHub[](#github-premium "Permalink") 代码协作软件. ### Create/Edit GitHub service[](#createedit-github-service "Permalink") 为项目设置 GitHub 服务. ``` PUT /projects/:id/services/github ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | 具有`repo:status` OAuth 范围的 GitHub API 令牌 | | `repository_url` | string | true | GitHub 存储库 URL | | `static_context` | boolean | false | 将实例名称而不是分支附加到[状态检查名称](../user/project/integrations/github.html#static--dynamic-status-check-names) | ### Delete GitHub service[](#delete-github-service "Permalink") 删除项目的 GitHub 服务. ``` DELETE /projects/:id/services/github ``` ### Get GitHub service settings[](#get-github-service-settings "Permalink") 获取项目的 GitHub 服务设置. ``` GET /projects/:id/services/github ``` ## Hangouts Chat[](#hangouts-chat "Permalink") Google GSuite 团队协作工具. > **注意:**此服务是[在 v11.2](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/20290)中[引入的](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/20290) ### Create/Edit Hangouts Chat service[](#createedit-hangouts-chat-service "Permalink") 为项目设置环聊聊天服务. ``` PUT /projects/:id/services/hangouts-chat ``` > **注意:** [v10.4](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11435)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11435)特定的事件参数(例如`push_events`标志) Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `webhook` | string | true | Hangouts 即时通讯网路挂钩. 例如, `https://chat.googleapis.com/v1/spaces...` | | `notify_only_broken_pipelines` | boolean | false | 发送有关管道中断的通知 | | `notify_only_default_branch` | boolean | false | 已弃用:此参数已替换为`branches_to_be_notified` | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `push_events` | boolean | false | 启用推送事件通知 | | `issues_events` | boolean | false | 启用问题事件通知 | | `confidential_issues_events` | boolean | false | Enable notifications for confidential issue events | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `note_events` | boolean | false | 启用笔记事件通知 | | `confidential_note_events` | boolean | false | 启用机密笔记事件的通知 | | `pipeline_events` | boolean | false | 启用管道事件通知 | | `wiki_page_events` | boolean | false | 启用 Wiki 页面事件的通知 | ### Delete Hangouts Chat service[](#delete-hangouts-chat-service "Permalink") 删除项目的环聊聊天服务. ``` DELETE /projects/:id/services/hangouts-chat ``` ### Get Hangouts Chat service settings[](#get-hangouts-chat-service-settings "Permalink") 获取项目的环聊聊天服务设置. ``` GET /projects/:id/services/hangouts-chat ``` ## HipChat[](#hipchat "Permalink") 私人群聊和即时消息 ### Create/Edit HipChat service[](#createedit-hipchat-service "Permalink") 为项目设置 HipChat 服务. ``` PUT /projects/:id/services/hipchat ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | 房间代币 | | `color` | string | false | 房间颜色 | | `notify` | boolean | false | 启用通知 | | `room` | string | false | 房间名称或 ID | | `api_version` | string | false | 默认保留空白(v2) | | `server` | string | false | 默认保留空白. 例如, `https://hipchat.example.com` . | | `push_events` | boolean | false | 启用推送事件通知 | | `issues_events` | boolean | false | 启用问题事件通知 | | `confidential_issues_events` | boolean | false | 启用机密问题事件的通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `note_events` | boolean | false | Enable notifications for note events | | `confidental_note_events` | boolean | false | 启用机密笔记事件的通知 | | `pipeline_events` | boolean | false | 启用管道事件通知 | ### Delete HipChat service[](#delete-hipchat-service "Permalink") 删除项目的 HipChat 服务. ``` DELETE /projects/:id/services/hipchat ``` ### Get HipChat service settings[](#get-hipchat-service-settings "Permalink") 获取项目的 HipChat 服务设置. ``` GET /projects/:id/services/hipchat ``` ## Irker (IRC gateway)[](#irker-irc-gateway "Permalink") 通过 Irker 网关在更新后将 IRC 消息发送到收件人列表. ### Create/Edit Irker (IRC gateway) service[](#createedit-irker-irc-gateway-service "Permalink") 为项目设置 Irker(IRC 网关)服务. > Irker 没有内置的身份验证,如果托管在防火墙外部,则容易受到 IRC 垃圾邮件的攻击. 请确保在安全的网络中运行守护程序,以防止滥用. 有关更多详细信息,请阅读: [http](http://www.catb.org/~esr/irker/security.html) : [//www.catb.org/~esr/irker/security.html](http://www.catb.org/~esr/irker/security.html) . ``` PUT /projects/:id/services/irker ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `recipients` | string | true | 用空格分隔的收件人/渠道 | | `default_irc_uri` | string | false | `irc://irc.network.net:6697/` | | `server_host` | string | false | localhost | | `server_port` | integer | false | 6659 | | `colorize_messages` | boolean | false | 为邮件着色 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Irker (IRC gateway) service[](#delete-irker-irc-gateway-service "Permalink") 删除项目的 Irker(IRC 网关)服务. ``` DELETE /projects/:id/services/irker ``` ### Get Irker (IRC gateway) service settings[](#get-irker-irc-gateway-service-settings "Permalink") Get Irker (IRC gateway) service settings for a project. ``` GET /projects/:id/services/irker ``` ## Jira[](#jira "Permalink") 吉拉问题追踪器. ### Get Jira service settings[](#get-jira-service-settings "Permalink") 获取项目的 Jira 服务设置. ``` GET /projects/:id/services/jira ``` ### Create/Edit Jira service[](#createedit-jira-service "Permalink") 为项目设置 Jira 服务. > 与 GitLab 8.14 开始, `api_url` , `issues_url` , `new_issue_url`和`project_url`被替换`url` . 如果您使用的是旧版本,请[遵循此文档](https://gitlab.com/gitlab-org/gitlab/blob/8-13-stable-ee/doc/api/services.md#jira) . ``` PUT /projects/:id/services/jira ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | yes | 链接到该 GitLab 项目的 Jira 项目的 URL. 例如, `https://jira.example.com` . | | `api_url` | string | no | Jira 实例 API 的基本 URL. 如果未设置,将使用 Web URL 值. 例如, `https://jira-api.example.com` . | | `username` | string | yes | 创建用于 GitLab / Jira 的用户的用户名. | | `password` | string | yes | 创建的用于 GitLab / Jira 的用户密码. | | `active` | boolean | no | 激活或停用服务. 默认为 false(停用). | | `jira_issue_transition_id` | string | no | 将问题移到关闭状态的过渡的 ID. 您可以在 Jira 工作流管理( **管理>问题>工作流** )下找到该编号,方法是在所需项目工作流的" **操作** **"**下选择" **查看** **"** . 每个状态的 ID 可以在" **转换(id)"**列下每个转换名称的括号内找到. 默认情况下,此 ID 设置为`2` . | | `commit_events` | boolean | false | 启用提交事件通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `comment_on_event_enabled` | boolean | false | 在每个 GitLab 事件(提交/合并请求)的 Jira 问题中启用评论 | ### Delete Jira service[](#delete-jira-service "Permalink") 从项目中删除所有以前的 Jira 设置. ``` DELETE /projects/:id/services/jira ``` ## Slack slash commands[](#slack-slash-commands "Permalink") 能够从 Slack 聊天实例接收斜线命令. ### Get Slack slash command service settings[](#get-slack-slash-command-service-settings "Permalink") 获取项目的 Slack 斜杠命令服务设置. ``` GET /projects/:id/services/slack-slash-commands ``` 响应示例: ``` { "id": 4, "title": "Slack slash commands", "slug": "slack-slash-commands", "created_at": "2017-06-27T05:51:39-07:00", "updated_at": "2017-06-27T05:51:39-07:00", "active": true, "push_events": true, "issues_events": true, "confidential_issues_events": true, "merge_requests_events": true, "tag_push_events": true, "note_events": true, "job_events": true, "pipeline_events": true, "comment_on_event_enabled": false, "properties": { "token": "<your_access_token>" } } ``` ### Create/Edit Slack slash command service[](#createedit-slack-slash-command-service "Permalink") 为项目设置 Slack 斜杠命令. ``` PUT /projects/:id/services/slack-slash-commands ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | yes | Slack 令牌 | ### Delete Slack slash command service[](#delete-slack-slash-command-service "Permalink") 删除项目的 Slack 斜杠命令服务. ``` DELETE /projects/:id/services/slack-slash-commands ``` ## Mattermost slash commands[](#mattermost-slash-commands "Permalink") 能够从 Mattermost 聊天实例接收斜线命令. ### Get Mattermost slash command service settings[](#get-mattermost-slash-command-service-settings "Permalink") 获取项目的 Mattermost 斜杠命令服务设置. ``` GET /projects/:id/services/mattermost-slash-commands ``` ### Create/Edit Mattermost slash command service[](#createedit-mattermost-slash-command-service "Permalink") 为项目设置 Mattermost 斜杠命令. ``` PUT /projects/:id/services/mattermost-slash-commands ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | yes | 最重要的令牌 | | `username` | string | no | 用于发布消息的用户名 | ### Delete Mattermost slash command service[](#delete-mattermost-slash-command-service "Permalink") 删除项目的 Mattermost 斜杠命令服务. ``` DELETE /projects/:id/services/mattermost-slash-commands ``` ## Packagist[](#packagist "Permalink") 当提交或标签被推送到 GitLab 时,在 Packagist(主要的 Composer 存储库)上更新您的项目. ### Create/Edit Packagist service[](#createedit-packagist-service "Permalink") 为项目设置 Packagist 服务. ``` PUT /projects/:id/services/packagist ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `username` | string | yes | Packagist 帐户的用户名 | | `token` | string | yes | Packagist 服务器的 API 令牌 | | `server` | boolean | no | Packagist 服务器的 URL. 默认保留空白: [https](https://packagist.org) : [//packagist.org](https://packagist.org) | | `push_events` | boolean | false | 启用推送事件通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | ### Delete Packagist service[](#delete-packagist-service "Permalink") 删除项目的 Packagist 服务. ``` DELETE /projects/:id/services/packagist ``` ### Get Packagist service settings[](#get-packagist-service-settings "Permalink") 获取项目的 Packagist 服务设置. ``` GET /projects/:id/services/packagist ``` ## Pipeline-Emails[](#pipeline-emails "Permalink") 获取有关 GitLab CI / CD 管道的电子邮件. ### Create/Edit Pipeline-Emails service[](#createedit-pipeline-emails-service "Permalink") 设置项目的管道电子邮件服务. ``` PUT /projects/:id/services/pipelines-email ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `recipients` | string | yes | 以逗号分隔的收件人电子邮件地址列表 | | `add_pusher` | boolean | no | 将推送器添加到收件人列表 | | `notify_only_broken_pipelines` | boolean | no | 仅通知断开的管道 | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `notify_only_default_branch` | boolean | no | 仅针对默认分支发送通知( [在 GitLab 12.0 中引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/28271) ) | | `pipeline_events` | boolean | false | 启用管道事件通知 | ### Delete Pipeline-Emails service[](#delete-pipeline-emails-service "Permalink") 删除项目的管道电子邮件服务. ``` DELETE /projects/:id/services/pipelines-email ``` ### Get Pipeline-Emails service settings[](#get-pipeline-emails-service-settings "Permalink") 获取项目的管道电子邮件服务设置. ``` GET /projects/:id/services/pipelines-email ``` ## PivotalTracker[](#pivotaltracker "Permalink") 项目管理软件(源提交端点) ### Create/Edit PivotalTracker service[](#createedit-pivotaltracker-service "Permalink") 为项目设置 PivotalTracker 服务. ``` PUT /projects/:id/services/pivotaltracker ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | true | PivotalTracker 令牌 | | `restrict_to_branch` | boolean | false | 以逗号分隔的分支列表,将自动对其进行检查. 保留空白以包括所有分支. | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete PivotalTracker service[](#delete-pivotaltracker-service "Permalink") 删除项目的 PivotalTracker 服务. ``` DELETE /projects/:id/services/pivotaltracker ``` ### Get PivotalTracker service settings[](#get-pivotaltracker-service-settings "Permalink") 获取项目的 PivotalTracker 服务设置. ``` GET /projects/:id/services/pivotaltracker ``` ## Prometheus[](#prometheus "Permalink") Prometheus 是一项功能强大的时间序列监视服务. ### Create/Edit Prometheus service[](#createedit-prometheus-service "Permalink") 为项目设置 Prometheus 服务. ``` PUT /projects/:id/services/prometheus ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `api_url` | string | true | Prometheus API 基本 URL. 例如, `http://prometheus.example.com/` . | | `google_iap_audience_client_id` | string | false | IAP 受保护资源的客户端 ID(看起来像 IAP_CLIENT_ID.apps.googleusercontent.com) | | `google_iap_service_account_json` | string | false | 您的服务帐户的`credentials.json`文件,例如{" type":" service_account"," project_id":…} | ### Delete Prometheus service[](#delete-prometheus-service "Permalink") 删除项目的 Prometheus 服务. ``` DELETE /projects/:id/services/prometheus ``` ### Get Prometheus service settings[](#get-prometheus-service-settings "Permalink") 获取项目的 Prometheus 服务设置. ``` GET /projects/:id/services/prometheus ``` ## Pushover[](#pushover "Permalink") 通过 Pushover,可以轻松在 Android 设备,iPhone,iPad 和台式机上获取实时通知. ### Create/Edit Pushover service[](#createedit-pushover-service "Permalink") 为项目设置 Pushover 服务. ``` PUT /projects/:id/services/pushover ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `api_key` | string | true | Your application key | | `user_key` | string | true | 您的用户密钥 | | `priority` | string | true | 优先事项 | | `device` | string | false | 对于所有活动设备保留空白 | | `sound` | string | false | 通知的声音 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Pushover service[](#delete-pushover-service "Permalink") 删除项目的 Pushover 服务. ``` DELETE /projects/:id/services/pushover ``` ### Get Pushover service settings[](#get-pushover-service-settings "Permalink") 获取项目的 Pushover 服务设置. ``` GET /projects/:id/services/pushover ``` ## Redmine[](#redmine "Permalink") Redmine 问题追踪器 ### Create/Edit Redmine service[](#createedit-redmine-service "Permalink") 为项目设置 Redmine 服务. ``` PUT /projects/:id/services/redmine ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `new_issue_url` | string | true | 新发行网址 | | `project_url` | string | true | 项目网址 | | `issues_url` | string | true | 发行网址 | | `description` | string | false | Description | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete Redmine service[](#delete-redmine-service "Permalink") 删除项目的 Redmine 服务. ``` DELETE /projects/:id/services/redmine ``` ### Get Redmine service settings[](#get-redmine-service-settings "Permalink") 获取项目的 Redmine 服务设置. ``` GET /projects/:id/services/redmine ``` ## Slack notifications[](#slack-notifications "Permalink") 在 Slack 中接收事件通知 ### Create/Edit Slack service[](#createedit-slack-service "Permalink") 为项目设置 Slack 服务. ``` PUT /projects/:id/services/slack ``` > **注意:** [v10.4](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11435)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11435)特定的事件参数(例如`push_events`标志和`push_channel` ) Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `webhook` | string | true | `https://hooks.slack.com/services/...` | | `username` | string | false | username | | `channel` | string | false | 如果未配置其他频道,则使用默认频道 | | `notify_only_broken_pipelines` | boolean | false | 发送有关管道中断的通知 | | `notify_only_default_branch` | boolean | false | 已弃用:此参数已替换为`branches_to_be_notified` | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `commit_events` | boolean | false | 启用提交事件通知 | | `confidential_issue_channel` | string | false | 接收机密问题事件通知的渠道的名称 | | `confidential_issues_events` | boolean | false | 启用机密问题事件的通知 | | `confidential_note_channel` | string | false | 接收机密笔记事件通知的渠道的名称 | | `confidential_note_events` | boolean | false | 启用机密笔记事件的通知 | | `deployment_channel` | string | false | 接收部署事件通知的通道的名称 | | `deployment_events` | boolean | false | 启用部署事件通知 | | `issue_channel` | string | false | 接收问题事件通知的渠道的名称 | | `issues_events` | boolean | false | 启用问题事件通知 | | `job_events` | boolean | false | 启用工作事件通知 | | `merge_request_channel` | string | false | 接收合并请求事件通知的通道的名称 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `note_channel` | string | false | 接收音符事件通知的频道名称 | | `note_events` | boolean | false | 启用笔记事件通知 | | `pipeline_channel` | string | false | 接收管道事件通知的通道的名称 | | `pipeline_events` | boolean | false | 启用管道事件通知 | | `push_channel` | string | false | 接收推送事件通知的通道的名称 | | `push_events` | boolean | false | 启用推送事件通知 | | `tag_push_channel` | string | false | 接收标签推送事件通知的通道的名称 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `wiki_page_channel` | string | false | 接收维基页面事件通知的频道名称 | | `wiki_page_events` | boolean | false | 启用 Wiki 页面事件的通知 | ### Delete Slack service[](#delete-slack-service "Permalink") 删除项目的 Slack 服务. ``` DELETE /projects/:id/services/slack ``` ### Get Slack service settings[](#get-slack-service-settings "Permalink") 获取项目的 Slack 服务设置. ``` GET /projects/:id/services/slack ``` ## Microsoft Teams[](#microsoft-teams "Permalink") 群聊软件 ### Create/Edit Microsoft Teams service[](#createedit-microsoft-teams-service "Permalink") 为项目设置 Microsoft Teams 服务. ``` PUT /projects/:id/services/microsoft-teams ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `webhook` | string | true | Microsoft Teams 网络挂钩. 例如, `https://outlook.office.com/webhook/...` | | `notify_only_broken_pipelines` | boolean | false | 发送有关管道中断的通知 | | `notify_only_default_branch` | boolean | false | 已弃用:此参数已替换为`branches_to_be_notified` | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `push_events` | boolean | false | Enable notifications for push events | | `issues_events` | boolean | false | 启用问题事件通知 | | `confidential_issues_events` | boolean | false | 启用机密问题事件的通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `note_events` | boolean | false | 启用笔记事件通知 | | `confidential_note_events` | boolean | false | 启用机密笔记事件的通知 | | `pipeline_events` | boolean | false | 启用管道事件通知 | | `wiki_page_events` | boolean | false | 启用 Wiki 页面事件的通知 | ### Delete Microsoft Teams service[](#delete-microsoft-teams-service "Permalink") 删除项目的 Microsoft Teams 服务. ``` DELETE /projects/:id/services/microsoft-teams ``` ### Get Microsoft Teams service settings[](#get-microsoft-teams-service-settings "Permalink") 获取项目的 Microsoft Teams 服务设置. ``` GET /projects/:id/services/microsoft-teams ``` ## Mattermost notifications[](#mattermost-notifications "Permalink") 在 Mattermost 接收事件通知 ### Create/Edit Mattermost notifications service[](#createedit-mattermost-notifications-service "Permalink") 为项目设置 Mattermost 服务. ``` PUT /projects/:id/services/mattermost ``` > **注意:** [v10.4](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11435)中[引入了](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11435)特定的事件参数(例如`push_events`标志和`push_channel` ) Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `webhook` | string | true | 最重要的网络挂钩. 例如, `http://mattermost_host/hooks/...` | | `username` | string | false | username | | `channel` | string | false | 如果未配置其他频道,则使用默认频道 | | `notify_only_broken_pipelines` | boolean | false | 发送有关管道中断的通知 | | `notify_only_default_branch` | boolean | false | 已弃用:此参数已替换为`branches_to_be_notified` | | `branches_to_be_notified` | string | all | 发送通知的分支. 有效选项为"所有","默认","受保护"和" default_and_protected" | | `push_events` | boolean | false | 启用推送事件通知 | | `issues_events` | boolean | false | 启用问题事件通知 | | `confidential_issues_events` | boolean | false | 启用机密问题事件的通知 | | `merge_requests_events` | boolean | false | 启用合并请求事件的通知 | | `tag_push_events` | boolean | false | 启用标签推送事件的通知 | | `note_events` | boolean | false | 启用笔记事件通知 | | `confidential_note_events` | boolean | false | 启用机密笔记事件的通知 | | `pipeline_events` | boolean | false | 启用管道事件通知 | | `wiki_page_events` | boolean | false | 启用 Wiki 页面事件的通知 | | `push_channel` | string | false | 接收推送事件通知的通道的名称 | | `issue_channel` | string | false | 接收问题事件通知的渠道的名称 | | `confidential_issue_channel` | string | false | 接收机密问题事件通知的渠道的名称 | | `merge_request_channel` | string | false | 接收合并请求事件通知的通道的名称 | | `note_channel` | string | false | 接收音符事件通知的频道名称 | | `confidential_note_channel` | boolean | 接收机密笔记事件通知的渠道的名称 |   | | `tag_push_channel` | string | false | 接收标签推送事件通知的通道的名称 | | `pipeline_channel` | string | false | 接收管道事件通知的通道的名称 | | `wiki_page_channel` | string | false | 接收维基页面事件通知的频道名称 | ### Delete Mattermost notifications service[](#delete-mattermost-notifications-service "Permalink") 删除项目的 Mattermost Notifications 服务. ``` DELETE /projects/:id/services/mattermost ``` ### Get Mattermost notifications service settings[](#get-mattermost-notifications-service-settings "Permalink") 获取项目的"最重要的通知"服务设置. ``` GET /projects/:id/services/mattermost ``` ## JetBrains TeamCity CI[](#jetbrains-teamcity-ci "Permalink") 持续集成和构建服务器 ### Create/Edit JetBrains TeamCity CI service[](#createedit-jetbrains-teamcity-ci-service "Permalink") 为项目设置 JetBrains TeamCity CI 服务. > TeamCity 中的构建配置必须使用构建格式编号`%build.vcs.number%`您还将要配置对所有分支的监视,以便合并请求得以构建,该设置位于 VSC 根高级设置中. ``` PUT /projects/:id/services/teamcity ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `teamcity_url` | string | true | TeamCity 根 URL. 例如, `https://teamcity.example.com` | | `build_type` | string | true | 构建配置 ID | | `username` | string | true | 有权触发手动构建的用户 | | `password` | string | true | 用户密码 | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete JetBrains TeamCity CI service[](#delete-jetbrains-teamcity-ci-service "Permalink") 删除项目的 JetBrains TeamCity CI 服务. ``` DELETE /projects/:id/services/teamcity ``` ### Get JetBrains TeamCity CI service settings[](#get-jetbrains-teamcity-ci-service-settings "Permalink") 获取项目的 JetBrains TeamCity CI 服务设置. ``` GET /projects/:id/services/teamcity ``` ## Jenkins CI[](#jenkins-ci-starter "Permalink") 持续集成和构建服务器 ### Create/Edit Jenkins CI service[](#createedit-jenkins-ci-service "Permalink") 为项目设置 Jenkins CI 服务. ``` PUT /projects/:id/services/jenkins ``` Parameters: * `jenkins_url` ( **必填** ) `jenkins_url` URL,例如`http://jenkins.example.com` * `project_name` ( **必需** )-URL 友好的项目名称. 示例:my_project_name * `username` (可选)-有权访问 Jenkins 服务器的`username` (如果适用) * `password` (可选)-用户的密码 ### Delete Jenkins CI service[](#delete-jenkins-ci-service "Permalink") 删除项目的 Jenkins CI 服务. ``` DELETE /projects/:id/services/jenkins ``` ### Get Jenkins CI service settings[](#get-jenkins-ci-service-settings "Permalink") 获取项目的 Jenkins CI 服务设置. ``` GET /projects/:id/services/jenkins ``` ## Jenkins CI (Deprecated) Service[](#jenkins-ci-deprecated-service "Permalink") 持续集成和构建服务器 **注意:**此服务已[在 v13.0](https://gitlab.com/gitlab-org/gitlab/-/issues/1600)中[删除](https://gitlab.com/gitlab-org/gitlab/-/issues/1600) ### Create/Edit Jenkins CI (Deprecated) service[](#createedit-jenkins-ci-deprecated-service "Permalink") 为项目设置 Jenkins CI(不推荐使用)服务. ``` PUT /projects/:id/services/jenkins-deprecated ``` Parameters: * `project_url` ( **必填** )-Jenkins 项目网址,例如`http://jenkins.example.com/job/my-project/` * `multiproject_enabled` (可选)-在 Jenkins GitLab Hook 插件中配置了多项目模式 * `pass_unstable` (可选)-不稳定的版本将被视为通过 ### Delete Jenkins CI (Deprecated) service[](#delete-jenkins-ci-deprecated-service "Permalink") 删除项目的 Jenkins CI(不推荐使用)服务. ``` DELETE /projects/:id/services/jenkins-deprecated ``` ### Get Jenkins CI (Deprecated) service settings[](#get-jenkins-ci-deprecated-service-settings "Permalink") 获取项目的 Jenkins CI(不推荐使用)服务设置. ``` GET /projects/:id/services/jenkins-deprecated ``` ## MockCI[](#mockci "Permalink") 模拟一个外部配置项. 有关伴随模拟服务的示例,请参见[`gitlab-org/gitlab-mock-ci-service`](https://gitlab.com/gitlab-org/gitlab-mock-ci-service) service. 仅当您的环境设置为开发时,此服务才可用. ### Create/Edit MockCI service[](#createedit-mockci-service "Permalink") 为项目设置 MockCI 服务. ``` PUT /projects/:id/services/mock-ci ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `mock_service_url` | string | true | `http://localhost:4004` | ### Delete MockCI service[](#delete-mockci-service "Permalink") 删除项目的 MockCI 服务. ``` DELETE /projects/:id/services/mock-ci ``` ### Get MockCI service settings[](#get-mockci-service-settings "Permalink") 获取项目的 MockCI 服务设置. ``` GET /projects/:id/services/mock-ci ``` ## YouTrack[](#youtrack "Permalink") YouTrack 问题追踪器 ### Create/Edit YouTrack service[](#createedit-youtrack-service "Permalink") 为项目设置 YouTrack 服务. ``` PUT /projects/:id/services/youtrack ``` Parameters: | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `issues_url` | string | true | 发行网址 | | `project_url` | string | true | 项目网址 | | `description` | string | false | Description | | `push_events` | boolean | false | 启用推送事件通知 | ### Delete YouTrack Service[](#delete-youtrack-service "Permalink") 删除项目的 YouTrack 服务. ``` DELETE /projects/:id/services/youtrack ``` ### Get YouTrack Service Settings[](#get-youtrack-service-settings "Permalink") 获取项目的 YouTrack 服务设置. ``` GET /projects/:id/services/youtrack ```