Documentation ¶
Index ¶
- Constants
- type Applications
- type Client
- func (c *Client) AcceptKey(ctx context.Context, mid string) ([]string, error)
- func (c *Client) DeleteKey(ctx context.Context, match string) ([]string, error)
- func (c *Client) GetKeyFinger(ctx context.Context, match string) (map[string]string, error)
- func (c *Client) GetKeyString(ctx context.Context, match string) (map[string]string, error)
- func (c *Client) GetMinion(ctx context.Context, mid string) (*Minion, error)
- func (c *Client) Hook(ctx context.Context, id string, payload interface{}) error
- func (c *Client) ListJobs(ctx context.Context) ([]Job, error)
- func (c *Client) ListKeys(ctx context.Context) (*ListKeysReturn, error)
- func (c *Client) ListMinions(ctx context.Context) ([]Minion, error)
- func (c *Client) LocalClient(ctx context.Context, fun string, arg []string, opts ...RunOption) (map[string]LocalClientReturn, error)
- func (c *Client) LocalClientAsync(ctx context.Context, tgt, fun string, arg []string, opts ...RunOption) (string, error)
- func (c *Client) Login(ctx context.Context) error
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) LookupJID(ctx context.Context, jid string) (*Job, error)
- func (c *Client) ManageStatus(ctx context.Context) (*ManageStatusReturn, error)
- func (c *Client) RejectedKey(ctx context.Context, mid string) ([]string, error)
- func (c *Client) RunnerClient(ctx context.Context, fun string, arg []string, opts ...RunOption) (map[string]LocalClientReturn, error)
- func (c *Client) RunnerClientAsync(ctx context.Context, tgt, fun string, arg []string, opts ...RunOption) (string, error)
- func (c *Client) Stats(ctx context.Context) (*Stats, error)
- type ClientOption
- type CommandClient
- type HTTPServer
- type Job
- type ListKeysReturn
- type LocalClientReturn
- type ManageStatusReturn
- type Minion
- type Request
- type RunOption
- func WithGlobTarget(t string) RunOption
- func WithGrainPcreTarget(t string) RunOption
- func WithGrainTarget(t string) RunOption
- func WithIPCIDRTarget(t net.IPNet) RunOption
- func WithKeywordArguments(kw map[string]interface{}) RunOption
- func WithListTarget(t []string) RunOption
- func WithNodeGroupTarget(t string) RunOption
- func WithPcreTarget(t string) RunOption
- func WithPillarPcreTarget(t string) RunOption
- func WithPillarTarget(t string) RunOption
- type Stats
- type TMPStats
- type TargetType
- type WorkerThread
Constants ¶
View Source
const ( CP_APPLICATIONS = "CherryPy Applications" CP_HTTPSERVER_PREFIX = "Cheroot HTTPServer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Applications ¶
type Applications struct { Enabled bool `json:"Enabled"` BytesReadRequest float64 `json:"Bytes Read/Request"` BytesReadSecond float64 `json:"Bytes Read/Second"` BytesWrittenRequest float64 `json:"Bytes Written/Request"` BytesWrittenSecond float64 `json:"Bytes Written/Second"` CurrentTime float64 `json:"Current Time"` CurrentRequests int `json:"Current Requests"` RequestsSecond float64 `json:"Requests/Second"` ServerVersion string `json:"Server Version"` StartTime float64 `json:"Start Time"` TotalBytesRead int `json:"Total Bytes Read"` TotalBytesWritten int `json:"Total Bytes Written"` TotalRequests int `json:"Total Requests"` TotalTime float64 `json:"Total Time"` Uptime float64 `json:"Uptime"` Requests map[string]Request `json:"Requests"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
func (*Client) GetKeyFinger ¶
func (*Client) GetKeyString ¶
func (*Client) ListJobs ¶
ListJobs 获取任务列表 https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#jobs
func (*Client) LocalClient ¶
func (*Client) LocalClientAsync ¶
func (*Client) Login ¶
Login 认证 https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#login
func (*Client) Logout ¶
Logout 登出 https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#logout
func (*Client) LookupJID ¶
LookupJID 获取任务详情 https://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#get--jobs-(jid)
func (*Client) ManageStatus ¶
func (c *Client) ManageStatus(ctx context.Context) (*ManageStatusReturn, error)
func (*Client) RejectedKey ¶
func (*Client) RunnerClient ¶
func (*Client) RunnerClientAsync ¶
type ClientOption ¶
type ClientOption func(options *Client)
func WithAuthBackend ¶
func WithAuthBackend(eauth string) ClientOption
func WithEndpoint ¶
func WithEndpoint(s string) ClientOption
func WithInsecure ¶
func WithInsecure() ClientOption
func WithPassword ¶
func WithPassword(password string) ClientOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
func WithUsername ¶
func WithUsername(username string) ClientOption
type CommandClient ¶
type CommandClient string
const ( LocalClient CommandClient = "local" LocalAsyncClient CommandClient = "local_async" RunnerClient CommandClient = "runner" RunnerAsyncClient CommandClient = "runner_async" WheelClient CommandClient = "wheel" WheelAsyncClient CommandClient = "wheel_async" SSHClient CommandClient = "ssh" )
type HTTPServer ¶
type HTTPServer struct { Enabled bool `json:"Enabled"` BindAddress string `json:"Bind Address"` RunTime int `json:"Run time"` Accepts int `json:"Accepts"` AcceptsSec float64 `json:"Accepts/sec"` Queue int `json:"Queue"` Threads int `json:"Threads"` ThreadsIdle int `json:"Threads Idle"` SocketErrors int `json:"Socket Errors"` Requests int `json:"Requests"` BytesRead int `json:"Bytes Read"` BytesWritten int `json:"Bytes Written"` WorkTime int `json:"Work Time"` ReadThroughput float64 `json:"Read Throughput"` WriteThroughput float64 `json:"Write Throughput"` WorkerThreads map[string]WorkerThread `json:"Worker Threads"` }
type Job ¶
type Job struct { JID string `json:"jid,omitempty"` Function string `json:"Function,omitempty"` Arguments []interface{} `json:"Arguments,omitempty"` // KWArguments map[string]interface{} `json:"KWArguments,omitempty"` Target interface{} `json:"Target,omitempty"` TargetType TargetType `json:"Target-Type,omitempty"` StartTime saltTime `json:"StartTime"` User string `json:"User"` Minions []string `json:"Minions,omitempty"` Result map[string]jobResult `json:"Result,omitempty"` Error string `json:"Error,omitempty"` }
type ListKeysReturn ¶
type LocalClientReturn ¶
type ManageStatusReturn ¶
type Minion ¶
type Minion struct { ID string `json:"id"` CWD string `json:"cwd"` NodeName string `json:"nodename"` MachineID string `json:"machine_id"` Master string `json:"master"` ServerID int64 `json:"server_id"` Localhost string `json:"localhost"` Host string `json:"host"` Domain string `json:"domain"` IPGW interface{} `json:"ip_gw"` IP4GW interface{} `json:"ip4_gw"` IP6GW interface{} `json:"ip6_gw"` DNS struct { Nameservers []string `json:"nameservers"` IP4Namespaces []string `json:"ip4_namespaces"` IP6Namespaces []string `json:"ip6_namespaces"` SortList []string `json:"sortlist"` Domain string `json:"domain"` Search []string `json:"search"` Options []string `json:"options"` } `json:"dns"` FQDN string `json:"fqdn"` FQDNs []string `json:"fqdns"` HWAddrInterface map[string]string `json:"hwaddr_interface"` IP4Interfaces map[string][]string `json:"ip4_interfaces"` IP6Interfaces map[string][]string `json:"ip6_interfaces"` IPInterfaces map[string][]string `json:"ip_interfaces"` IPv4 []string `json:"ipv4"` IPv6 []string `json:"ipv6"` FQDNIP4 []string `json:"fqdn_ip4"` FQDNIP6 []string `json:"fqdn_ip6"` Kernel string `json:"kernel"` KernelRelease string `json:"kernelrelease"` KernelVersion string `json:"kernelversion"` KernelParams [][]string `json:"kernelparams"` LocaleInfo struct { DefaultLanguage string `json:"defaultlanguage"` DefaultEncoding string `json:"defaultencoding"` DetectedEncoding string `json:"detectedencoding"` TimeZone string `json:"timezone"` } `json:"locale_info"` NumGPUS int `json:"num_gpus"` GPUS []struct { Vendor string `json:"vendor"` Model string `json:"model"` } `json:"gpus"` NumCPUS int `json:"num_cpus"` CPUArch string `json:"cpuarch"` CPUModel string `json:"cpu_model"` CPUFlags []string `json:"cpu_flags"` Selinux struct { Enabled bool `json:"enabled"` Enforced string `json:"enforced"` } `json:"selinux"` Systemd struct { Version string `json:"version"` Features string `json:"features"` } `json:"systemd"` Init string `json:"init"` LSBDistribID string `json:"lsb_distrib_id"` LSBDistribCodename string `json:"lsb_distrib_codename"` OS string `json:"os"` OSFullName string `json:"osfullname"` OSRelease string `json:"osrelease"` OSReleaseInfo []int `json:"osrelease_info"` OSCodename string `json:"oscodename"` OSMajorRelease int `json:"osmajorrelease"` OSFinger string `json:"osfinger"` OSFamily string `json:"os_family"` OSArch string `json:"osarch"` MemTotal int `json:"mem_total"` SwapTotal int `json:"swap_total"` BiosVersion string `json:"biosversion"` BiosReleaseDate string `json:"biosreleasedate"` ProductName string `json:"productname"` Manufacturer string `json:"manufacturer"` UUID string `json:"uuid"` SerialNumber string `json:"serialnumber"` Virtual string `json:"virtual"` PS string `json:"ps"` Path string `json:"path"` SystemPath []string `json:"systempath"` PythonExecutable string `json:"pythonexecutable"` PythonPath []string `json:"pythonpath"` PythonVersion []interface{} `json:"pythonversion"` SaltPath string `json:"saltpath"` SaltVersion string `json:"saltversion"` SaltVersionInfo []int `json:"saltversioninfo"` ZMQVersion string `json:"zmqversion"` Disks []string `json:"disks"` SSDs []string `json:"ssds"` Shell string `json:"shell"` Lvm map[string][]string `json:"lvm"` MDAdm []string `json:"mdadm"` Username string `json:"username"` GroupName string `json:"groupname"` Pid int64 `json:"pid"` Gid int `json:"gid"` Uid int `json:"uid"` ZFSSupport bool `json:"zfs_support"` ZFSFeatureFlags bool `json:"zfs_feature_flags"` Transactional bool `json:"transactional,omitempty"` Roles []string `json:"roles,omitempty"` }
type Request ¶
type Request struct { BytesRead int `json:"Bytes Read"` BytesWritten int `json:"Bytes Written"` ResponseStatus string `json:"Response Status"` StartTime float64 `json:"Start Time"` EndTime float64 `json:"End Time"` Client string `json:"Client"` ProcessingTime float64 `json:"Processing Time"` RequestLine string `json:"Request-Line"` }
type RunOption ¶
type RunOption func(*commandRequest)
func WithGlobTarget ¶
func WithGrainPcreTarget ¶
func WithGrainTarget ¶
func WithIPCIDRTarget ¶
func WithKeywordArguments ¶
func WithListTarget ¶
func WithNodeGroupTarget ¶
func WithPcreTarget ¶
func WithPillarPcreTarget ¶
func WithPillarTarget ¶
type Stats ¶
type Stats struct { Applications Applications `json:"CherryPy Applications"` HTTPServer HTTPServer `json:"Cheroot HTTPServer"` }
type TargetType ¶
type TargetType string
const ( Glob TargetType = "glob" Pcre TargetType = "pcre" List TargetType = "list" Grain TargetType = "grain" GrainPcre TargetType = "grain_pcre" Pillar TargetType = "pillar" PillarPcre TargetType = "pillar_pcre" NodeGroup TargetType = "nodegroup" Range TargetType = "range" Compound TargetType = "compound" IPCIDR TargetType = "ipcidr" )
Click to show internal directories.
Click to hide internal directories.