ops

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo = OpsAgentInfo

type AgentMetaResponse

type AgentMetaResponse = OpsAgentMetaResponse

type AgentMetaUpdateRequest

type AgentMetaUpdateRequest = OpsAgentMetaUpdateRequest

type AgentMetricsRequest

type AgentMetricsRequest = OpsAgentMetricsRequest

type AgentMetricsResponse

type AgentMetricsResponse = OpsAgentMetricsResponse

type AgentProcessesRequest

type AgentProcessesRequest = OpsAgentProcessesRequest

type AgentProcessesResponse

type AgentProcessesResponse = OpsAgentProcessesResponse

type AgentService

type AgentService struct {
	// contains filtered or unexported fields
}

func NewAgentService

func NewAgentService(svcCtx *svc.ServiceContext) *AgentService

func (*AgentService) ExecCommand

func (s *AgentService) ExecCommand(ctx context.Context, agentId, command string, args []string, timeout int) (*OpsExecCommandResult, error)

func (*AgentService) GetMeta

func (s *AgentService) GetMeta(ctx context.Context, agentId string) (*OpsAgentSystemInfo, error)

func (*AgentService) List

func (s *AgentService) List(ctx context.Context, gameId, env, status string) ([]OpsAgentInfo, error)

func (*AgentService) RestartProcess

func (s *AgentService) RestartProcess(ctx context.Context, agentId string, pid int) error

func (*AgentService) StartProcess

func (s *AgentService) StartProcess(ctx context.Context, agentId, command string, args, env []string, dir string) (int, error)

func (*AgentService) StopProcess

func (s *AgentService) StopProcess(ctx context.Context, agentId string, pid int) error

type AgentSystemInfo

type AgentSystemInfo = OpsAgentSystemInfo

type AgentSystemInfoRequest

type AgentSystemInfoRequest = OpsAgentSystemInfoRequest

type AgentSystemInfoResponse

type AgentSystemInfoResponse = OpsAgentSystemInfoResponse

type AgentsListRequest

type AgentsListRequest = OpsAgentsListRequest

type AgentsListResponse

type AgentsListResponse = OpsAgentsListResponse

type AlertService

type AlertService struct {
	// contains filtered or unexported fields
}

func NewAlertService

func NewAlertService(svcCtx *svc.ServiceContext) *AlertService

func (*AlertService) DeleteSilence

func (s *AlertService) DeleteSilence(ctx context.Context, silenceId string) error

func (*AlertService) List

func (s *AlertService) List(ctx context.Context, gameId, env, status string) ([]OpsAlert, error)

func (*AlertService) ListSilences

func (s *AlertService) ListSilences(ctx context.Context, gameId string) ([]OpsAlert, error)

func (*AlertService) Silence

func (s *AlertService) Silence(ctx context.Context, alertId string, duration int, comment string) (string, error)

type AlertSilenceDeleteRequest

type AlertSilenceDeleteRequest = OpsAlertSilenceDeleteRequest

type AlertSilenceRequest

type AlertSilenceRequest = OpsAlertSilenceRequest

type AlertSilenceResponse

type AlertSilenceResponse = OpsAlertSilenceResponse

type AlertsRequest

type AlertsRequest = OpsAlertsRequest

type AlertsResponse

type AlertsResponse = OpsAlertsResponse

type Backup

type Backup struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Size      int64  `json:"size"`
	Type      string `json:"type"`
	Status    string `json:"status"`
	CreatedAt string `json:"createdAt"`
}

type BackupCreateRequest

type BackupCreateRequest struct {
	Name string `json:"name"`
	Type string `json:"type"` // full, incremental
}

type BackupDeleteRequest

type BackupDeleteRequest struct {
	ID string `uri:"id"`
}

type BackupDetailResponse

type BackupDetailResponse struct {
	Backup
}

type BackupDownloadRequest

type BackupDownloadRequest struct {
	ID string `uri:"id"`
}

type BackupService

type BackupService struct {
	// contains filtered or unexported fields
}

func NewBackupService

func NewBackupService(svcCtx *svc.ServiceContext) *BackupService

func (*BackupService) Create

func (s *BackupService) Create(ctx context.Context, gameId, env, backupType string, timeout int) (string, error)

func (*BackupService) Delete

func (s *BackupService) Delete(ctx context.Context, backupId string) error

func (*BackupService) GetDownloadURL

func (s *BackupService) GetDownloadURL(ctx context.Context, backupId string) (string, string, error)

func (*BackupService) List

func (s *BackupService) List(ctx context.Context, gameId, env string) ([]Backup, error)

type BackupsListRequest

type BackupsListRequest struct {
	Page     int    `form:"page,optional,default=1"`
	PageSize int    `form:"pageSize,optional,default=20"`
	Type     string `form:"type"`
}

type BackupsListResponse

type BackupsListResponse struct {
	Items []Backup `json:"items"`
	Total int64    `json:"total"`
	Page  int      `json:"page"`
	Size  int      `json:"pageSize"`
}

