367.md 55.4 KB
Newer Older
Lab机器人's avatar
readme  
Lab机器人 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578
# 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 
```