Chuyển tới nội dung chính

Enable rule

POST/api/automation/rules/{ruleId}/enable
Quản trị viên

Đọc thêm: RESTMã nguồn: AutomationRuleApiController#enable(mở trong thẻ mới)

Tham số đường dẫn​

TênKiểuBắt buộcGhi chú
ruleIdstring (uuid)Bắt buộc

Response​

Thành công: 200

TrườngKiểuBắt buộcGhi chú
idstring (uuid)Tùy chọn
namestringTùy chọn
triggerTypeenum TriggerTypeTùy chọnRELEASE_PUBLISHEDMANUALSCHEDULED_CRONUPCOMING_RELEASE_REMINDEREXTERNAL_WEBHOOK
projectIdstring (uuid)Tùy chọn
projectNamestringTùy chọn
triggerReleaseIdstring (uuid)Tùy chọn
cronExpressionstringTùy chọn
cronTimeZonestringTùy chọn
nextFireAtstring (date-time)Tùy chọn
reminderDaysBeforeintegerTùy chọn
webhookPathstringTùy chọn
webhookSecretConfiguredbooleanTùy chọn
webhookSecretstringTùy chọn
enabledbooleanTùy chọn
createdAtstring (date-time)Tùy chọn
updatedAtstring (date-time)Tùy chọn
actionsarray of AutomationActionViewTùy chọn
actions[].idstring (uuid)Tùy chọn
actions[].positionintegerTùy chọn
actions[].actionTypeenum ActionTypeTùy chọnGITHUB_RELEASESLACKEMAILPUBLIC_CHANGELOGNOTIONCONFLUENCEMICROSOFT_TEAMSZENDESK
actions[].audienceIdstring (uuid)Tùy chọn
actions[].audienceNamestringTùy chọn
actions[].languagestringTùy chọn
actions[].recipientsstringTùy chọn
actions[].parentPageIdstringTùy chọn
actions[].siteUrlstringTùy chọn
actions[].emailstringTùy chọn
actions[].spaceIdstringTùy chọn
actions[].subdomainstringTùy chọn
actions[].clientIdstringTùy chọn
actions[].sectionIdstringTùy chọn
actions[].userSegmentIdstringTùy chọn
actions[].secretConfiguredbooleanTùy chọn
gitHubSourceMissingbooleanTùy chọn
deliversRetiredAudiencebooleanTùy chọn

Lỗi​

Trạng tháiMãÁp dụng cho
400validation_failedthiếu trường hoặc giá trị nằm ngoài khoảng cho phépMọi endpoint
400invalid_parametermột tham số trên đường dẫn hoặc query bị thiếu hoặc không chuyển đổi được, chẳng hạn một ID không phải UUIDMọi endpoint
401authentication_requiredchưa có phiên đăng nhậpMọi endpoint
403access_deniedendpoint dành cho quản trị viên, hoặc CSRF token thiếu hay đã cũMọi endpoint
404not_foundkhông có địa chỉ đóMọi endpoint
405method_not_allowedđịa chỉ không nhận phương thức đóMọi endpoint
415unsupported_media_typeđịa chỉ không đọc body thuộc kiểu đóMọi endpoint
500internal_errormột lỗi ReleaseFlow không lường trước; body không bao giờ chứa exception gây ra nóMọi endpoint
400, 404, 409Xem hướng dẫnKhu vực Automation

Request

bash
# Sign in first and keep the session cookie in cookies.txt (see Sessions and CSRF).
# CSRF_HEADER and CSRF_TOKEN are the headerName and token GET /api/csrf returned.
curl -X POST "http://localhost:8080/api/automation/rules/$RULE_ID/enable" \
-b cookies.txt -c cookies.txt \
-H "$CSRF_HEADER: $CSRF_TOKEN"

Response

200

Ví dụ

{
  "id": "<uuid>",
  "name": "<string>",
  "triggerType": "RELEASE_PUBLISHED",
  "projectId": "<uuid>",
  "projectName": "<string>",
  "triggerReleaseId": "<uuid>",
  "cronExpression": "<string>",
  "cronTimeZone": "<string>",
  "nextFireAt": "<date-time>",
  "reminderDaysBefore": 0,
  "webhookPath": "<string>",
  "webhookSecretConfigured": false,
  "webhookSecret": "<string>",
  "enabled": false,
  "createdAt": "<date-time>",
  "updatedAt": "<date-time>",
  "actions": [
    {
      "id": "<uuid>",
      "position": 0,
      "actionType": "GITHUB_RELEASE",
      "audienceId": "<uuid>",
      "audienceName": "<string>",
      "language": "<string>",
      "recipients": "<string>",
      "parentPageId": "<string>",
      "siteUrl": "<string>",
      "email": "<string>",
      "spaceId": "<string>",
      "subdomain": "<string>",
      "clientId": "<string>",
      "sectionId": "<string>",
      "userSegmentId": "<string>",
      "secretConfigured": false
    }
  ],
  "gitHubSourceMissing": false,
  "deliversRetiredAudience": false
}