v1

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertHookReq added in v1.2.0

type AlertHookReq struct {
	g.Meta `path:"/alert/webhook" tags:"alert" method:"post" summary:"webhook for alertmanager"`
}

webhook告警推送

type AlertHookRes added in v1.2.0

type AlertHookRes struct {
	g.Meta `mime:"application/json"`
}

type AlertPageReq added in v1.2.0

type AlertPageReq struct {
	g.Meta   `path:"/alert/page" tags:"alert" method:"post" summary:"fetch alert list by page"`
	PageNo   int    `p:"page" d:"1"  v:"min:1#分页号码错误"`         // 分页号码
	PageSize int    `p:"pageSize" d:"10" v:"max:50#分页数量最大50条"` // 分页数量,最大50
	Labels   string `p:"labels" dc:"alert labels"`
}

分页查询告警信息

type AlertPageRes added in v1.2.0

type AlertPageRes struct {
	g.Meta   `mime:"text/html"`
	Models   interface{} `json:"rows" dc:"list of query result"`
	Total    int         `json:"total" dc:"total count"`
	PageNo   int         `json:"page" dc:"current page no"`
	PageSize int         `json:"pageSize" dc:"current page size"`
}

type ConfigAddReq added in v1.1.0

type ConfigAddReq struct {
	g.Meta `path:"/config/add" tags:"config" method:"put" summary:"add configuration"`
	Name   string `p:"name" v:"required" dc:"config name"`
	Value  string `p:"value" v:"required" dc:"config value"`
}

新增

type ConfigAddRes added in v1.1.0

type ConfigAddRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type ConfigDetailReq added in v1.1.0

type ConfigDetailReq struct {
	g.Meta `path:"/config/detail/{id}" tags:"config" method:"get" summary:"get configuration detail"`
	Id     int `p:"id" v:"required" dc:"config item id"`
}

单个详情

type ConfigDetailRes added in v1.1.0

type ConfigDetailRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type ConfigNameReq added in v1.1.0

type ConfigNameReq struct {
	g.Meta `path:"/config/name/{name}" tags:"config" method:"get" summary:"get configuration with page"`
	Name   string `p:"name" v:"required" dc:"config name"`
}

根据配置名查询

type ConfigNameRes added in v1.1.0

type ConfigNameRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type ConfigPageReq added in v1.1.0

type ConfigPageReq struct {
	g.Meta   `path:"/config/page" tags:"config" method:"post" summary:"get configuration with page"`
	Name     string `p:"name" dc:"config name"`
	PageNo   int    `p:"page" v:"min:1" d:"1"`
	PageSize int    `p:"pageSize" v:"min:1" d:"10"`
}

分页查询

type ConfigPageRes added in v1.1.0

type ConfigPageRes struct {
	g.Meta   `mime:"application/json"`
	Models   interface{} `json:"rows"`
	Total    int         `p:"total" dc:"total record"`
	PageNo   int         `p:"page" dc:"current page"`
	PageSize int         `p:"pageSize" dc:"current page size"`
}

type ConfigRemoveReq added in v1.1.0

type ConfigRemoveReq struct {
	g.Meta `path:"/config/remove/{id}" tags:"config" method:"delete" summary:"delete configuration"`
	Id     int `p:"id" v:"required" dc:"config item id"`
}

删除

type ConfigRemoveRes added in v1.1.0

type ConfigRemoveRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type ConfigUpdateReq added in v1.1.0

type ConfigUpdateReq struct {
	g.Meta `path:"/config/update" tags:"config" method:"post" summary:"update configuration"`
	Id     int    `p:"id" v:"required" dc:"config item id"`
	Name   string `p:"name" v:"required" dc:"config name"`
	Value  string `p:"value" v:"required" dc:"config value"`
}

修改

type ConfigUpdateRes added in v1.1.0

type ConfigUpdateRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type GroupAddReq

type GroupAddReq struct {
	g.Meta         `path:"/group/add" tags:"group" method:"put" summary:"add prometheus group"`
	Name           string `p:"name" v:"required" dc:"group name"`
	Identification string `p:"identification" dc:"group unique id"`
}

添加分组

type GroupAddRes

type GroupAddRes struct {
	g.Meta `mime:"text/html"`
	Model  interface{} `dc:"insert result , final entity"`
}

type GroupDeleteReq

type GroupDeleteReq struct {
	g.Meta `path:"/group/remove/{id}" tags:"group" method:"delete" summary:"remove the group"`
	Id     string `p:"id" v:"required" dc:"group id,key"`
}

删除分组

type GroupDeleteRes

type GroupDeleteRes struct {
	g.Meta `mime:"text/html"`
	Model  interface{} `dc:"insert result , final entity"`
}

type GroupDetailReq

