Versions in this module Expand all Collapse all v0 v0.1.5 Feb 7, 2025 v0.1.4 Oct 16, 2024 v0.1.3 Oct 16, 2024 v0.1.2 Oct 16, 2024 v0.1.1 Oct 16, 2024 Changes in this version + const ClassUsernameCredentials + const KeySourceDirectEntryType + const KeySourceOnMasterType + const RESULT_STATUS_FAILED + const RESULT_STATUS_FAILURE + const RESULT_STATUS_SKIPPED + const STATUS_ABORTED + const STATUS_ERROR + const STATUS_FAIL + const STATUS_FIXED + const STATUS_PASSED + const STATUS_REGRESSION + const STATUS_SUCCESS + const STR_RE_SPLIT_VIEW + var DASHBOARD_VIEW = "hudson.plugins.view.dashboard.Dashboard" + var Error *log.Logger + var Info *log.Logger + var LIST_VIEW = "hudson.model.ListView" + var MY_VIEW = "hudson.model.MyView" + var NESTED_VIEW = "hudson.plugins.nested_view.NestedView" + var PIPELINE_VIEW = "au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView" + var Warning *log.Logger + type APIRequest struct + Endpoint string + Headers http.Header + Method string + Payload io.Reader + Suffix string + func NewAPIRequest(method string, endpoint string, payload io.Reader) *APIRequest + func (ar *APIRequest) SetHeader(key string, value string) *APIRequest + type APIToken struct + Jenkins *Jenkins + Name string + UUID string + Value string + func (a *APIToken) Revoke() error + type APITokenGenerateResponse struct + Data APIToken + Status string + type Artifact struct + Build *Build + FileName string + Jenkins *Jenkins + Path string + func (a Artifact) GetData(ctx context.Context) ([]byte, error) + func (a Artifact) Save(ctx context.Context, path string) (bool, error) + func (a Artifact) SaveToDir(ctx context.Context, dir string) (bool, error) + type BasicAuth struct + Password string + Username string + type Build struct + Base string + Depth int + Jenkins *Jenkins + Job *Job + Raw *BuildResponse + func (b *Build) GetActions() []generalObj + func (b *Build) GetAllFingerPrints(ctx context.Context) []*FingerPrint + func (b *Build) GetArtifacts() []Artifact + func (b *Build) GetBuildNumber() int64 + func (b *Build) GetCauses(ctx context.Context) ([]map[string]interface{}, error) + func (b *Build) GetConsoleOutput(ctx context.Context) string + func (b *Build) GetConsoleOutputFromIndex(ctx context.Context, startID int64) (consoleResponse, error) + func (b *Build) GetCulprits() []Culprit + func (b *Build) GetDownstreamBuilds(ctx context.Context) ([]*Build, error) + func (b *Build) GetDownstreamJobNames(ctx context.Context) []string + func (b *Build) GetDuration() float64 + func (b *Build) GetInjectedEnvVars(ctx context.Context) (map[string]string, error) + func (b *Build) GetMatrixRuns(ctx context.Context) ([]*Build, error) + func (b *Build) GetParameters() []parameter + func (b *Build) GetResult() string + func (b *Build) GetResultSet(ctx context.Context) (*TestResult, error) + func (b *Build) GetRevision() string + func (b *Build) GetRevisionBranch() string + func (b *Build) GetTimestamp() time.Time + func (b *Build) GetUpstreamBuild(ctx context.Context) (*Build, error) + func (b *Build) GetUpstreamBuildNumber(ctx context.Context) (int64, error) + func (b *Build) GetUpstreamJob(ctx context.Context) (*Job, error) + func (b *Build) GetUrl() string + func (b *Build) Info() *BuildResponse + func (b *Build) IsGood(ctx context.Context) bool + func (b *Build) IsRunning(ctx context.Context) bool + func (b *Build) Poll(ctx context.Context, options ...interface{}) (int, error) + func (b *Build) SetDescription(ctx context.Context, description string) error + func (b *Build) Stop(ctx context.Context) (bool, error) + type BuildResponse struct + Actions []generalObj + Artifacts []struct{ ... } + Building bool + BuiltOn string + ChangeSet struct{ ... } + ChangeSets []struct{ ... } + Culprits []Culprit + Description interface{} + DisplayName string + Duration float64 + EstimatedDuration float64 + Executor interface{} + FingerPrint []FingerPrintResponse + FullDisplayName string + ID string + KeepLog bool + MavenArtifacts interface{} + MavenVersionUsed string + Number int64 + QueueID int64 + Result string + Runs []struct{ ... } + Timestamp int64 + URL string + type BuildRevision struct + Branch []branch + SHA1 string + type Builds struct + BuildNumber int64 + BuildResult interface{} + Marked BuildRevision + Revision BuildRevision + type Computers struct + BusyExecutors int + Computers []*NodeResponse + DisplayName string + TotalExecutors int + type CredentialsManager struct + Folder string + J *Jenkins + func (cm CredentialsManager) Add(ctx context.Context, domain string, creds interface{}) error + func (cm CredentialsManager) Delete(ctx context.Context, domain string, id string) error + func (cm CredentialsManager) GetSingle(ctx context.Context, domain string, id string, creds interface{}) error + func (cm CredentialsManager) List(ctx context.Context, domain string) ([]string, error) + func (cm CredentialsManager) Update(ctx context.Context, domain string, id string, creds interface{}) error + type Culprit struct + AbsoluteUrl string + FullName string + type DockerServerCredentials struct + ClientCertificate string + ClientKey string + Description string + ID string + Scope string + ServerCaCertificate string + Username string + XMLName xml.Name + type ErrAPIToken struct + Message string + func (e *ErrAPIToken) Error() string + type ErrUser struct + Message string + func (e *ErrUser) Error() string + type Executor struct + Jenkins *Jenkins + Raw *ExecutorResponse + type ExecutorResponse struct + AssignedLabels []map[string]string + Description interface{} + Jobs []InnerJob + Mode string + NodeDescription string + NodeName string + NumExecutors int64 + OverallLoad struct{} + PrimaryView struct{ ... } + QuietingDown bool + SlaveAgentPort int64 + UnlabeledLoad struct{} + UseCrumbs bool + UseSecurity bool + Views []ViewData + type FileCredentials struct + Description string + Filename string + ID string + Scope string + SecretBytes string + XMLName xml.Name + type FingerPrint struct + Base string + Id string + Jenkins *Jenkins + Raw *FingerPrintResponse + func (f FingerPrint) GetInfo(ctx context.Context) (*FingerPrintResponse, error) + func (f FingerPrint) Poll(ctx context.Context) (int, error) + func (f FingerPrint) Valid(ctx context.Context) (bool, error) + func (f FingerPrint) ValidateForBuild(ctx context.Context, filename string, build *Build) (bool, error) + type FingerPrintResponse struct + FileName string + Hash string + Original struct{ ... } + Timestamp int64 + Usage []struct{ ... } + type Folder struct + Base string + Jenkins *Jenkins + Raw *FolderResponse + func (f *Folder) Create(ctx context.Context, name string) (*Folder, error) + func (f *Folder) GetName() string + func (f *Folder) Poll(ctx context.Context) (int, error) + type FolderResponse struct + Actions []generalObj + Description string + DisplayName string + Jobs []InnerJob + Name string + PrimaryView *ViewData + URL string + Views []ViewData + type History struct + BuildDisplayName string + BuildNumber int + BuildStatus string + BuildTimestamp int64 + type InnerJob struct + Class string + Color string + Name string + Url string + type Jenkins struct + Raw *ExecutorResponse + Requester *Requester + Server string + Version string + func CreateJenkins(client *http.Client, base string, auth ...interface{}) *Jenkins + func (j *Jenkins) BuildJob(ctx context.Context, name string, params map[string]string) (int64, error) + func (j *Jenkins) CopyJob(ctx context.Context, copyFrom string, newName string) (*Job, error) + func (j *Jenkins) CreateFolder(ctx context.Context, name string, parents ...string) (*Folder, error) + func (j *Jenkins) CreateJob(ctx context.Context, config string, options ...interface{}) (*Job, error) + func (j *Jenkins) CreateJobInFolder(ctx context.Context, config string, jobName string, parentIDs ...string) (*Job, error) + func (j *Jenkins) CreateNode(ctx context.Context, name string, numExecutors int, description string, ...) (*Node, error) + func (j *Jenkins) CreateUser(ctx context.Context, userName, password, fullName, email string) (User, error) + func (j *Jenkins) CreateView(ctx context.Context, name string, viewType string) (*View, error) + func (j *Jenkins) DeleteJob(ctx context.Context, name string) (bool, error) + func (j *Jenkins) DeleteNode(ctx context.Context, name string) (bool, error) + func (j *Jenkins) DeleteUser(ctx context.Context, userName string) error + func (j *Jenkins) GenerateAPIToken(ctx context.Context, tokenName string) (APIToken, error) + func (j *Jenkins) GetAllBuildIds(ctx context.Context, job string) ([]JobBuild, error) + func (j *Jenkins) GetAllJobNames(ctx context.Context) ([]InnerJob, error) + func (j *Jenkins) GetAllJobs(ctx context.Context) ([]*Job, error) + func (j *Jenkins) GetAllNodes(ctx context.Context) ([]*Node, error) + func (j *Jenkins) GetAllViews(ctx context.Context) ([]*View, error) + func (j *Jenkins) GetArtifactData(ctx context.Context, id string) (*FingerPrintResponse, error) + func (j *Jenkins) GetBuild(ctx context.Context, jobName string, number int64) (*Build, error) + func (j *Jenkins) GetBuildFromQueueID(ctx context.Context, job *Job, queueid int64) (*Build, error) + func (j *Jenkins) GetFolder(ctx context.Context, id string, parents ...string) (*Folder, error) + func (j *Jenkins) GetJob(ctx context.Context, id string, parentIDs ...string) (*Job, error) + func (j *Jenkins) GetJobObj(ctx context.Context, name string) *Job + func (j *Jenkins) GetLabel(ctx context.Context, name string) (*Label, error) + func (j *Jenkins) GetNode(ctx context.Context, name string) (*Node, error) + func (j *Jenkins) GetPlugins(ctx context.Context, depth int) (*Plugins, error) + func (j *Jenkins) GetQueue(ctx context.Context) (*Queue, error) + func (j *Jenkins) GetQueueItem(ctx context.Context, id int64) (*Task, error) + func (j *Jenkins) GetQueueUrl() string + func (j *Jenkins) GetSubJob(ctx context.Context, parentId string, childId string) (*Job, error) + func (j *Jenkins) GetView(ctx context.Context, name string) (*View, error) + func (j *Jenkins) HasPlugin(ctx context.Context, name string) (*Plugin, error) + func (j *Jenkins) Info(ctx context.Context) (*ExecutorResponse, error) + func (j *Jenkins) Init(ctx context.Context) (*Jenkins, error) + func (j *Jenkins) InstallPlugin(ctx context.Context, name string, version string) error + func (j *Jenkins) Poll(ctx context.Context) (int, error) + func (j *Jenkins) RenameJob(ctx context.Context, job string, name string) *Job + func (j *Jenkins) RevokeAPIToken(ctx context.Context, tokenUuid string) error + func (j *Jenkins) RevokeAllAPITokens(ctx context.Context) error + func (j *Jenkins) SafeRestart(ctx context.Context) error + func (j *Jenkins) UninstallPlugin(ctx context.Context, name string) error + func (j *Jenkins) UpdateJob(ctx context.Context, job string, config string) *Job + func (j *Jenkins) ValidateFingerPrint(ctx context.Context, id string) (bool, error) + type Job struct + Base string + Jenkins *Jenkins + Raw *JobResponse + func (j *Job) Copy(ctx context.Context, destinationName string) (*Job, error) + func (j *Job) Create(ctx context.Context, config string, qr ...interface{}) (*Job, error) + func (j *Job) Delete(ctx context.Context) (bool, error) + func (j *Job) Disable(ctx context.Context) (bool, error) + func (j *Job) Enable(ctx context.Context) (bool, error) + func (j *Job) GetAllBuildIds(ctx context.Context) ([]JobBuild, error) + func (j *Job) GetBuild(ctx context.Context, id int64) (*Build, error) + func (j *Job) GetBuildsFields(ctx context.Context, fields []string, custom interface{}) error + func (j *Job) GetConfig(ctx context.Context) (string, error) + func (j *Job) GetDescription() string + func (j *Job) GetDetails() *JobResponse + func (j *Job) GetDownstreamJobs(ctx context.Context) ([]*Job, error) + func (j *Job) GetDownstreamJobsMetadata() []InnerJob + func (j *Job) GetFirstBuild(ctx context.Context) (*Build, error) + func (j *Job) GetInnerJob(ctx context.Context, id string) (*Job, error) + func (j *Job) GetInnerJobs(ctx context.Context) ([]*Job, error) + func (j *Job) GetInnerJobsMetadata() []InnerJob + func (j *Job) GetLastBuild(ctx context.Context) (*Build, error) + func (j *Job) GetLastCompletedBuild(ctx context.Context) (*Build, error) + func (j *Job) GetLastFailedBuild(ctx context.Context) (*Build, error) + func (j *Job) GetLastStableBuild(ctx context.Context) (*Build, error) + func (j *Job) GetLastSuccessfulBuild(ctx context.Context) (*Build, error) + func (j *Job) GetName() string + func (j *Job) GetParameters(ctx context.Context) ([]ParameterDefinition, error) + func (j *Job) GetUpstreamJobs(ctx context.Context) ([]*Job, error) + func (j *Job) GetUpstreamJobsMetadata() []InnerJob + func (j *Job) HasQueuedBuild() + func (j *Job) History(ctx context.Context) ([]*History, error) + func (j *Job) Invoke(ctx context.Context, files []string, skipIfRunning bool, ...) (bool, error) + func (j *Job) InvokeSimple(ctx context.Context, params map[string]string) (int64, error) + func (j *Job) IsEnabled(ctx context.Context) (bool, error) + func (j *Job) IsQueued(ctx context.Context) (bool, error) + func (j *Job) IsRunning(ctx context.Context) (bool, error) + func (j *Job) Poll(ctx context.Context) (int, error) + func (j *Job) Rename(ctx context.Context, name string) (bool, error) + func (j *Job) UpdateConfig(ctx context.Context, config string) error + func (job *Job) GetPipelineRun(ctx context.Context, id string) (pr *PipelineRun, err error) + func (job *Job) GetPipelineRunWithFullStages(ctx context.Context, id string) (pr *PipelineRun, err error) + func (job *Job) GetPipelineRuns(ctx context.Context) (pr []PipelineRun, err error) + func (job *Job) GetPipelineRunsWithFullStages(ctx context.Context) (pr []PipelineRun, err error) + type JobBuild struct + Number int64 + URL string + type JobResponse struct + Actions []generalObj + Buildable bool + Builds []JobBuild + Class string + Color string + ConcurrentBuild bool + Description string + DisplayName string + DisplayNameOrNull interface{} + DownstreamProjects []InnerJob + FirstBuild JobBuild + FullDisplayName string + FullName string + HealthReport []struct{ ... } + InQueue bool + Jobs []InnerJob + KeepDependencies bool + LastBuild JobBuild + LastCompletedBuild JobBuild + LastFailedBuild JobBuild + LastStableBuild JobBuild + LastSuccessfulBuild JobBuild + LastUnstableBuild JobBuild + LastUnsuccessfulBuild JobBuild + Name string + NextBuildNumber int64 + PrimaryView *ViewData + Property []struct{ ... } + QueueItem interface{} + Scm struct{} + URL string + UpstreamProjects []InnerJob + Views []ViewData + type Label struct + Base string + Jenkins *Jenkins + Raw *LabelResponse + func (l *Label) GetName() string + func (l *Label) GetNodes() []LabelNode + func (l *Label) Poll(ctx context.Context) (int, error) + type LabelNode struct + Class string + Mode string + NodeDescription string + NodeName string + NumExecutors int64 + type LabelResponse struct + BusyExecutors int64 + Description string + IdleExecutors int64 + Name string + Nodes []LabelNode + Offline bool + TotalExecutors int64 + type MODE string + const EXCLUSIVE + const NORMAL + type Node struct + Base string + Jenkins *Jenkins + Raw *NodeResponse + func (n *Node) Delete(ctx context.Context) (bool, error) + func (n *Node) Disconnect(ctx context.Context) (int, error) + func (n *Node) GetLogText(ctx context.Context) (string, error) + func (n *Node) GetName() string + func (n *Node) Info(ctx context.Context) (*NodeResponse, error) + func (n *Node) IsIdle(ctx context.Context) (bool, error) + func (n *Node) IsJnlpAgent(ctx context.Context) (bool, error) + func (n *Node) IsOnline(ctx context.Context) (bool, error) + func (n *Node) IsTemporarilyOffline(ctx context.Context) (bool, error) + func (n *Node) LaunchNodeBySSH(ctx context.Context) (int, error) + func (n *Node) Poll(ctx context.Context) (int, error) + func (n *Node) SetOffline(ctx context.Context, options ...interface{}) (bool, error) + func (n *Node) SetOnline(ctx context.Context) (bool, error) + func (n *Node) ToggleTemporarilyOffline(ctx context.Context, options ...interface{}) (bool, error) + type NodeResponse struct + Actions []interface{} + Class string + DisplayName string + Executors []struct{ ... } + Icon string + IconClassName string + Idle bool + JnlpAgent bool + LaunchSupported bool + LoadStatistics struct{} + ManualLaunchAllowed bool + MonitorData struct{ ... } + NumExecutors int64 + Offline bool + OfflineCause struct{} + OfflineCauseReason string + OneOffExecutors []interface{} + TemporarilyOffline bool + type ParameterDefinition struct + DefaultParameterValue struct{ ... } + Description string + Name string + Type string + type PipelineArtifact struct + ID string + Name string + Path string + URL string + type PipelineInputAction struct + AbortURL string + ID string + Message string + ProceedURL string + type PipelineNode struct + Base string + Duration int64 + ExecNode string + ID string + Name string + ParameterDescription string + ParentNodes []int64 + PauseDurationMillis int64 + Run *PipelineRun + StageFlowNodes []PipelineNode + StartTime int64 + Status string + URLs map[string]map[string]string + func (node *PipelineNode) GetLog(ctx context.Context) (log *PipelineNodeLog, err error) + type PipelineNodeLog struct + ConsoleURL string + HasMore bool + Length int64 + NodeID string + NodeStatus string + Text string + type PipelineRun struct + Base string + Duration int64 + EndTime int64 + ID string + Job *Job + Name string + PauseDurationMillis int64 + QueueDurationMillis int64 + Stages []PipelineNode + StartTime int64 + Status string + URLs map[string]map[string]string + func (pr *PipelineRun) AbortInput(ctx context.Context) (bool, error) + func (pr *PipelineRun) GetArtifacts(ctx context.Context) (artifacts []PipelineArtifact, err error) + func (pr *PipelineRun) GetNode(ctx context.Context, id string) (node *PipelineNode, err error) + func (pr *PipelineRun) GetPendingInputActions(ctx context.Context) (PIAs []PipelineInputAction, err error) + func (pr *PipelineRun) ProceedInput(ctx context.Context) (bool, error) + type Plugin struct + Active bool + BackupVersion interface{} + Bundled bool + Deleted bool + Dependencies []struct{ ... } + Downgradable bool + Enabled bool + HasUpdate bool + LongName string + Pinned bool + ShortName string + SupportsDynamicLoad string + URL string + Version string + type PluginResponse struct + Plugins []Plugin + type Plugins struct + Base string + Depth int + Jenkins *Jenkins + Raw *PluginResponse + func (p *Plugins) Contains(name string) *Plugin + func (p *Plugins) Count() int + func (p *Plugins) Poll(ctx context.Context) (int, error) + type PrivateKey struct + Class string + Value string + type PrivateKeyFile struct + Class string + Value string + type Queue struct + Base string + Jenkins *Jenkins + Raw *queueResponse + func (q *Queue) CancelTask(ctx context.Context, id int64) (bool, error) + func (q *Queue) GetTaskById(id int64) *Task + func (q *Queue) GetTasksForJob(name string) []*Task + func (q *Queue) Poll(ctx context.Context) (int, error) + func (q *Queue) Tasks() []*Task + type Requester struct + Base string + BasicAuth *BasicAuth + CACert []byte + Client *http.Client + SslVerify bool + func (r *Requester) Do(ctx context.Context, ar *APIRequest, responseStruct interface{}, ...) (*http.Response, error) + func (r *Requester) Get(ctx context.Context, endpoint string, responseStruct interface{}, ...) (*http.Response, error) + func (r *Requester) GetJSON(ctx context.Context, endpoint string, responseStruct interface{}, ...) (*http.Response, error) + func (r *Requester) GetXML(ctx context.Context, endpoint string, responseStruct interface{}, ...) (*http.Response, error) + func (r *Requester) Post(ctx context.Context, endpoint string, payload io.Reader, ...) (*http.Response, error) + func (r *Requester) PostFiles(ctx context.Context, endpoint string, payload io.Reader, ...) (*http.Response, error) + func (r *Requester) PostJSON(ctx context.Context, endpoint string, payload io.Reader, ...) (*http.Response, error) + func (r *Requester) PostXML(ctx context.Context, endpoint string, xml string, responseStruct interface{}, ...) (*http.Response, error) + func (r *Requester) ReadJSONResponse(response *http.Response, responseStruct interface{}) (*http.Response, error) + func (r *Requester) ReadRawResponse(response *http.Response, responseStruct interface{}) (*http.Response, error) + func (r *Requester) SetClient(client *http.Client) *Requester + func (r *Requester) SetCrumb(ctx context.Context, ar *APIRequest) error + type SSHCredentials struct + Description string + ID string + Passphrase string + PrivateKeySource interface{} + Scope string + Username string + XMLName xml.Name + type StringCredentials struct + Description string + ID string + Scope string + Secret string + XMLName xml.Name + type Task struct + Base string + Jenkins *Jenkins + Queue *Queue + Raw *taskResponse + func (t *Task) Cancel(ctx context.Context) (bool, error) + func (t *Task) GetCauses() []map[string]interface{} + func (t *Task) GetJob(ctx context.Context) (*Job, error) + func (t *Task) GetParameters() []parameter + func (t *Task) GetWhy() string + func (t *Task) Poll(ctx context.Context) (int, error) + type TestResult struct + Duration float64 + Empty bool + FailCount int64 + PassCount int64 + SkipCount int64 + Suites []struct{ ... } + type User struct + Email string + FullName string + Jenkins *Jenkins + UserName string + func (u *User) Delete() error + type UsernameCredentials struct + Description string + ID string + Password string + Scope string + Username string + XMLName xml.Name + type View struct + Base string + Jenkins *Jenkins + Raw *ViewResponse + func (v *View) AddJob(ctx context.Context, name string) (bool, error) + func (v *View) DeleteJob(ctx context.Context, name string) (bool, error) + func (v *View) GetDescription() string + func (v *View) GetJobs() []InnerJob + func (v *View) GetName() string + func (v *View) GetUrl() string + func (v *View) Poll(ctx context.Context) (int, error) + type ViewData struct + Name string + URL string + type ViewResponse struct + Description string + Jobs []InnerJob + Name string + Property []interface{} + URL string