event

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(ac *client.AlpaconClient, serverName, command string, username, groupname string, env map[string]string) (string, error)

Types

type CommandRequest

type CommandRequest struct {
	Shell       string            `json:"shell"`
	Line        string            `json:"line"`
	Env         map[string]string `json:"env"`
	Data        string            `json:"data"`
	Username    string            `json:"username"`
	Groupname   string            `json:"groupname"`
	ScheduledAt *time.Time        `json:"scheduled_at"`
	Server      string            `json:"server"`
	RunAfter    []string          `json:"run_after"`
}

type CommandResponse

type CommandResponse struct {
	Id          string        `json:"id"`
	Shell       string        `json:"shell"`
	Line        string        `json:"line"`
	Data        string        `json:"data"`
	Username    string        `json:"username"`
	Groupname   string        `json:"groupname"`
	AddedAt     time.Time     `json:"added_at"`
	ScheduledAt time.Time     `json:"scheduled_at"`
	Server      string        `json:"server"`
	RequestedBy string        `json:"requested_by"`
	RunAfter    []interface{} `json:"run_after"`
}

type EventAttributes

type EventAttributes struct {
	Server      string `json:"server"`
	Shell       string `json:"shell"`
	Command     string `json:"command"`
	Result      string `json:"result"`
	Status      string `json:"status"`
	Operator    string `json:"operator"`
	RequestedAt string `json:"requested_at"`
}

func GetEventList

func GetEventList(ac *client.AlpaconClient, pageSize int, serverName string, userName string) ([]EventAttributes, error)

type EventDetails

type EventDetails struct {
	ID              string                 `json:"id"`
	Shell           string                 `json:"shell"`
	Line            string                 `json:"line"`
	Success         *bool                  `json:"success"`
	Result          string                 `json:"result"`
	Status          map[string]interface{} `json:"status"`
	ResponseDelay   float64                `json:"response_delay"`
	ElapsedTime     float64                `json:"elapsed_time"`
	AddedAt         time.Time              `json:"added_at"`
	Server          string                 `json:"server"`
	ServerName      string                 `json:"server_name"`
	RequestedBy     string                 `json:"requested_by"`
	RequestedByName string                 `json:"requested_by_name"`
}

func PollCommandExecution

func PollCommandExecution(ac *client.AlpaconClient, cmdId string) (EventDetails, error)

Jump to

Keyboard shortcuts

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