type GroupDetailReq struct {
	g.Meta `path:"/group/detail/{id}" tags:"group" method:"get" summary:"get the detail info"`
	Id     string `p:"id" v:"required" dc:"group id,key"`
}

查询单体详情

type GroupDetailRes

type GroupDetailRes struct {
	g.Meta `mime:"text/html"`
	Model  interface{} `json:"model" dc:"group detail"`
}

type GroupListReq

type GroupListReq struct {
	g.Meta `path:"/group/list" tags:"group" method:"get" summary:"fetch group all list"`
}

查询全部分组

type GroupListRes

type GroupListRes struct {
	g.Meta `mime:"text/html"`
	Model  interface{} `json:"models" dc:"entity"`
}

type GroupPageReq

type GroupPageReq struct {
	g.Meta         `path:"/group/page" tags:"group" method:"post" summary:"fetch group list by page"`
	PageNo         int    `p:"page" d:"1"  v:"min:1#分页号码错误"`         // 分页号码
	PageSize       int    `p:"pageSize" d:"10" v:"max:50#分页数量最大50条"` // 分页数量,最大50
	Name           string `p:"name" dc:"group name"`
	Identification string `p:"identification" dc:"group unique id"`
}

分页查询

type GroupPageRes

type GroupPageRes struct {
	g.Meta   `mime:"text/html"`
	Models   interface{} `json:"rows" dc:"list of query result"`
	Total    int         `json:"total" dc:"total count"`
	PageNo   int         `json:"page" dc:"current page no"`
	PageSize int         `json:"pageSize" dc:"current page size"`
}

type GroupUpdateReq

type GroupUpdateReq struct {
	g.Meta         `path:"/group/update" tags:"group" method:"post" summary:"add prometheus group"`
	Id             string `p:"id" v:"required" dc:"group id,key"`
	Name           string `p:"name" v:"required" dc:"group name"`
	Identification string `p:"identification" dc:"group unique id"`
}

更新分组

type GroupUpdateRes

type GroupUpdateRes struct {
	g.Meta `mime:"text/html"`
	Model  interface{} `dc:"insert result , final entity"`
}

type HelloReq

type HelloReq struct {
	g.Meta `path:"/version" tags:"Hello" method:"get" summary:"the version of this program"`
}

type HelloRes

type HelloRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type LoginReq

type LoginReq struct {
	g.Meta    `path:"/login" tags:"Login" method:"post" summary:"user login api"`
	LoginName string `p:"loginName" v:"required" dc:"user's login name"`
	Password  string `p:"password" v:"required" dc:"password"`
}

type LoginRes

type LoginRes struct {
	g.Meta   `mime:"text/html" example:"success"`
	Token    string `json:"token" dc:"login token"`
	UserInfo string `json:"userInfo" dc:"user detail without password"`
}

type NodeActiveReq

type NodeActiveReq struct {
	g.Meta `path:"/node/active" tags:"node" method:"post" summary:"node active status change"`
	Id     int  `p:"id" v:"required" dc:"Node record id"`
	Active bool `p:"active" v:"required|boolean" dc:"Node active status true or false"`
}

type NodeActiveRes

type NodeActiveRes struct {
	g.Meta `mime:"application/json"`
}

type NodeAddReq

type NodeAddReq struct {
	g.Meta  `path:"/node/add" tags:"node" method:"put" summary:"add node"`
	Alias   string `p:"alias" v:"required" dc:"node exporter item name"`
	Host    string `p:"host" v:"required|ip" dc:"node host or ip"`
	Port    string `p:"port" v:"required|min:1|max:65535" dc:"node exporter port"`
	Owner   string `p:"owner" v:"required" dc:"this job record owner"`
	Group   string `p:"group" v:"required" dc:"group name"`
	JobName string `p:"jobName" v:"required" dc:"job name"`
	Labels  string `p:"labels" dc:"extend pair values for job"`
}

* 添加

type NodeAddRes

type NodeAddRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model" dc:"add result"`
}

type NodeDetailReq

type NodeDetailReq struct {
	g.Meta `path:"/node/detail/{id}" tags:"node" method:"get" summary:"delete node"`
	Id     string `p:"id" v:"required" dc:"node record id"`
}

type NodeDetailRes

type NodeDetailRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model" dc:"the delete result"`
}

type NodePageReq

type NodePageReq struct {
	g.Meta   `path:"/node/page" tags:"node" method:"post" summary:"page node query"`
	PageNo   int    `p:"page" d:"1" v:"min:1#can not lower than 1" dc:"page number"`
	PageSize int    `p:"pageSize" d:"10" v:"max:100" dc:"page size of each page"`
	Alias    string `p:"alias" dc:"node exporter item name"`
	Host     string `p:"host" dc:"node host or ip"`
	Port     string `p:"port" dc:"node exporter port"`
	Owner    string `p:"owner" dc:"this job record owner"`
	Group    string `p:"group" dc:"group name"`
	JobName  string `p:"jobName" dc:"job name"`
}

