v1

package
v0.0.0-...-9e37d8c Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTags

func AddTags(c *gin.Context)

AddTags add tags by agent_id/ipv4/ipv6

func AddTagsByFilter

func AddTagsByFilter(c *gin.Context)

AddTagsByFilter add tags by filter. Example: (Post json is a common filter)

	Post /addTags/filter?tag=test
		{
   		"filter": [
       	{
           	"key": "last_heartbeat_time",
           	"rules": [
        	       {
        	           "operator": "$gt",
          	         "value": 1614255379
        	       }
       	    ],
      	     "condition": "$and"
      	 }
   		],
   		"condition": "$and"
		}

which will add test to all agent_id.last_heartbeat_time > 1614255379

func BulkNewAsset

func BulkNewAsset(c *gin.Context)

func CheckPassword

func CheckPassword(c *gin.Context)

CheckPassword 验证用户密码,用户本身可操作

func ControlAgentTask

func ControlAgentTask(c *gin.Context)

ControlAgentTask Post task to Agent:

if it is config, modify db at the same time.
if it is task, write the task to db(subtask) for reconciliation.

func ControlAgentTaskByNum

func ControlAgentTaskByNum(c *gin.Context)

ControlAgentTaskByNum 按照机器数量控制任务

func CreateConfTask

func CreateConfTask(c *gin.Context)

func CreateCtrlTask

func CreateCtrlTask(c *gin.Context)

func CreateDelConfTask

func CreateDelConfTask(c *gin.Context)

func CreateTaskTask

func CreateTaskTask(c *gin.Context)

func CreateUserV6

func CreateUserV6(c *gin.Context)

CreateUserV6 管理员可操作

func DelUser

func DelUser(c *gin.Context)

DelUser 管理员可操作

func GetConfigByID

func GetConfigByID(c *gin.Context)

GetConfigByID return agent config by agent_id.

func GetDefaultConfig

func GetDefaultConfig(c *gin.Context)

GetDefaultConfig get default agent config

func GetJobByID

func GetJobByID(c *gin.Context)

GetJobByID return agent config by agent_id.

func GetStatus

func GetStatus(c *gin.Context)

GetStatus get all agent status. GET /getStatus?page=1&page_size=100

func GetStatusByFilter

func GetStatusByFilter(c *gin.Context)

GetStatusByFilter get agent status by filter Example: (Post json is a common filter)

	Post /getStatus/filter?page=1&page_size=100
		{
   		"filter": [
       	{
           	"key": "last_heartbeat_time",
           	"rules": [
        	       {
        	           "operator": "$gt",
          	         "value": 1614255379
        	       }
       	    ],
      	     "condition": "$and"
      	 }
   		],
   		"condition": "$and"
		}

which will return agents'status which match agent_id.last_heartbeat_time > 1614255379

func GetStatusByID

func GetStatusByID(c *gin.Context)

GetStatusByID get agent status by agent_id GET GetStatusByID/xxxxxxxx

func GetSubTaskByFilter

func GetSubTaskByFilter(c *gin.Context)

func GetSubTaskByID

func GetSubTaskByID(c *gin.Context)

func GetTags

func GetTags(c *gin.Context)

GetTags load all tags.

func GetTagsByID

func GetTagsByID(c *gin.Context)

GetTagsByID query tag by agent_id

func GetTaskByFilter

func GetTaskByFilter(c *gin.Context)

func GetTaskByID

func GetTaskByID(c *gin.Context)

GetTaskByID return task task_id.

func NewAsset

func NewAsset(c *gin.Context)

func QueryInfo

func QueryInfo(c *gin.Context)

QueryInfo query psm and tags by agent_id

func QuickTaskTask

func QuickTaskTask(c *gin.Context)

QuickTaskTask 不对账

func RemoveTags

func RemoveTags(c *gin.Context)

RemoveTags remove tag by agent_id/ipv4/ipv6

func ResetPassword

func ResetPassword(c *gin.Context)

ResetPassword 用户本身可操作

func UpdateDefaultConfig

func UpdateDefaultConfig(c *gin.Context)

UpdateDefaultConfig update default agent config

func UpdateSubTask

func UpdateSubTask(c *gin.Context)

UpdateSubTask 更新对账任务数据

func UpdateUser

func UpdateUser(c *gin.Context)

UpdateUser 管理员可操作

func UserInfo

func UserInfo(c *gin.Context)

func UserLogin

func UserLogin(c *gin.Context)

func UserLoginout

func UserLoginout(c *gin.Context)

Types

type AgentDelRequest

type AgentDelRequest struct {
	Tag    string   `json:"tag" bson:"tag"`
	IDList []string `json:"id_list" bson:"id_list"`
	Data   []string `json:"data" binding:"required" bson:"data"`
}

type AgentExtraInfoResp

type AgentExtraInfoResp struct {
	Tags     string `json:"tags"`
	PSMName  string `json:"psm_name"`
	PSMPath  string `json:"psm_path"`
	Enhanced string `json:"enhanced"`
}

type AgentTaskControl

type AgentTaskControl struct {
	TaskID         string  `json:"task_id" binding:"required" bson:"task_id"`
	Action         string  `json:"action" binding:"required" bson:"action"`
	RollingPercent float64 `json:"rolling_percent" binding:"required" bson:"rolling_percent"`
	Concurrence    int     `json:"concurrence" binding:"required" bson:"concurrence"`
}

type AuthRequest

type AuthRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoadTagReq

type LoadTagReq struct {
	IDList []string `json:"id_list" binding:"required"`
}

type TagRequest

type TagRequest struct {
	Tag    string   `json:"tag" binding:"required"`
	IPv4   []string `json:"ipv4_list"`
	IPv6   []string `json:"ipv6_list"`
	Agents []string `json:"id_list"`
}

Jump to

Keyboard shortcuts

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