computer

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultAgentWorkDir

func GetDefaultAgentWorkDir() string

GetDefaultAgentWorkDir returns the Jenkins agent work dir

func GetPayloadForCreateAgent

func GetPayloadForCreateAgent(name string) *strings.Reader

GetPayloadForCreateAgent returns a payload for creating an agent

func PrepareForComputerAgent

func PrepareForComputerAgent(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name, secret string)

PrepareForComputerAgent only for test

func PrepareForComputerAgentSecretRequest

func PrepareForComputerAgentSecretRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name, secret string)

PrepareForComputerAgentSecretRequest only for test

func PrepareForComputerCreateRequest

func PrepareForComputerCreateRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string)

PrepareForComputerCreateRequest only for test

func PrepareForComputerDeleteRequest

func PrepareForComputerDeleteRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string)

PrepareForComputerDeleteRequest only for test

func PrepareForComputerList

func PrepareForComputerList() string

PrepareForComputerList only for test

func PrepareForComputerListRequest

func PrepareForComputerListRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password string)

PrepareForComputerListRequest only for test

func PrepareForComputerLogRequest

func PrepareForComputerLogRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string)

PrepareForComputerLogRequest only for test

func PrepareForComputerLogRequestWithCode

func PrepareForComputerLogRequestWithCode(roundTripper *mhttp.MockRoundTripper, rootURL, user, password,
	name string, statusCode int)

PrepareForComputerLogRequestWithCode only for test

func PrepareForLaunchComputer

func PrepareForLaunchComputer(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string)

PrepareForLaunchComputer only for test

Types

type Client

type Client struct {
	core.JenkinsCore
}

Client is client for operate computers

func (*Client) Create

func (c *Client) Create(name string) (err error)

Create creates a computer by name

func (*Client) Delete

func (c *Client) Delete(name string) (err error)

Delete removes a agent from Jenkins

func (*Client) GetLog

func (c *Client) GetLog(name string) (log string, err error)

GetLog fetch the log a computer

func (*Client) GetSecret

func (c *Client) GetSecret(name string) (secret string, err error)

GetSecret returns the secret of an agent

func (*Client) Launch

func (c *Client) Launch(name string) (err error)

Launch starts up a agent

func (*Client) List

func (c *Client) List() (computers List, err error)

List get the computer list

type Computer

type Computer struct {
	AssignedLabels      []Label
	Description         string
	DisplayName         string
	Idle                bool
	JnlpAgent           bool
	LaunchSupported     bool
	ManualLaunchAllowed bool
	NumExecutors        int
	Offline             bool
	OfflineCause        OfflineCause
	OfflineCauseReason  string
	TemporarilyOffline  bool
}

Computer is the agent of Jenkins

type Label

type Label struct {
	Name string
}

Label represents the label of a computer

type List

type List struct {
	Computer       []Computer
	TotalExecutors int
	// contains filtered or unexported fields
}

List represents the list of computer from API

type OfflineCause

type OfflineCause struct {
	Timestamp   int64
	Description string
}

OfflineCause is the cause of computer offline

Jump to

Keyboard shortcuts

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