type CpuMetrics

type CpuMetrics = OpsCpuMetrics

type DiskMetrics

type DiskMetrics = OpsDiskMetrics

type ExecCommandRequest

type ExecCommandRequest = OpsExecCommandRequest

type ExecCommandResponse

type ExecCommandResponse = OpsExecCommandResponse

type ExecCommandResult

type ExecCommandResult = OpsExecCommandResult

type FunctionsRequest

type FunctionsRequest = OpsFunctionsRequest

type FunctionsResponse

type FunctionsResponse = OpsFunctionsResponse

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) AgentExecCommand

func (h *Handler) AgentExecCommand(c *gin.Context)

func (*Handler) AgentMeta

func (h *Handler) AgentMeta(c *gin.Context)

func (*Handler) AgentMetrics

func (h *Handler) AgentMetrics(c *gin.Context)

func (*Handler) AgentProcessRestart

func (h *Handler) AgentProcessRestart(c *gin.Context)

func (*Handler) AgentProcessStart

func (h *Handler) AgentProcessStart(c *gin.Context)

func (*Handler) AgentProcessStop

func (h *Handler) AgentProcessStop(c *gin.Context)

func (*Handler) AgentProcesses

func (h *Handler) AgentProcesses(c *gin.Context)

func (*Handler) AgentSystemInfo

func (h *Handler) AgentSystemInfo(c *gin.Context)

func (*Handler) AgentsList

func (h *Handler) AgentsList(c *gin.Context)

func (*Handler) AlertSilence

func (h *Handler) AlertSilence(c *gin.Context)

func (*Handler) Alerts

func (h *Handler) Alerts(c *gin.Context)

func (*Handler) BackupCreate

func (h *Handler) BackupCreate(c *gin.Context)

func (*Handler) BackupDelete

func (h *Handler) BackupDelete(c *gin.Context)

func (*Handler) BackupDownload

func (h *Handler) BackupDownload(c *gin.Context)

func (*Handler) BackupsList

func (h *Handler) BackupsList(c *gin.Context)

func (*Handler) Config

func (h *Handler) Config(c *gin.Context)

func (*Handler) Functions

func (h *Handler) Functions(c *gin.Context)

func (*Handler) HealthGet

func (h *Handler) HealthGet(c *gin.Context)

func (*Handler) HealthRun

func (h *Handler) HealthRun(c *gin.Context)

func (*Handler) HealthUpdate

func (h *Handler) HealthUpdate(c *gin.Context)

func (*Handler) MQ

func (h *Handler) MQ(c *gin.Context)

func (*Handler) MaintenanceGet

func (h *Handler) MaintenanceGet(c *gin.Context)

func (*Handler) MaintenanceUpdate

func (h *Handler) MaintenanceUpdate(c *gin.Context)

func (*Handler) Metrics

func (h *Handler) Metrics(c *gin.Context)

func (*Handler) NodeCommands

func (h *Handler) NodeCommands(c *gin.Context)

func (*Handler) NodeDrain

func (h *Handler) NodeDrain(c *gin.Context)

func (*Handler) NodeMeta

func (h *Handler) NodeMeta(c *gin.Context)

func (*Handler) NodeRestart

func (h *Handler) NodeRestart(c *gin.Context)

func (*Handler) NodeUndrain

func (h *Handler) NodeUndrain(c *gin.Context)

func (*Handler) Nodes

func (h *Handler) Nodes(c *gin.Context)

func (*Handler) NotificationsGet

func (h *Handler) NotificationsGet(c *gin.Context)

func (*Handler) NotificationsUpdate

func (h *Handler) NotificationsUpdate(c *gin.Context)

func (*Handler) OpsAgentExecCommand

func (h *Handler) OpsAgentExecCommand(c *gin.Context)

func (*Handler) OpsAgentMeta

func (h *Handler) OpsAgentMeta(c *gin.Context)

func (*Handler) OpsAgentMetrics

func (h *Handler) OpsAgentMetrics(c *gin.Context)

func (*Handler) OpsAgentProcessRestart

func (h *Handler) OpsAgentProcessRestart(c *gin.Context)

func (*Handler) OpsAgentProcessStart

func (h *Handler) OpsAgentProcessStart(c *gin.Context)

func (*Handler) OpsAgentProcessStop

func (h *Handler) OpsAgentProcessStop(c *gin.Context)

func (*Handler) OpsAgentProcesses

func (h *Handler) OpsAgentProcesses(c *gin.Context)

func (*Handler) OpsAgentSystemInfo

func (h *Handler) OpsAgentSystemInfo(c *gin.Context)

func (*Handler) OpsAgentsList

func (h *Handler) OpsAgentsList(c *gin.Context)

func (*Handler) OpsAlertSilence

func (h *Handler) OpsAlertSilence(c *gin.Context)

func (*Handler) OpsAlerts