type NodePageRes

type NodePageRes struct {
	g.Meta   `mime:"application/json"`
	PageNo   int         `json:"page" dc:"current page number "`
	PageSize int         `json:"pageSize" dc:"current page size"`
	Total    int         `json:"total" dc:"total record for this query condition"`
	Models   interface{} `json:"rows" dc:"records of node"`
}

type NodeRemoveReq

type NodeRemoveReq struct {
	g.Meta `path:"/node/remove/{id}" tags:"node" method:"delete" summary:"delete node"`
	Id     string `p:"id" v:"required" dc:"node record id"`
}

type NodeRemoveRes

type NodeRemoveRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model" dc:"the delete result"`
}

type NodeTargetReq

type NodeTargetReq struct {
	g.Meta `path:"/node/target" tags:"target" method:"get" dc:"prometheus http_sd target"`
}

type NodeTargetRes

type NodeTargetRes struct {
	g.Meta `mime:"application/json"`
}

type NodeUpdateReq

type NodeUpdateReq struct {
	g.Meta  `path:"/node/update" tags:"node" method:"post" summary:"update node"`
	Id      string `p:"id" v:"required" dc:"node record id"`
	Alias   string `p:"alias" v:"required" dc:"node exporter item name"`
	Host    string `p:"host" v:"required|ip" dc:"node host or ip"`
	Port    string `p:"port" v:"required|min:1|max:65535" dc:"node exporter port"`
	Owner   string `p:"owner" v:"required" dc:"this job record owner"`
	Group   string `p:"group" v:"required" dc:"group name"`
	JobName string `p:"jobName" v:"required" dc:"job name"`
	Labels  string `p:"labels" dc:"extend pair values for job"`
}

* 更新

type NodeUpdateRes

type NodeUpdateRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `dc:"the update result"`
}

type RegisterReq

type RegisterReq struct {
	g.Meta      `path:"/regist" tags:"Regist" method:"post"  summary:"regist account"`
	LoginName   string `p:"loginName" v:"required" dc:"user's login name"`
	Name        string `p:"name" v:"required" dc:"user's name"`
	Password    string `` /* 148-byte string literal not displayed */
	Repassword  string `p:"repassword" v:"same:password#密码必须相同" dc:"password check"`
	Email       string `p:"email" v:"required" dc:"user's email address , all alert message will send to this address"`
	PhoneNumber string `p:"phoneNumber" v:"required" dc:"telephone number"`
}

type RegisterRes

type RegisterRes struct {
	g.Meta `mime:"text/html" example:"success"`
}

type RuleActiveReq added in v1.1.0

type RuleActiveReq struct {
	g.Meta `path:"/rule/active" tags:"Rule" method:"post" summary:"change the rule status"`
	Id     int  `p:"id" v:"required|integer|min:1" dc:"rule record id"`
	Active bool `p:"active" v:"required|boolean" dc:"active status must be true or false"`
}

变更状态

type RuleActiveRes added in v1.1.0

type RuleActiveRes struct {
	g.Meta `mime:"application/json"`
}

type RuleAddReq added in v1.1.0

type RuleAddReq struct {
	g.Meta    `path:"/rule/add" tags:"Rule" method:"put" summary:"add Rule"`
	GroupName string `p:"groupName" v:"required" dc:"Rule group name"`
	Type      string `p:"type" v:"required" dc:"Rule type alert or record"`
	Content   string `p:"content" v:"required|yaml"`
}

新增

type RuleAddRes added in v1.1.0

type RuleAddRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type RuleDetailReq added in v1.1.0

type RuleDetailReq struct {
	g.Meta `path:"/rule/detail/{id}" tags:"Rule" method:"get" summary:"get Rule detail"`
	Id     int `p:"id" v:"required" dc:"Rule item id"`
}

单个详情

type RuleDetailRes added in v1.1.0

type RuleDetailRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type RuleFileGeneratedReq added in v1.1.0

type RuleFileGeneratedReq struct {
	g.Meta `` /* 137-byte string literal not displayed */
}

生成规则文件

type RuleFileGeneratedRes added in v1.1.0

type RuleFileGeneratedRes struct {
	g.Meta `mime:"application/json"`
}

type RulePageReq added in v1.1.0

type RulePageReq struct {
	g.Meta    `path:"/rule/page" tags:"Rule" method:"post" summary:"get rules with page"`
	GroupName string `p:"groupName" dc:"Rule group name"`
	Type      string `p:"type" dc:"Rule type alert or record"`
	PageNo    int    `p:"page" v:"min:1" d:"1"`
	PageSize  int    `p:"pageSize" v:"min:1" d:"10"`
}

