|
16 | 16 | "application/json"
|
17 | 17 | ],
|
18 | 18 | "paths": {
|
| 19 | + "/api/v1/alerts/rule": { |
| 20 | + "post": { |
| 21 | + "operationId": "SaveAlertRule", |
| 22 | + "responses": { |
| 23 | + "200": { |
| 24 | + "description": "A successful response.", |
| 25 | + "schema": { |
| 26 | + "type": "object", |
| 27 | + "properties": {} |
| 28 | + } |
| 29 | + } |
| 30 | + }, |
| 31 | + "parameters": [ |
| 32 | + { |
| 33 | + "name": "body", |
| 34 | + "in": "body", |
| 35 | + "required": true, |
| 36 | + "schema": { |
| 37 | + "$ref": "#/definitions/alert_service.SaveAlertRuleRequest" |
| 38 | + } |
| 39 | + } |
| 40 | + ], |
| 41 | + "tags": [ |
| 42 | + "Alerts" |
| 43 | + ] |
| 44 | + } |
| 45 | + }, |
19 | 46 | "/api/v1/alerts/rule/project/{projectId}": {
|
20 | 47 | "get": {
|
21 | 48 | "summary": "List all alert rules for a project",
|
|
41 | 68 | ]
|
42 | 69 | }
|
43 | 70 | },
|
| 71 | + "/api/v1/alerts/rule/{id}": { |
| 72 | + "put": { |
| 73 | + "operationId": "SaveAlertRule2", |
| 74 | + "responses": { |
| 75 | + "200": { |
| 76 | + "description": "A successful response.", |
| 77 | + "schema": { |
| 78 | + "type": "object", |
| 79 | + "properties": {} |
| 80 | + } |
| 81 | + } |
| 82 | + }, |
| 83 | + "parameters": [ |
| 84 | + { |
| 85 | + "name": "id", |
| 86 | + "in": "path", |
| 87 | + "required": true, |
| 88 | + "type": "string" |
| 89 | + }, |
| 90 | + { |
| 91 | + "name": "body", |
| 92 | + "in": "body", |
| 93 | + "required": true, |
| 94 | + "schema": { |
| 95 | + "$ref": "#/definitions/alert_service.AlertService.SaveAlertRuleBody" |
| 96 | + } |
| 97 | + } |
| 98 | + ], |
| 99 | + "tags": [ |
| 100 | + "Alerts" |
| 101 | + ] |
| 102 | + } |
| 103 | + }, |
44 | 104 | "/api/v1/alerts/{ruleId}": {
|
45 | 105 | "get": {
|
46 | 106 | "summary": "Find an alert rule by id, and list all alerts for this rule",
|
|
2360 | 2420 | ],
|
2361 | 2421 | "default": "NO_DATA"
|
2362 | 2422 | },
|
| 2423 | + "alert_service.AlertService.SaveAlertRuleBody": { |
| 2424 | + "type": "object", |
| 2425 | + "properties": { |
| 2426 | + "rule": { |
| 2427 | + "type": "object", |
| 2428 | + "properties": { |
| 2429 | + "projectId": { |
| 2430 | + "type": "string", |
| 2431 | + "title": "project it belongs to" |
| 2432 | + }, |
| 2433 | + "state": { |
| 2434 | + "$ref": "#/definitions/alert_service.AlertRule.State" |
| 2435 | + }, |
| 2436 | + "subject": { |
| 2437 | + "type": "string" |
| 2438 | + }, |
| 2439 | + "message": { |
| 2440 | + "type": "string" |
| 2441 | + }, |
| 2442 | + "group": { |
| 2443 | + "type": "string" |
| 2444 | + }, |
| 2445 | + "query": { |
| 2446 | + "type": "string" |
| 2447 | + }, |
| 2448 | + "for": { |
| 2449 | + "$ref": "#/definitions/common.Duration" |
| 2450 | + }, |
| 2451 | + "channels": { |
| 2452 | + "type": "array", |
| 2453 | + "items": { |
| 2454 | + "type": "object", |
| 2455 | + "$ref": "#/definitions/common.Channel" |
| 2456 | + } |
| 2457 | + }, |
| 2458 | + "updateTime": { |
| 2459 | + "type": "string", |
| 2460 | + "format": "date-time" |
| 2461 | + }, |
| 2462 | + "condition": { |
| 2463 | + "$ref": "#/definitions/alert_service.Condition" |
| 2464 | + }, |
| 2465 | + "renotifyDuration": { |
| 2466 | + "$ref": "#/definitions/common.Duration" |
| 2467 | + }, |
| 2468 | + "renotifyLimit": { |
| 2469 | + "type": "integer", |
| 2470 | + "format": "int32" |
| 2471 | + }, |
| 2472 | + "alertType": { |
| 2473 | + "$ref": "#/definitions/alert_service.AlertType" |
| 2474 | + }, |
| 2475 | + "logCondition": { |
| 2476 | + "$ref": "#/definitions/alert_service.LogCondition" |
| 2477 | + }, |
| 2478 | + "lastQueryTime": { |
| 2479 | + "type": "string", |
| 2480 | + "format": "date-time" |
| 2481 | + }, |
| 2482 | + "mute": { |
| 2483 | + "type": "boolean" |
| 2484 | + }, |
| 2485 | + "interval": { |
| 2486 | + "$ref": "#/definitions/common.Duration" |
| 2487 | + } |
| 2488 | + }, |
| 2489 | + "title": "maybe need to extract to common so it could used by web as well" |
| 2490 | + } |
| 2491 | + } |
| 2492 | + }, |
2363 | 2493 | "alert_service.AlertType": {
|
2364 | 2494 | "type": "string",
|
2365 | 2495 | "enum": [
|
|
2527 | 2657 | }
|
2528 | 2658 | }
|
2529 | 2659 | },
|
| 2660 | + "alert_service.SaveAlertRuleRequest": { |
| 2661 | + "type": "object", |
| 2662 | + "properties": { |
| 2663 | + "rule": { |
| 2664 | + "$ref": "#/definitions/alert_service.AlertRule" |
| 2665 | + } |
| 2666 | + } |
| 2667 | + }, |
2530 | 2668 | "analytic_service.AnalyticService.ExecuteSQLBody": {
|
2531 | 2669 | "type": "object",
|
2532 | 2670 | "example": {
|
|
0 commit comments