func (h *Handler) OpsAlerts(c *gin.Context)

func (*Handler) OpsBackupCreate

func (h *Handler) OpsBackupCreate(c *gin.Context)

func (*Handler) OpsBackupDelete

func (h *Handler) OpsBackupDelete(c *gin.Context)

func (*Handler) OpsBackupDownload

func (h *Handler) OpsBackupDownload(c *gin.Context)

func (*Handler) OpsBackupsList

func (h *Handler) OpsBackupsList(c *gin.Context)

func (*Handler) OpsConfig

func (h *Handler) OpsConfig(c *gin.Context)

func (*Handler) OpsFunctions

func (h *Handler) OpsFunctions(c *gin.Context)

func (*Handler) OpsHealthGet

func (h *Handler) OpsHealthGet(c *gin.Context)

func (*Handler) OpsHealthRun

func (h *Handler) OpsHealthRun(c *gin.Context)

func (*Handler) OpsHealthUpdate

func (h *Handler) OpsHealthUpdate(c *gin.Context)

func (*Handler) OpsMQ

func (h *Handler) OpsMQ(c *gin.Context)

func (*Handler) OpsMaintenanceGet

func (h *Handler) OpsMaintenanceGet(c *gin.Context)

func (*Handler) OpsMaintenanceUpdate

func (h *Handler) OpsMaintenanceUpdate(c *gin.Context)

func (*Handler) OpsMetrics

func (h *Handler) OpsMetrics(c *gin.Context)

func (*Handler) OpsNodeCommands

func (h *Handler) OpsNodeCommands(c *gin.Context)

func (*Handler) OpsNodeDrain

func (h *Handler) OpsNodeDrain(c *gin.Context)

func (*Handler) OpsNodeMeta

func (h *Handler) OpsNodeMeta(c *gin.Context)

func (*Handler) OpsNodeRestart

func (h *Handler) OpsNodeRestart(c *gin.Context)

func (*Handler) OpsNodeUndrain

func (h *Handler) OpsNodeUndrain(c *gin.Context)

func (*Handler) OpsNodes

func (h *Handler) OpsNodes(c *gin.Context)

func (*Handler) OpsNotificationsGet

func (h *Handler) OpsNotificationsGet(c *gin.Context)

func (*Handler) OpsNotificationsUpdate

func (h *Handler) OpsNotificationsUpdate(c *gin.Context)

func (*Handler) OpsServices

func (h *Handler) OpsServices(c *gin.Context)

func (*Handler) OpsSilenceDelete

func (h *Handler) OpsSilenceDelete(c *gin.Context)

func (*Handler) OpsSilences

func (h *Handler) OpsSilences(c *gin.Context)

func (*Handler) Services

func (h *Handler) Services(c *gin.Context)

func (*Handler) SilenceDelete

func (h *Handler) SilenceDelete(c *gin.Context)

func (*Handler) Silences

func (h *Handler) Silences(c *gin.Context)

type HealthCheck

type HealthCheck = OpsHealthCheck

type HealthGetRequest

type HealthGetRequest = OpsHealthGetRequest

type HealthGetResponse

type HealthGetResponse = OpsHealthGetResponse

type HealthRunRequest

type HealthRunRequest = OpsHealthRunRequest

type HealthRunResponse

type HealthRunResponse = OpsHealthRunResponse

type HealthUpdateRequest

type HealthUpdateRequest = OpsHealthUpdateRequest

type HealthUpdateResponse

type HealthUpdateResponse = OpsHealthUpdateResponse

type MaintenanceGetRequest

type MaintenanceGetRequest = OpsMaintenanceGetRequest

type MaintenanceGetResponse

type MaintenanceGetResponse = OpsMaintenanceGetResponse

type MaintenanceUpdateRequest

type MaintenanceUpdateRequest = OpsMaintenanceUpdateRequest

type MaintenanceUpdateResponse

type MaintenanceUpdateResponse = OpsMaintenanceUpdateResponse

type MaintenanceWindow

type MaintenanceWindow = OpsMaintenanceWindow

type ManagedProcess

type ManagedProcess = OpsManagedProcess

type MemoryMetrics

type MemoryMetrics = OpsMemoryMetrics

type MetricsData

type MetricsData = OpsMetricsData

type MetricsQuery

type MetricsQuery = OpsMetricsQuery

type MetricsResponse

type MetricsResponse = OpsMetricsResponse

type NetworkMetrics

type NetworkMetrics = OpsNetworkMetrics

type Node

type Node struct {
	Id       string            `json:"id"`
	Hostname string            `json:"hostname"`
	Addr     string            `json:"addr"`
	GameId   string            `json:"gameId"`
	Env      string            `json:"env"`
	Status   string            `json:"status"`
	Labels   map[string]string `json:"labels"`
	LastSeen string            `json:"lastSeen"`
}

Node represents a node in the system

type NodeActionRequest

type NodeActionRequest = OpsNodeActionRequest

type NodeCommand

type NodeCommand struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Params      map[string]string `json:"params"`
}

NodeCommand represents a command that can be executed on a node

type NodeCommandsQuery

type NodeCommandsQuery = OpsNodeCommandsQuery

type NodeCommandsResponse

type NodeCommandsResponse = OpsNodeCommandsResponse

type NodeDrainResponse

type NodeDrainResponse = OpsNodeDrainResponse

type NodeMetaRequest

type NodeMetaRequest = OpsNodeMetaRequest

type NodeMetaResponse

type NodeMetaResponse = OpsNodeMetaResponse

type NodeRestartResponse

type NodeRestartResponse = OpsNodeRestartResponse

type NodeService

type NodeService struct {
	// contains filtered or unexported fields
}

func NewNodeService

func NewNodeService(svcCtx *svc.ServiceContext) *NodeService

func (*NodeService) Drain

func (s *NodeService) Drain(ctx context.Context, nodeId string) error

func (*NodeService) GetCommands

func (s *NodeService) GetCommands(ctx context.Context, nodeId string) ([]NodeCommand, error)

func (*NodeService) GetMeta

func (s *NodeService) GetMeta(ctx context.Context, nodeId string) (map[string]string, error)

func (*NodeService) List

func (s *NodeService) List(ctx context.Context, gameId, env, status string) ([]Node, error)

func (*NodeService) Restart

func (s *NodeService) Restart(ctx context.Context, nodeId string) error

func (*NodeService) Undrain

func (s *NodeService) Undrain(ctx context.Context, nodeId string) error

type NodeUndrainResponse

type NodeUndrainResponse = OpsNodeUndrainResponse

type NodesRequest

type NodesRequest = OpsNodesRequest

type NodesResponse

type NodesResponse = OpsNodesResponse

type NotificationChannel

type NotificationChannel = OpsNotificationChannel

type NotificationRule

type NotificationRule = OpsNotificationRule

type NotificationsGetRequest

type NotificationsGetRequest = OpsNotificationsGetRequest

type NotificationsGetResponse

type NotificationsGetResponse = OpsNotificationsGetResponse

type NotificationsUpdateRequest

type NotificationsUpdateRequest = OpsNotificationsUpdateRequest

type NotificationsUpdateResponse

type NotificationsUpdateResponse = OpsNotificationsUpdateResponse

type OpsAgentInfo

type OpsAgentInfo struct {
	AgentID   string            `json:"agentId"`
	GameID    string            `json:"gameId"`
	Env       string            `json:"env"`
	Version   string            `json:"version"`
	RPCAddr   string            `json:"rpcAddr"`
	Connected bool              `json:"connected"`
	LastSeen  string            `json:"lastSeen"`
	Functions []string          `json:"functions"`
	Processes []string          `json:"processes"`
	Labels    map[string]string `json:"labels"`
}

type OpsAgentMetaRequest

type OpsAgentMetaRequest struct {
	AgentId string `json:"agentId" binding:"required"`
}

OpsAgentMetaRequest is used to get agent metadata

type OpsAgentMetaResponse

type OpsAgentMetaResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsAgentMetaUpdateRequest

type OpsAgentMetaUpdateRequest struct {
	AgentID string      `json:"agentId"`
	Meta    interface{} `json:"meta"`
}

type OpsAgentMetricsRequest

type OpsAgentMetricsRequest struct {
	AgentID string `form:"agentId"`
	Since   string `form:"since"`
	Limit   int    `form:"limit"`
}

type OpsAgentMetricsResponse

type OpsAgentMetricsResponse struct {
	Code    int              `json:"code"`
	Message string           `json:"message"`
	Data    []OpsMetricsData `json:"data,omitempty"`
}

type OpsAgentProcessesRequest

type OpsAgentProcessesRequest struct {
	AgentID string `uri:"agentId"`
}

type OpsAgentProcessesResponse

type OpsAgentProcessesResponse struct {
	Code    int                 `json:"code"`
	Message string              `json:"message"`
	Data    []OpsManagedProcess `json:"data,omitempty"`
}

type OpsAgentSystemInfo

type OpsAgentSystemInfo struct {
	Hostname      string `json:"hostname"`
	OS            string `json:"os"`
	OSVersion     string `json:"osVersion"`
	KernelVersion string `json:"kernelVersion"`
	Arch          string `json:"arch"`
	CPUCores      int32  `json:"cpuCores"`
	TotalMemory   uint64 `json:"totalMemory"`
	BootTime      string `json:"bootTime"`
	AgentVersion  string `json:"agentVersion"`
}

type OpsAgentSystemInfoRequest

type OpsAgentSystemInfoRequest struct {
	AgentID string `uri:"agentId"`
}

type OpsAgentSystemInfoResponse

type OpsAgentSystemInfoResponse struct {
	Code    int                `json:"code"`
	Message string             `json:"message"`
	Data    OpsAgentSystemInfo `json:"data,omitempty"`
}