分页查询

type RulePageRes added in v1.1.0

type RulePageRes struct {
	g.Meta   `mime:"application/json"`
	Models   interface{} `json:"rows"`
	Total    int         `json:"total" dc:"total record"`
	PageNo   int         `json:"page" dc:"current page"`
	PageSize int         `json:"pageSize" dc:"current page size"`
}

type RuleRemoveReq added in v1.1.0

type RuleRemoveReq struct {
	g.Meta `path:"/rule/remove/{id}" tags:"Rule" method:"delete" summary:"delete Rule"`
	Id     int `p:"id" v:"required" dc:"Rule item id"`
}

删除

type RuleRemoveRes added in v1.1.0

type RuleRemoveRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type RuleUpdateReq added in v1.1.0

type RuleUpdateReq struct {
	g.Meta    `path:"/rule/update" tags:"Rule" method:"post" summary:"update Rule"`
	Id        int    `p:"id" v:"required|min:1" dc:"Rule item id"`
	GroupName string `p:"groupName" v:"required" dc:"Rule group name"`
	Type      string `p:"type" v:"required" dc:"Rule type alert or record"`
	Content   string `p:"content" v:"required|yaml"`
	Active    bool   `p:"active" v:"required|boolean" dc:"active or not the default is true"`
}

修改

type RuleUpdateRes added in v1.1.0

type RuleUpdateRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type UserAddReq

type UserAddReq struct {
	g.Meta      `path:"/user/add" tags:"User" method:"put" summary:"add user"`
	LoginName   string `p:"loginName" v:"required" dc:"user's login name"`
	Name        string `p:"name" v:"required" dc:"user's name"`
	Password    string `` /* 148-byte string literal not displayed */
	Email       string `p:"email" v:"required|email" dc:"user's email address , all alert message will send to this address"`
	PhoneNumber string `p:"phoneNumber" v:"required|phone" dc:"telephone number"`
}

添加

type UserAddRes

type UserAddRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type UserDetailReq

type UserDetailReq struct {
	g.Meta `path:"/user/detail/{id}" tags:"User" method:"get" summary:"get single user detail"`
	Id     int `p:"id" v:"required|integer" dc:"user record id"`
}

查询单个详情

type UserDetailRes

type UserDetailRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type UserPageReq

type UserPageReq struct {
	g.Meta      `path:"/user/page" tags:"User" method:"post" summary:"find user by page"`
	PageNo      int    `p:"page" v:"min:1" d:"1" dc:"page number"`
	PageSize    int    `p:"pageSize" v:"max:50" d:"10" dc:"page size"`
	LoginName   string `p:"loginName" dc:"user's login name"`
	Name        string `p:"name" dc:"user's name"`
	Email       string `p:"email" dc:"user's email address , all alert message will send to this address"`
	PhoneNumber string `p:"phoneNumber"  dc:"telephone number"`
}

分页查询

type UserPageRes

type UserPageRes struct {
	g.Meta   `mime:"application/json"`
	Models   interface{} `json:"rows"`
	Total    int         `json:"total" dc:"number of this condition"`
	PageNo   int         `json:"page"`
	PageSize int         `json:"pageSize"`
}

type UserRemoveReq

type UserRemoveReq struct {
	g.Meta `path:"/user/delete/{id}" tags:"User" method:"delete" summary:"delete user"`
	Id     int `p:"id" v:"required|integer" dc:"user record id"`
}

删除

type UserRemoveRes

type UserRemoveRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

type UserUpdatePasswordReq

type UserUpdatePasswordReq struct {
	g.Meta      `path:"/user/updatePassword" tags:"User" method:"post" summary:"reset user password"`
	Id          int    `p:"id" v:"min:1|required#请填写正确的用户主键"`
	Password    string `p:"password" v:"required"  dc:"old password"`
	NewPassword string `p:"newPassword" v:"required" dc:"new password"`
}

更新密码

type UserUpdatePasswordRes

type UserUpdatePasswordRes struct {
	g.Meta `mime:"application/json"`
}

type UserUpdateReq

type UserUpdateReq struct {
	g.Meta      `path:"/user/update" tags:"User" method:"post" summary:"update user"`
	Id          int    `p:"id"  v:"required|integer" dc:"User record id"`
	LoginName   string `p:"loginName" v:"required" dc:"user's login name"`
	Name        string `p:"name" v:"required" dc:"user's name"`
	Email       string `p:"email" v:"required|email" dc:"user's email address , all alert message will send to this address"`
	PhoneNumber string `p:"phoneNumber" v:"required|phone" dc:"telephone number"`
}

更新

type UserUpdateRes

type UserUpdateRes struct {
	g.Meta `mime:"application/json"`
	Model  interface{} `json:"model"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL