Merge pull request #5764 from zexi/hotfix/swagger-for-monitor

codegen: add monitor
This commit is contained in:
Zexi Li
2020-04-10 15:48:00 +08:00
committed by GitHub
2 changed files with 19 additions and 5 deletions
+11 -5
View File
@@ -24,13 +24,18 @@ import (
type SAlert struct {
apis.SVirtualResourceBase
apis.SEnabledResourceBase
// Frequency is evaluate period
Frequency int64 `json:"frequency"`
Settings interface{} `json:"settings"`
Level string `json:"level"`
Message string `json:"message"`
UsedBy string `json:"used_by"`
// Silenced bool
ExecutionError string `json:"execution_error"`
ExecutionError string `json:"execution_error"`
// If an alert rule has a configured `For` and the query violates the configured threshold
// it will first go from `OK` to `Pending`. Going from `OK` to `Pending` will not send any
// notifications. Once the alert rule has been firing for more than `For` duration, it will
// change to `Alerting` and send alert notifications.
For int64 `json:"for"`
EvalData interface{} `json:"eval_data"`
State string `json:"state"`
@@ -49,10 +54,11 @@ type SAlertJointsBase struct {
// SAlertnotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertnotification.
type SAlertnotification struct {
SAlertJointsBase
NotificationId string `json:"notification_id"`
State string `json:"state"`
Index byte `json:"index"`
UsedBy string `json:"used_by"`
NotificationId string `json:"notification_id"`
State string `json:"state"`
Index byte `json:"index"`
UsedBy string `json:"used_by"`
Params interface{} `json:"params"`
}
// SDataSource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SDataSource.
+8
View File
@@ -138,6 +138,8 @@ class ModelAPI(FuncDispatcher):
def gen_identity(self):
self.run(pkg=["keystone", "models"], out=["identity"])
def gen_monitor(self):
self.run(pkg=["monitor", "models"], out=["monitor"])
class SwaggerCode(FuncDispatcher):
@@ -172,6 +174,9 @@ class SwaggerCode(FuncDispatcher):
def gen_image(self):
self.run("image", pkg=["models"], out="image")
def gen_monitor(self):
self.run("monitor", pkg=["models"], out="monitor")
class SwaggerYAML(FuncDispatcher):
@@ -196,6 +201,9 @@ class SwaggerYAML(FuncDispatcher):
def gen_image(self):
self.run("image")
def gen_monitor(self):
self.run("monitor")
class SwaggerServe(object):