type OpsAgentsListRequest

type OpsAgentsListRequest struct {
}

type OpsAgentsListResponse

type OpsAgentsListResponse struct {
	Code    int            `json:"code"`
	Message string         `json:"message"`
	Data    []OpsAgentInfo `json:"data,omitempty"`
}

type OpsAlert

type OpsAlert struct {
	Severity    string                 `json:"severity,omitempty"`
	Service     string                 `json:"service,omitempty"`
	Instance    string                 `json:"instance,omitempty"`
	Summary     string                 `json:"summary,omitempty"`
	StartsAt    string                 `json:"starts_at,omitempty"`
	EndsAt      string                 `json:"ends_at,omitempty"`
	Duration    string                 `json:"duration,omitempty"`
	Silenced    bool                   `json:"silenced,omitempty"`
	Labels      map[string]interface{} `json:"labels,omitempty"`
	Annotations map[string]interface{} `json:"annotations,omitempty"`
}

type OpsAlertSilenceDeleteRequest

type OpsAlertSilenceDeleteRequest struct {
	ID string `uri:"id"`
}

type OpsAlertSilenceRequest

type OpsAlertSilenceRequest struct {
	AlertID  string `json:"alertId"`
	Duration int    `json:"duration"` // 静默时长(分钟)
}

type OpsAlertSilenceResponse

type OpsAlertSilenceResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsAlertsRequest

type OpsAlertsRequest struct {
}

type OpsAlertsResponse

type OpsAlertsResponse struct {
	Alerts []OpsAlert `json:"alerts"`
}

type OpsBackupCreateRequest

type OpsBackupCreateRequest struct {
	Name string `json:"name"`
}

type OpsBackupCreateResponse

type OpsBackupCreateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsBackupDeleteRequest

type OpsBackupDeleteRequest struct {
	ID string `uri:"id"`
}

type OpsBackupDeleteResponse

type OpsBackupDeleteResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsBackupDownloadRequest

type OpsBackupDownloadRequest struct {
	ID string `uri:"id"`
}

type OpsBackupDownloadResponse

type OpsBackupDownloadResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsBackupsListRequest

type OpsBackupsListRequest struct {
	Page     int `form:"page"`
	PageSize int `form:"pageSize"`
}

type OpsBackupsListResponse

type OpsBackupsListResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsConfigRequest

type OpsConfigRequest struct {
}

type OpsConfigResponse

type OpsConfigResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsCpuMetrics

type OpsCpuMetrics struct {
	UsagePercent float64   `json:"usagePercent"`
	Cores        int32     `json:"cores"`
	PerCore      []float64 `json:"perCore,omitempty"`
	Load1M       float64   `json:"load1m"`
	Load5M       float64   `json:"load5m"`
	Load15M      float64   `json:"load15m"`
}

type OpsDiskMetrics

type OpsDiskMetrics struct {
	MountPoint     string  `json:"mountPoint"`
	Device         string  `json:"device"`
	FsType         string  `json:"fsType"`
	TotalBytes     uint64  `json:"totalBytes"`
	UsedBytes      uint64  `json:"usedBytes"`
	AvailableBytes uint64  `json:"availableBytes"`
	UsagePercent   float64 `json:"usagePercent"`
}

type OpsExecCommandRequest

type OpsExecCommandRequest struct {
	AgentID string   `uri:"agentId"`
	Command string   `json:"command"`
	Args    []string `json:"args"`
	Timeout int32    `json:"timeout"`
}

type OpsExecCommandResponse

type OpsExecCommandResponse struct {
	Code    int                  `json:"code"`
	Message string               `json:"message"`
	Data    OpsExecCommandResult `json:"data,omitempty"`
}

type OpsExecCommandResult

type OpsExecCommandResult struct {
	Success  bool   `json:"success"`
	ExitCode int32  `json:"exitCode"`
	Stdout   string `json:"stdout"`
	Stderr   string `json:"stderr"`
}

type OpsFunctionsRequest

type OpsFunctionsRequest struct {
}

type OpsFunctionsResponse

type OpsFunctionsResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsHealthCheck

type OpsHealthCheck struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Enabled     bool   `json:"enabled"`
	Type        string `json:"type"`
	Kind        string `json:"kind"`
	Target      string `json:"target"`
	Expect      string `json:"expect"`
	Region      string `json:"region"`
	Interval    int    `json:"interval"`
	IntervalSec int    `json:"intervalSec"`
	TimeoutMs   int    `json:"timeoutMs"`
}

type OpsHealthGetRequest

type OpsHealthGetRequest struct {
}

type OpsHealthGetResponse

type OpsHealthGetResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsHealthRunRequest

type OpsHealthRunRequest struct {
	ID string `json:"id"`
}

type OpsHealthRunResponse

type OpsHealthRunResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsHealthUpdateRequest

type OpsHealthUpdateRequest struct {
	Enabled bool             `json:"enabled"`
	Checks  []OpsHealthCheck `json:"checks"`
}

type OpsHealthUpdateResponse

type OpsHealthUpdateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsMQRequest

type OpsMQRequest struct {
}

type OpsMQResponse

type OpsMQResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsMaintenanceGetRequest

type OpsMaintenanceGetRequest struct {
}

type OpsMaintenanceGetResponse

type OpsMaintenanceGetResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsMaintenanceUpdateRequest

type OpsMaintenanceUpdateRequest struct {
	Enabled bool                   `json:"enabled"`
	Message string                 `json:"message"`
	Windows []OpsMaintenanceWindow `json:"windows"`
}

type OpsMaintenanceUpdateResponse

type OpsMaintenanceUpdateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsMaintenanceWindow

type OpsMaintenanceWindow struct {
	ID          string `json:"id"`
	GameID      string `json:"gameId"`
	Env         string `json:"env"`
	Start       string `json:"start"`
	End         string `json:"end"`
	Message     string `json:"message"`
	BlockWrites bool   `json:"blockWrites"`
}

type OpsManagedProcess

type OpsManagedProcess struct {
	Name         string `json:"name"`
	Command      string `json:"command"`
	WorkingDir   string `json:"workingDir"`
	State        string `json:"state"`
	Pid          int32  `json:"pid"`
	RestartCount int32  `json:"restartCount"`
	LastStart    string `json:"lastStart,omitempty"`
}

type OpsMemoryMetrics

type OpsMemoryMetrics struct {
	TotalBytes     uint64  `json:"totalBytes"`
	UsedBytes      uint64  `json:"usedBytes"`
	AvailableBytes uint64  `json:"availableBytes"`
	UsagePercent   float64 `json:"usagePercent"`
	SwapTotal      uint64  `json:"swapTotal"`
	SwapUsed       uint64  `json:"swapUsed"`
}

type OpsMetricsData

type OpsMetricsData struct {
	AgentID   string              `json:"agentId"`
	Timestamp string              `json:"timestamp"`
	CPU       OpsCpuMetrics       `json:"cpu"`
	Memory    OpsMemoryMetrics    `json:"memory"`
	Disks     []OpsDiskMetrics    `json:"disks,omitempty"`
	Networks  []OpsNetworkMetrics `json:"networks,omitempty"`
}

type OpsMetricsQuery

type OpsMetricsQuery struct {
	Start string `form:"start"`
	End   string `form:"end"`
}

type OpsMetricsRequest

type OpsMetricsRequest struct {
	GameId      string `json:"gameId" binding:"required"`
	Env         string `json:"env"`
	Metric      string `json:"metric"`
	Start       string `json:"start"`
	End         string `json:"end"`
	Aggregation string `json:"aggregation"`
}

OpsMetricsRequest is used to query metrics

type OpsMetricsResponse

type OpsMetricsResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNetworkMetrics

type OpsNetworkMetrics struct {
	Interface   string `json:"interface"`
	BytesSent   uint64 `json:"bytesSent"`
	BytesRecv   uint64 `json:"bytesRecv"`
	PacketsSent uint64 `json:"packetsSent"`
	PacketsRecv uint64 `json:"packetsRecv"`
}

type OpsNodeActionRequest

type OpsNodeActionRequest struct {
	NodeID string `uri:"nodeId"`
}

type OpsNodeCommandsQuery

type OpsNodeCommandsQuery struct {
	NodeID string `form:"nodeId"`
}

type OpsNodeCommandsRequest

type OpsNodeCommandsRequest struct {
	NodeId string `json:"nodeId" binding:"required"`
}

OpsNodeCommandsRequest is used to get node commands

type OpsNodeCommandsResponse

type OpsNodeCommandsResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNodeDrainResponse

type OpsNodeDrainResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNodeMetaRequest

type OpsNodeMetaRequest struct {
	NodeID string `uri:"nodeId"`
}

type OpsNodeMetaResponse

type OpsNodeMetaResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNodeRestartResponse

type OpsNodeRestartResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNodeUndrainResponse

type OpsNodeUndrainResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNodesRequest

type OpsNodesRequest struct {
}

type OpsNodesResponse

type OpsNodesResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNotificationChannel

type OpsNotificationChannel struct {
	ID     string `json:"id"`
	Type   string `json:"type"`
	URL    string `json:"url"`
	Secret string `json:"secret"`
}

type OpsNotificationRule

type OpsNotificationRule struct {
	Event         string   `json:"event"`
	Channels      []string `json:"channels"`
	ThresholdDays int      `json:"thresholdDays"`
}

type OpsNotificationsGetRequest

type OpsNotificationsGetRequest struct {
}

type OpsNotificationsGetResponse

type OpsNotificationsGetResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsNotificationsUpdateRequest

type OpsNotificationsUpdateRequest struct {
	Enabled  bool                     `json:"enabled"`
	Channels []OpsNotificationChannel `json:"channels"`
	Rules    []OpsNotificationRule    `json:"rules"`
}

type OpsNotificationsUpdateResponse

type OpsNotificationsUpdateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsProcessActionRequest

type OpsProcessActionRequest struct {
	AgentID string `uri:"agentId"`
	Name    string `uri:"name"`
	Force   bool   `json:"force"`
}

type OpsProcessActionResponse

type OpsProcessActionResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    int32  `json:"pid,omitempty"`
}

type OpsProcessStartRequest

type OpsProcessStartRequest struct {
	AgentID string `uri:"agentId"`
	Name    string `uri:"name"`
}

type OpsProcessStartResponse

type OpsProcessStartResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    int32  `json:"pid,omitempty"`
}

type OpsServiceItem

type OpsServiceItem struct {
	ID             string              `json:"id"`
	Name           string              `json:"name"`
	Type           string              `json:"type"`
	Status         string              `json:"status"`
	Address        string              `json:"address"`
	GameID         string              `json:"gameId"`
	Env            string              `json:"env"`
	Version        string              `json:"version"`
	Region         string              `json:"region"`
	Zone           string              `json:"zone"`
	Labels         map[string]string   `json:"labels"`
	FunctionsCount int                 `json:"functionsCount"`
	LastSeen       string              `json:"lastSeen"`
	Metadata       *OpsServiceMetadata `json:"metadata"`
}

type OpsServiceMetadata

type OpsServiceMetadata struct {
	Processes      []OpsServiceProcess `json:"processes"`
	ProcessesCount int                 `json:"processesCount"`
}

type OpsServiceProcess

type OpsServiceProcess struct {
	ServiceID    string   `json:"service_id"`
	Addr         string   `json:"addr"`
	Version      string   `json:"version"`
	LastSeenUnix int64    `json:"last_seen_unix"`
	FunctionIDs  []string `json:"function_ids"`
	Functions    int      `json:"functions"`
}

type OpsServicesRequest

type OpsServicesRequest struct {
}

type OpsServicesResponse

type OpsServicesResponse struct {
	Services []OpsServiceItem `json:"services"`
	Total    int              `json:"total"`
}

type OpsSilenceDeleteResponse

type OpsSilenceDeleteResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type OpsSilencesRequest

type OpsSilencesRequest struct {
}

type OpsSilencesResponse

type OpsSilencesResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type ProcessActionRequest

type ProcessActionRequest = OpsProcessActionRequest

type ProcessActionResponse

type ProcessActionResponse = OpsProcessActionResponse

type ProcessStartRequest

type ProcessStartRequest = OpsProcessStartRequest

type ProcessStartResponse

type ProcessStartResponse = OpsProcessStartResponse

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) OpsAgentExecCommand

func (s *Service) OpsAgentExecCommand(ctx context.Context, req *OpsExecCommandRequest) (*OpsExecCommandResponse, error)

func (*Service) OpsAgentMeta

func (s *Service) OpsAgentMeta(ctx context.Context, req *OpsAgentMetaRequest) (*OpsAgentMetaResponse, error)

func (*Service) OpsAgentMetrics

func (s *Service) OpsAgentMetrics(ctx context.Context, req *OpsAgentMetricsRequest) (*OpsAgentMetricsResponse, error)

func (*Service) OpsAgentProcessRestart

func (s *Service) OpsAgentProcessRestart(ctx context.Context, req *OpsProcessActionRequest) (*OpsProcessActionResponse, error)

func (*Service) OpsAgentProcessStart

func (s *Service) OpsAgentProcessStart(ctx context.Context, req *OpsProcessStartRequest) (*OpsProcessStartResponse, error)

func (*Service) OpsAgentProcessStop

func (s *Service) OpsAgentProcessStop(ctx context.Context, req *OpsProcessActionRequest) (*OpsProcessActionResponse, error)

func (*Service) OpsAgentProcesses

func (s *Service) OpsAgentProcesses(ctx context.Context, req *OpsAgentProcessesRequest) (*OpsAgentProcessesResponse, error)

func (*Service) OpsAgentSystemInfo

func (*Service) OpsAgentsList

func (s *Service) OpsAgentsList(ctx context.Context, req *OpsAgentsListRequest) (*OpsAgentsListResponse, error)

func (*Service) OpsAlertSilence

func (s *Service) OpsAlertSilence(ctx context.Context, req *OpsAlertSilenceRequest) (*OpsAlertSilenceResponse, error)

func (*Service) OpsAlerts

func (s *Service) OpsAlerts(ctx context.Context, req *OpsAlertsRequest) (*OpsAlertsResponse, error)

func (*Service) OpsBackupCreate

func (s *Service) OpsBackupCreate(ctx context.Context, req *OpsBackupCreateRequest) (*OpsBackupCreateResponse, error)

func (*Service) OpsBackupDelete

