|
682 | 682 | } |
683 | 683 | } |
684 | 684 | }, |
685 | | - "/monit/rule/export": { |
686 | | - "post": { |
687 | | - "operationId": "monit-rule-read-export", |
688 | | - "summary": "Export alert rules", |
689 | | - "description": "Export the configuration of selected alert rules as a portable JSON array, compatible with `POST /monit/rule/import`.", |
690 | | - "tags": [ |
691 | | - "Monitors/Alert rules" |
692 | | - ], |
693 | | - "x-mint": { |
694 | | - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/day**; **200 requests/minute**; **20 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", |
695 | | - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-export", |
696 | | - "metadata": { |
697 | | - "sidebarTitle": "Export alert rules" |
698 | | - } |
699 | | - }, |
700 | | - "responses": { |
701 | | - "200": { |
702 | | - "description": "Success", |
703 | | - "content": { |
704 | | - "application/json": { |
705 | | - "schema": { |
706 | | - "allOf": [ |
707 | | - { |
708 | | - "$ref": "#/components/schemas/SuccessEnvelope" |
709 | | - }, |
710 | | - { |
711 | | - "type": "object", |
712 | | - "properties": { |
713 | | - "data": { |
714 | | - "$ref": "#/components/schemas/AlertRuleExportListResponse" |
715 | | - } |
716 | | - } |
717 | | - } |
718 | | - ] |
719 | | - }, |
720 | | - "example": { |
721 | | - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", |
722 | | - "data": [ |
723 | | - { |
724 | | - "name": "CPU High", |
725 | | - "ds_type": "prometheus", |
726 | | - "ds_list": [ |
727 | | - "prometheus*" |
728 | | - ], |
729 | | - "enabled": true, |
730 | | - "cron_pattern": "0 * * * * *" |
731 | | - } |
732 | | - ] |
733 | | - } |
734 | | - } |
735 | | - } |
736 | | - }, |
737 | | - "400": { |
738 | | - "$ref": "#/components/responses/BadRequest" |
739 | | - }, |
740 | | - "401": { |
741 | | - "$ref": "#/components/responses/Unauthorized" |
742 | | - }, |
743 | | - "429": { |
744 | | - "$ref": "#/components/responses/TooManyRequests" |
745 | | - }, |
746 | | - "500": { |
747 | | - "$ref": "#/components/responses/ServerError" |
748 | | - } |
749 | | - }, |
750 | | - "requestBody": { |
751 | | - "required": true, |
752 | | - "content": { |
753 | | - "application/json": { |
754 | | - "schema": { |
755 | | - "$ref": "#/components/schemas/RuleIDsRequest" |
756 | | - }, |
757 | | - "example": { |
758 | | - "ids": [ |
759 | | - 50001 |
760 | | - ] |
761 | | - } |
762 | | - } |
763 | | - } |
764 | | - } |
765 | | - } |
766 | | - }, |
767 | 685 | "/monit/datasource/sls/logstores": { |
768 | 686 | "post": { |
769 | 687 | "operationId": "monit-datasource-read-sls-logstores", |
|
1079 | 997 | } |
1080 | 998 | } |
1081 | 999 | }, |
1082 | | - "/monit/rule/import": { |
1083 | | - "post": { |
1084 | | - "operationId": "monit-rule-write-import", |
1085 | | - "summary": "Import alert rules", |
1086 | | - "description": "Import one or more alert rules from a JSON array. Returns the result for each rule, indicating success or failure.", |
1087 | | - "tags": [ |
1088 | | - "Monitors/Alert rules" |
1089 | | - ], |
1090 | | - "x-mint": { |
1091 | | - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- The request body is a JSON array of rule export objects (compatible with the output of `POST /monit/rule/export`).\n- Each object must include `folder_id`, `ds_type`, and either `ds_list` or `ds_ids`.\n- Some rules may fail (e.g. duplicate name). Check each result for individual status.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", |
1092 | | - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-import", |
1093 | | - "metadata": { |
1094 | | - "sidebarTitle": "Import alert rules" |
1095 | | - } |
1096 | | - }, |
1097 | | - "responses": { |
1098 | | - "200": { |
1099 | | - "description": "Success", |
1100 | | - "content": { |
1101 | | - "application/json": { |
1102 | | - "schema": { |
1103 | | - "allOf": [ |
1104 | | - { |
1105 | | - "$ref": "#/components/schemas/SuccessEnvelope" |
1106 | | - }, |
1107 | | - { |
1108 | | - "type": "object", |
1109 | | - "properties": { |
1110 | | - "data": { |
1111 | | - "$ref": "#/components/schemas/RuleImportResponse" |
1112 | | - } |
1113 | | - } |
1114 | | - } |
1115 | | - ] |
1116 | | - }, |
1117 | | - "example": { |
1118 | | - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", |
1119 | | - "data": [ |
1120 | | - { |
1121 | | - "name": "CPU High", |
1122 | | - "message": "" |
1123 | | - } |
1124 | | - ] |
1125 | | - } |
1126 | | - } |
1127 | | - } |
1128 | | - }, |
1129 | | - "400": { |
1130 | | - "$ref": "#/components/responses/BadRequest" |
1131 | | - }, |
1132 | | - "401": { |
1133 | | - "$ref": "#/components/responses/Unauthorized" |
1134 | | - }, |
1135 | | - "429": { |
1136 | | - "$ref": "#/components/responses/TooManyRequests" |
1137 | | - }, |
1138 | | - "500": { |
1139 | | - "$ref": "#/components/responses/ServerError" |
1140 | | - } |
1141 | | - }, |
1142 | | - "requestBody": { |
1143 | | - "required": true, |
1144 | | - "content": { |
1145 | | - "application/json": { |
1146 | | - "schema": { |
1147 | | - "$ref": "#/components/schemas/RuleImportRequest" |
1148 | | - }, |
1149 | | - "example": [ |
1150 | | - { |
1151 | | - "folder_id": 100, |
1152 | | - "name": "CPU High", |
1153 | | - "ds_type": "prometheus", |
1154 | | - "ds_list": [ |
1155 | | - "prometheus*" |
1156 | | - ], |
1157 | | - "enabled": true, |
1158 | | - "cron_pattern": "0 * * * * *", |
1159 | | - "rule_configs": { |
1160 | | - "queries": [ |
1161 | | - { |
1162 | | - "name": "A", |
1163 | | - "expr": "avg(cpu_usage_idle) < 10" |
1164 | | - } |
1165 | | - ] |
1166 | | - } |
1167 | | - } |
1168 | | - ] |
1169 | | - } |
1170 | | - } |
1171 | | - } |
1172 | | - } |
1173 | | - }, |
1174 | 1000 | "/monit/rule/list/basic": { |
1175 | 1001 | "post": { |
1176 | 1002 | "operationId": "monit-rule-read-list", |
|
0 commit comments