Documentation ¶
Overview ¶
Gojenkins is a Jenkins Client in Go, that exposes the jenkins REST api in a more developer friendly way.
Index ¶
- Constants
- Variables
- type Artifact
- type BasicAuth
- type Build
- func (b *Build) GetActions() []generalObj
- func (b *Build) GetAllFingerprints() []*Fingerprint
- func (b *Build) GetArtifacts() []Artifact
- func (b *Build) GetBuildNumber() int64
- func (b *Build) GetCauses() []map[string]interface{}
- func (b *Build) GetConsoleOutput() string
- func (b *Build) GetCulprits() []culprit
- func (b *Build) GetDownstreamBuilds() []*Build
- func (b *Build) GetDownstreamJobNames() []string
- func (b *Build) GetDuration() int64
- func (b *Build) GetMatrixRuns() []*Build
- func (b *Build) GetParameters() []parameter
- func (b *Build) GetResult() string
- func (b *Build) GetResultSet() *testResult
- func (b *Build) GetRevision() string
- func (b *Build) GetRevistionBranch() string
- func (b *Build) GetTimestamp() time.Time
- func (b *Build) GetUpstreamBuild() *Build
- func (b *Build) GetUpstreamBuildNumber() int64
- func (b *Build) GetUpstreamJob() *Job
- func (b *Build) GetUrl() string
- func (b *Build) Info() *buildResponse
- func (b *Build) IsGood() bool
- func (b *Build) IsRunning() bool
- func (b *Build) Poll(options ...interface{}) int
- func (b *Build) Stop() bool
- type Computers
- type Executor
- type Fingerprint
- type Jenkins
- func (j *Jenkins) BuildJob(name string, options ...interface{}) bool
- func (j *Jenkins) CopyJob(copyFrom string, newName string) *Job
- func (j *Jenkins) CreateJob(config string, options ...interface{}) *Job
- func (j *Jenkins) CreateNode(name string, numExecutors int, description string, remoteFS string, ...) *Node
- func (j *Jenkins) CreateView(name string, viewType string) bool
- func (j *Jenkins) DeleteJob(name string) bool
- func (j *Jenkins) GetAllBuildIds(job string) []jobBuild
- func (j *Jenkins) GetAllJobs(preload bool) []*Job
- func (j *Jenkins) GetAllNodes() []*Node
- func (j *Jenkins) GetAllViews() []*View
- func (j *Jenkins) GetArtifactData(id string) *fingerPrintResponse
- func (j *Jenkins) GetBuild(jobName string, number int64) *Build
- func (j *Jenkins) GetJob(id string) *Job
- func (j *Jenkins) GetNode(name string) *Node
- func (j *Jenkins) GetPlugins(depth int) *Plugins
- func (j *Jenkins) GetQueue() *Queue
- func (j *Jenkins) GetQueueUrl() string
- func (j *Jenkins) GetView(name string) *View
- func (j *Jenkins) HasPlugin(name string) *Plugin
- func (j *Jenkins) Info() *executorResponse
- func (j *Jenkins) Init() *Jenkins
- func (j *Jenkins) Poll() int
- func (j *Jenkins) RenameJob(job string, name string) *Job
- func (j *Jenkins) ValidateFingerPrint(id string) bool
- type Job
- func (j *Job) Copy(from string, newName string) *Job
- func (j *Job) Create(config string, qr ...interface{}) *Job
- func (j *Job) Delete() bool
- func (j *Job) Disable() bool
- func (j *Job) Enable() bool
- func (j *Job) GetAllBuildIds() []jobBuild
- func (j *Job) GetBuild(id int64) *Build
- func (j *Job) GetConfig() string
- func (j *Job) GetDescription() string
- func (j *Job) GetDetails() *jobResponse
- func (j *Job) GetDownstreamJobs() []*Job
- func (j *Job) GetDownstreamJobsMetadata() []job
- func (j *Job) GetFirstBuild() *Build
- func (j *Job) GetLastBuild() *Build
- func (j *Job) GetLastCompletedBuild() *Build
- func (j *Job) GetLastFailedBuild() *Build
- func (j *Job) GetLastStableBuild() *Build
- func (j *Job) GetLastSuccessfulBuild() *Build
- func (j *Job) GetName() string
- func (j *Job) GetParameters() []parameterDefinition
- func (j *Job) GetUpstreamJobs() []*Job
- func (j *Job) GetUpstreamJobsMetadata() []job
- func (j *Job) HasQueuedBuild()
- func (j *Job) Invoke(files []string, skipIfRunning bool, params map[string]string, cause string, ...) bool
- func (j *Job) InvokeSimple(params map[string]string) bool
- func (j *Job) IsEnabled() bool
- func (j *Job) IsQueued() bool
- func (j *Job) IsRunning() bool
- func (j *Job) Poll() int
- func (j *Job) Rename(name string)
- type Node
- func (n *Node) Delete() bool
- func (n *Node) GetName() string
- func (n *Node) Info() *nodeResponse
- func (n *Node) IsIdle() bool
- func (n *Node) IsJnlpAgent() bool
- func (n *Node) IsOnline() bool
- func (n *Node) IsTemporarilyOffline() bool
- func (n *Node) Poll() int
- func (n *Node) SetOffline()
- func (n *Node) SetOnline()
- func (n *Node) ToggleTemporarilyOffline(options ...interface{})
- type Plugin
- type Plugins
- type Queue
- type Requester
- func (r *Requester) Do(method string, endpoint string, payload io.Reader, responseStruct interface{}, ...) *http.Response
- func (r *Requester) Get(endpoint string, responseStruct interface{}, querystring map[string]string) *http.Response
- func (r *Requester) GetJSON(endpoint string, responseStruct interface{}, querystring map[string]string) *http.Response
- func (r *Requester) GetXML(endpoint string, responseStruct interface{}, querystring map[string]string) *http.Response
- func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct interface{}, ...) *http.Response
- func (r *Requester) PostFiles(endpoint string, payload io.Reader, responseStruct interface{}, ...) *http.Response
- func (r *Requester) PostXML(endpoint string, xml string, responseStruct interface{}, ...) *http.Response
- func (r *Requester) SetClient(client *http.Client) *Requester
- func (r *Requester) SetHeader(key string, value string) *Requester
- type Task
- type View
Constants ¶
const ( STATUS_FAIL = "FAIL" STATUS_ERROR = "ERROR" STATUS_ABORTED = "ABORTED" STATUS_REGRESSION = "REGRESSION" STATUS_SUCCESS = "SUCCESS" STATUS_FIXED = "FIXED" STATUS_PASSED = "PASSED" RESULT_STATUS_FAILURE = "FAILURE" RESULT_STATUS_FAILED = "FAILED" RESULT_STATUS_SKIPPED = "SKIPPED" STR_RE_SPLIT_VIEW = "(.*)/view/([^/]*)/?" )
Variables ¶
Loggers
var ( LIST_VIEW = "hudson.model.ListView" NESTED_VIEW = "hudson.plugins.nested_view.NestedView" MY_VIEW = "hudson.model.MyView" DASHBOARD_VIEW = "hudson.plugins.view.dashboard.Dashboard" PIPELINE_VIEW = "au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView" )
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
Represents an Artifact
type Build ¶
func (*Build) GetActions ¶
func (b *Build) GetActions() []generalObj
func (*Build) GetAllFingerprints ¶
func (b *Build) GetAllFingerprints() []*Fingerprint
func (*Build) GetArtifacts ¶
func (*Build) GetBuildNumber ¶
func (*Build) GetConsoleOutput ¶
func (*Build) GetCulprits ¶
func (b *Build) GetCulprits() []culprit
func (*Build) GetDownstreamBuilds ¶
func (*Build) GetDownstreamJobNames ¶
func (*Build) GetDuration ¶
func (*Build) GetMatrixRuns ¶
func (*Build) GetParameters ¶
func (b *Build) GetParameters() []parameter
func (*Build) GetResultSet ¶
func (b *Build) GetResultSet() *testResult
func (*Build) GetRevision ¶
func (*Build) GetRevistionBranch ¶
func (*Build) GetTimestamp ¶
func (*Build) GetUpstreamBuild ¶
func (*Build) GetUpstreamBuildNumber ¶
func (*Build) GetUpstreamJob ¶
func (*Build) Poll ¶
Poll for current data. Optional parameter - depth. More about depth here: https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
type Fingerprint ¶
func (Fingerprint) GetInfo ¶
func (f Fingerprint) GetInfo() *fingerPrintResponse
func (Fingerprint) Poll ¶
func (f Fingerprint) Poll() int
func (Fingerprint) Valid ¶
func (f Fingerprint) Valid() bool
func (Fingerprint) ValidateForBuild ¶
func (f Fingerprint) ValidateForBuild(filename string, build *Build) bool
type Jenkins ¶
func CreateJenkins ¶
Creates a new Jenkins Instance Optional parameters are: username, password After creating an instance call init method.
func (*Jenkins) BuildJob ¶
Invoke a job. First parameter job name, second parameter is optional Build parameters.
func (*Jenkins) CopyJob ¶
Create a copy of a job. First parameter Name of the job to copy from, Second parameter new job name.
func (*Jenkins) CreateJob ¶
Create a new job from config File Method takes XML string as first parameter, and if the name is not specified in the config file takes name as string as second parameter e.g jenkins.CreateJob("<config></config>","newJobName")
func (*Jenkins) CreateNode ¶
func (j *Jenkins) CreateNode(name string, numExecutors int, description string, remoteFS string, options ...interface{}) *Node
Create a new Node
func (*Jenkins) CreateView ¶ added in v0.2.0
func (*Jenkins) GetAllBuildIds ¶ added in v0.2.0
Get all builds Numbers and URLS for a specific job. There are only build IDs here, To get all the other info of the build use jenkins.GetBuild(job,buildNumber) or job.GetBuild(buildNumber)
func (*Jenkins) GetAllJobs ¶
Get All Possible jobs If preload is true, the Job object will be preloaded before returning.
func (*Jenkins) GetAllNodes ¶
func (*Jenkins) GetAllViews ¶ added in v0.2.0
func (*Jenkins) GetArtifactData ¶
Get Artifact data by Hash
func (*Jenkins) GetPlugins ¶
Returns the list of all plugins installed on the Jenkins server. You can supply depth parameter, to limit how much data is returned.
func (*Jenkins) GetQueueUrl ¶
func (*Jenkins) HasPlugin ¶
Check if the plugin is installed on the server. Depth level 1 is used. If you need to go deeper, you can use GetPlugins, and iterate through them.
func (*Jenkins) Info ¶
func (j *Jenkins) Info() *executorResponse
Get Basic Information About Jenkins
func (*Jenkins) Init ¶
Init Method. Should be called after creating a Jenkins Instance. e.g jenkins := CreateJenkins("url").Init() HTTP Client is set here, Connection to jenkins is tested here.
func (*Jenkins) RenameJob ¶
Rename a job. First parameter job old name, Second parameter job new name.
func (*Jenkins) ValidateFingerPrint ¶
Verify Fingerprint
type Job ¶
func (*Job) GetAllBuildIds ¶ added in v0.2.0
func (j *Job) GetAllBuildIds() []jobBuild
Returns All Builds with Number and URL
func (*Job) GetDescription ¶
func (*Job) GetDetails ¶
func (j *Job) GetDetails() *jobResponse
func (*Job) GetDownstreamJobs ¶
func (*Job) GetDownstreamJobsMetadata ¶
func (j *Job) GetDownstreamJobsMetadata() []job
func (*Job) GetFirstBuild ¶
func (*Job) GetLastBuild ¶
func (*Job) GetLastCompletedBuild ¶
func (*Job) GetLastFailedBuild ¶
func (*Job) GetLastStableBuild ¶
func (*Job) GetLastSuccessfulBuild ¶
func (*Job) GetParameters ¶
func (j *Job) GetParameters() []parameterDefinition
func (*Job) GetUpstreamJobs ¶
func (*Job) GetUpstreamJobsMetadata ¶
func (j *Job) GetUpstreamJobsMetadata() []job
func (*Job) HasQueuedBuild ¶
func (j *Job) HasQueuedBuild()
type Node ¶
func (*Node) IsJnlpAgent ¶
func (*Node) IsTemporarilyOffline ¶
func (*Node) SetOffline ¶
func (n *Node) SetOffline()
func (*Node) ToggleTemporarilyOffline ¶
func (n *Node) ToggleTemporarilyOffline(options ...interface{})
type Plugin ¶
type Plugin struct { Active bool `json:"active"` BackupVersion interface{} `json:"backupVersion"` Bundled bool `json:"bundled"` Deleted bool `json:"deleted"` Dependencies []struct { Optional string `json:"optional"` ShortName string `json:"shortname"` Version string `json:"version"` } `json:"dependencies"` Downgradable bool `json:"downgradable"` Enabled bool `json:"enabled"` HasUpdate bool `json:"hasUpdate"` LongName string `json:"longName"` Pinned bool `json:"pinned"` ShortName string `json:"shortName"` SupportsDynamicLoad string `json:"supportsDynamicLoad"` URL string `json:"url"` Version string `json:"version"` }
type Requester ¶
type Requester struct { Base string BasicAuth *BasicAuth Headers http.Header Client *http.Client SslVerify bool LastResponse *http.Response Suffix string }
type Task ¶
func (*Task) GetParameters ¶
func (t *Task) GetParameters() []parameter