func (s *Service) OpsBackupDelete(ctx context.Context, req *OpsBackupDeleteRequest) (*OpsBackupDeleteResponse, error)

func (*Service) OpsBackupDownload

func (s *Service) OpsBackupDownload(ctx context.Context, req *OpsBackupDownloadRequest) (*OpsBackupDownloadResponse, error)

func (*Service) OpsBackupsList

func (s *Service) OpsBackupsList(ctx context.Context, req *OpsBackupsListRequest) (*OpsBackupsListResponse, error)

func (*Service) OpsConfig

func (s *Service) OpsConfig(ctx context.Context, req *OpsConfigRequest) (*OpsConfigResponse, error)

func (*Service) OpsFunctions

func (s *Service) OpsFunctions(ctx context.Context, req *OpsFunctionsRequest) (*OpsFunctionsResponse, error)

func (*Service) OpsHealthGet

func (s *Service) OpsHealthGet(ctx context.Context, req *OpsHealthGetRequest) (*OpsHealthGetResponse, error)

func (*Service) OpsHealthRun

func (s *Service) OpsHealthRun(ctx context.Context, req *OpsHealthRunRequest) (*OpsHealthRunResponse, error)

func (*Service) OpsHealthUpdate

func (s *Service) OpsHealthUpdate(ctx context.Context, req *OpsHealthUpdateRequest) (*OpsHealthUpdateResponse, error)

func (*Service) OpsMQ

func (s *Service) OpsMQ(ctx context.Context, req *OpsMQRequest) (*OpsMQResponse, error)

func (*Service) OpsMaintenanceGet

func (s *Service) OpsMaintenanceGet(ctx context.Context, req *OpsMaintenanceGetRequest) (*OpsMaintenanceGetResponse, error)

func (*Service) OpsMaintenanceUpdate

func (*Service) OpsMetrics

func (s *Service) OpsMetrics(ctx context.Context, req *OpsMetricsRequest) (*OpsMetricsResponse, error)

func (*Service) OpsNodeCommands

func (s *Service) OpsNodeCommands(ctx context.Context, req *OpsNodeCommandsRequest) (*OpsNodeCommandsResponse, error)

func (*Service) OpsNodeDrain

func (*Service) OpsNodeMeta

func (s *Service) OpsNodeMeta(ctx context.Context, req *OpsNodeMetaRequest) (*OpsNodeMetaResponse, error)

func (*Service) OpsNodeRestart

func (s *Service) OpsNodeRestart(ctx context.Context, req *OpsNodeCommandsRequest) (*OpsNodeRestartResponse, error)

func (*Service) OpsNodeUndrain

func (s *Service) OpsNodeUndrain(ctx context.Context, req *OpsNodeCommandsRequest) (*OpsNodeUndrainResponse, error)

func (*Service) OpsNodes

func (s *Service) OpsNodes(ctx context.Context, req *OpsNodesRequest) (*OpsNodesResponse, error)

func (*Service) OpsNotificationsGet

func (*Service) OpsNotificationsUpdate

func (*Service) OpsServices

func (s *Service) OpsServices(ctx context.Context, req *OpsServicesRequest) (*OpsServicesResponse, error)

func (*Service) OpsSilenceDelete

func (s *Service) OpsSilenceDelete(ctx context.Context, req *OpsAlertSilenceRequest) (*OpsSilenceDeleteResponse, error)

func (*Service) OpsSilences

func (s *Service) OpsSilences(ctx context.Context, req *OpsSilencesRequest) (*OpsSilencesResponse, error)

type ServiceItem

type ServiceItem = OpsServiceItem

type ServiceMetadata

type ServiceMetadata = OpsServiceMetadata

type ServiceProcess

type ServiceProcess = OpsServiceProcess

type ServicesRequest

type ServicesRequest = OpsServicesRequest

type ServicesResponse

type ServicesResponse = OpsServicesResponse

type Silence

type Silence struct {
	Id        string      `json:"id"`
	AlertType string      `json:"alertType"`
	Matchers  interface{} `json:"matchers"`
	StartAt   string      `json:"startAt"`
	EndAt     string      `json:"endAt"`
	CreatedBy string      `json:"createdBy"`
}

Silence represents a silence rule

type SilenceDeleteRequest

type SilenceDeleteRequest struct {
	ID string `uri:"id"`
}

SilenceDeleteRequest represents the request to delete a silence

type SilenceDeleteResponse

type SilenceDeleteResponse = OpsSilenceDeleteResponse

type SilencesListRequest

type SilencesListRequest struct{}

SilencesListRequest represents the request to list silences

type SilencesListResponse

type SilencesListResponse struct {
	Items []Silence `json:"items"`
}

SilencesListResponse represents the response with a list of silences

type SilencesRequest

type SilencesRequest = OpsSilencesRequest

type SilencesResponse

type SilencesResponse = OpsSilencesResponse

Jump to

Keyboard shortcuts

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