Documentation
¶
Index ¶
- func EmptyParams() map[string]string
- func ExtractJobIDS(jobs []Job) []int64
- type Children
- type Comment
- type CommentMQ
- type Instance
- func (i *Instance) DeleteJob(id int64) error
- func (i *Instance) DeleteJobGroup(id int) error
- func (i *Instance) DeleteJobGroupJobs(id int) error
- func (i *Instance) DeleteJobTemplate(id int) error
- func (i *Instance) DeleteMachine(id int) error
- func (i *Instance) GetComments(job int64) ([]Comment, error)
- func (i *Instance) GetJob(id int64) (Job, error)
- func (inst *Instance) GetJobFollow(id int64) (Job, error)
- func (i *Instance) GetJobGroup(id int) (JobGroup, error)
- func (instance *Instance) GetJobGroupJobs(id int) ([]int64, error)
- func (i *Instance) GetJobGroups() ([]JobGroup, error)
- func (i *Instance) GetJobState(id int64) (JobState, error)
- func (i *Instance) GetJobTemplate(id int) (JobTemplate, error)
- func (i *Instance) GetJobTemplateYAML(id int) (string, error)
- func (i *Instance) GetJobTemplates() ([]JobTemplate, error)
- func (i *Instance) GetJobs(ids []int64) ([]Job, error)
- func (inst *Instance) GetJobsFollow(ids []int64) ([]Job, error)
- func (i *Instance) GetLatestJobs(testsuite string, params map[string]string) ([]Job, error)
- func (i *Instance) GetMachine(id int) (Machine, error)
- func (i *Instance) GetMachines() ([]Machine, error)
- func (i *Instance) GetOverview(testsuite string, params map[string]string) ([]Job, error)
- func (i *Instance) GetParentJobGroup(id int) (JobGroup, error)
- func (i *Instance) GetParentJobGroups() ([]JobGroup, error)
- func (i *Instance) GetProduct(id int) (Product, error)
- func (i *Instance) GetProducts() ([]Product, error)
- func (i *Instance) GetWorkers() ([]Worker, error)
- func (i *Instance) PostJobGroup(jobgroup JobGroup) (JobGroup, error)
- func (i *Instance) PostJobTemplateYAML(id int, yaml string) error
- func (i *Instance) PostMachine(machine Machine) (Machine, error)
- func (i *Instance) PostParentJobGroup(jobgroup JobGroup) (JobGroup, error)
- func (i *Instance) PostProduct(product Product) (Product, error)
- func (i *Instance) SetAllowParallel(allow bool)
- func (i *Instance) SetApiKey(key string, secret string)
- func (i *Instance) SetMaxRecursionDepth(depth int)
- func (i *Instance) SetUserAgent(userAgent string)
- func (i *Instance) SetVerbose(verbose bool)
- type Job
- type JobGroup
- type JobState
- type JobStatus
- type JobTemplate
- type Machine
- type Product
- type RabbitMQ
- type RabbitMQCloseCallback
- type RabbitMQSubscription
- func (sub *RabbitMQSubscription) Close()
- func (sub *RabbitMQSubscription) Connected() bool
- func (sub *RabbitMQSubscription) Receive() (amqp.Delivery, error)
- func (sub *RabbitMQSubscription) ReceiveComment() (CommentMQ, error)
- func (sub *RabbitMQSubscription) ReceiveJob() (Job, error)
- func (sub *RabbitMQSubscription) ReceiveJobStatus() (JobStatus, error)
- type Settings
- type TestSuite
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyParams ¶
func ExtractJobIDS ¶ added in v0.7.0
Types ¶
type Children ¶
type Children struct {
Chained []int64 `json:"Chained"`
DirectlyChained []int64 `json:"Directly chained"`
Parallel []int64 `json:"Parallel"`
}
Children struct is for chained, directly chained and parallel children/parents
type Comment ¶
type Comment struct {
ID int `json:"id"`
Text string `json:"text"` // Comment text
Markdown string `json:"renderedMarkdown"` // HTML of the rendered markdown
BugRefs []string `json:"bugrefs"` // Referenced bugs
Created string `json:"created"` // bug creation date
Updated string `json:"updated"` // timestamp for update
User string `json:"userName"` // Creator
}
type CommentMQ ¶ added in v0.4.0
type CommentMQ struct {
ID int `json:"id"`
Created string `json:"created"`
Updates string `json:"updated"`
Text string `json:"text"`
User string `json:"user"`
}
RabbitMQ comment
type Instance ¶
type Instance struct {
URL string
// contains filtered or unexported fields
}
Instance defines a openQA instance
func CreateO3Instance ¶
func CreateO3Instance() Instance
Create a openQA instance module for openqa.opensuse.org
func (*Instance) DeleteJobGroup ¶
func (*Instance) DeleteJobGroupJobs ¶
func (*Instance) DeleteJobTemplate ¶
func (*Instance) DeleteMachine ¶
func (*Instance) GetComments ¶
Fetch comments for a given job
func (*Instance) GetJobFollow ¶
GetJob fetches detailled job information and follows the job, if it contains a CloneID
func (*Instance) GetJobGroupJobs ¶
func (*Instance) GetJobGroups ¶
func (*Instance) GetJobState ¶ added in v0.7.0
GetJobState uses the (currently experimental) API call to quickly fetch a job state
func (*Instance) GetJobTemplate ¶
func (i *Instance) GetJobTemplate(id int) (JobTemplate, error)
func (*Instance) GetJobTemplates ¶
func (i *Instance) GetJobTemplates() ([]JobTemplate, error)
func (*Instance) GetJobs ¶ added in v0.6.0
GetJob fetches detailled information about a list of jobs
func (*Instance) GetJobsFollow ¶ added in v0.7.2
GetJob fetches detailled information about a list of jobs. Follows cloned jobs, if applicable
func (*Instance) GetLatestJobs ¶
Get only the latest jobs of a certain testsuite. Testsuite must be given here. * Additional parameters can be supplied via the params map (See GetOverview for more info about usage of those parameters)
func (*Instance) GetMachines ¶
func (*Instance) GetOverview ¶
Query the job overview. params is a map for optional parameters, which will be added to the query. * Suitable parameters are `arch`, `distri`, `flavor`, `machine` or `arch`, but everything in this dict will be added to the url * Overview returns only the job id and name
func (*Instance) GetParentJobGroups ¶
func (*Instance) GetProducts ¶
func (*Instance) GetWorkers ¶
func (*Instance) PostJobGroup ¶
func (*Instance) PostJobTemplateYAML ¶
func (*Instance) PostParentJobGroup ¶
func (*Instance) SetAllowParallel ¶ added in v0.6.0
Set to allow or disallow parallel requests to the instance
func (*Instance) SetMaxRecursionDepth ¶
Set the maximum allowed number of recursions before failing
func (*Instance) SetUserAgent ¶ added in v0.4.1
Set the UserAgent for HTTP requests
type Job ¶
type Job struct {
AssignedWorkerID int `json:"assigned_worker_id"`
BlockedByID int `json:"blocked_by_id"`
Children Children `json:"children"`
Parents Children `json:"parents"`
CloneID int64 `json:"clone_id"`
GroupID int `json:"group_id"`
ID int64 `json:"id"`
// Modules
Name string `json:"name"`
// Parents
Priority int `json:"priority"`
Result string `json:"result"`
Settings Settings `json:"settings"`
State string `json:"state"`
Tfinished string `json:"t_finished"`
Tstarted string `json:"t_started"`
Test string `json:"test"`
/* this is added by the program and not part of the fetched json */
Link string
Prefix string
Remote string // openQA remote host
// contains filtered or unexported fields
}
Job instance
func (*Job) FetchAllChildren ¶
Fetch all child jobs * follow determines if we should follow the given children, i.e. get their cloned jobs instead of the original ones if present
func (*Job) FetchChildren ¶
* Fetch the given child jobs. Use with j.Children.Chained, j.Children.DirectlyChained and j.Children.Parallel * if follow is set to true, the method will return the cloned job instead of the original one, if present
type JobGroup ¶
type JobGroup struct {
ID int `json:"id"`
Name string `json:"name"`
ParentID int `json:"parent_id"`
Description string `json:"description"`
BuildVersionSort int `json:"build_version_sort"`
CarryOverBugrefs int `json:"carry_over_bugrefs"`
DefaultPriority int `json:"default_priority`
// Disabled because of type mismatch in json
// Sometimes it's returned as int, sometimes as string and we cannot deal with that atm
//KeepImportantLogsInDays int `json:"keep_important_logs_in_days"`
//KeepImportantResultsInDays int `json:"keep_important_results_in_days"`
//KeepLogsInDays int `json:"keep_logs_in_days"`
//KeepResultsInDays int `json:"keep_results_in_days"`
//SizeLimit int `json:"size_limit_gb"` // Size limit in GB
SortOrder int `json:"sort_order"`
Template string `json:"template"`
}
Job Group
type JobState ¶ added in v0.7.0
type JobState struct {
BlockedBy int64 `json:"blocked_by_id"`
Result string `json:"result"`
State string `json:"state"`
}
Special struct for getting quick job status
type JobStatus ¶
type JobStatus struct {
Type string // Type of the update. Currently "job.done" and "job.restarted" are set
Arch string `json:"ARCH"`
Build string `json:"BUILD"`
Flavor string `json:"FLAVOR"`
Machine string `json:"MACHINE"`
Test string `json:"TEST"`
BugRef string `json:"bugref"`
GroupID int `json:"group_id"`
ID int64 `json:"id"`
NewBuild string `json:"newbuild"`
Reason string `json:"reason"`
Remaining int `json:"remaining"`
Result interface{} `json:"result"`
}
JobStatus is the returns struct for job status updates from RabbitMQ
type JobTemplate ¶
type JobTemplate struct {
GroupName string `json:"group_name"`
ID int `json:"id"`
Machine Machine `json:"machine"`
Priority int `json:"prio"`
Product Product `json:"product"`
TestSuite TestSuite `json:"test_suite"`
}
Job Template
type Machine ¶
type Machine struct {
ID int `json:"id"`
Backend string `json:"backend"`
Name string `json:"name"`
Settings map[string]string `json:"settings"`
}
Machine type
type Product ¶
type Product struct {
Arch string `json:"arch"`
Distri string `json:"distri"`
Flavor string `json:"flavor"`
Group string `json:"group"`
ID int `json:"id"`
Version string `json:"version"`
Settings map[string]string `json:"settings"`
}
Product
type RabbitMQ ¶
type RabbitMQ struct {
// contains filtered or unexported fields
}
RabbitMQ struct is the object which handles the connection to a RabbitMQ instance
func ConnectRabbitMQ ¶
ConnectRabbitMQ connects to a RabbitMQ instance and returns the RabbitMQ object
func (*RabbitMQ) Closed ¶ added in v0.5.3
Connected returns true if RabbitMQ is closing or if it is closed.
func (*RabbitMQ) NotifyClose ¶ added in v0.5.3
func (mq *RabbitMQ) NotifyClose(callback RabbitMQCloseCallback)
NotifyClose registeres a defined callback function for when the RabbitMQ connection is closed
func (*RabbitMQ) Reconnect ¶ added in v0.5.3
Reconnect to the RabbitMQ server. This will close any previous connections and channels
func (*RabbitMQ) Subscribe ¶
func (mq *RabbitMQ) Subscribe(key string) (RabbitMQSubscription, error)
Subscribe to a given key and get the messages via the callback function. This method will return after establishing the channel and call the callback function when a new message arrives This message returns a RabbitMQSubscription object, which in turn can be used to receive the incoming messages
type RabbitMQCloseCallback ¶ added in v0.5.3
type RabbitMQCloseCallback func(error)
Callback when the connection was closed
type RabbitMQSubscription ¶
type RabbitMQSubscription struct {
// contains filtered or unexported fields
}
RabbitMQSubscription handles a single subscription
func (*RabbitMQSubscription) Close ¶
func (sub *RabbitMQSubscription) Close()
Close subscription channel
func (*RabbitMQSubscription) Connected ¶ added in v0.5.3
func (sub *RabbitMQSubscription) Connected() bool
Connected returns true if RabbitMQ is connected
func (*RabbitMQSubscription) Receive ¶
func (sub *RabbitMQSubscription) Receive() (amqp.Delivery, error)
Receive receives a raw non-empty RabbitMQ messages
func (*RabbitMQSubscription) ReceiveComment ¶ added in v0.4.0
func (sub *RabbitMQSubscription) ReceiveComment() (CommentMQ, error)
ReceiveJobStatus receives the next message and try to parse it as Comment. Use this for job status updates
func (*RabbitMQSubscription) ReceiveJob ¶
func (sub *RabbitMQSubscription) ReceiveJob() (Job, error)
ReceiveJob receives the next message and try to parse it as job
func (*RabbitMQSubscription) ReceiveJobStatus ¶
func (sub *RabbitMQSubscription) ReceiveJobStatus() (JobStatus, error)
ReceiveJobStatus receives the next message and try to parse it as JobStatus. Use this for job status updates
type Settings ¶
type Settings struct {
Arch string `json:"ARCH"`
Backend string `json:"BACKEND"`
Machine string `json:"MACHINE"`
}
Job Setting struct
type TestSuite ¶
type TestSuite struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Settings map[string]string `json:"settings"`
}
Test Suite
type Worker ¶
type Worker struct {
Alive int `json:"alive"`
Connected int `json:"connected"`
Error string `json:"error"` // Error string if present
Host string `json:"host"`
ID int `json:"id"`
Instance int `json:"instance"`
Status string `json:"status"`
Websocket int `json:"websocket"`
Properties map[string]string `json:"properties"` // Worker properties as returned by openQA
}
Worker instance
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gopenqa
command
* This is a example CLI tool for demonstrating the usage of gopenqa.
|
* This is a example CLI tool for demonstrating the usage of gopenqa. |
|
examples
|
|
|
list_jobgroups
command
|
|
|
rabbitmq
command
|