Documentation
¶
Index ¶
- func EmptyParams() map[string]string
- type Children
- type Comment
- type Instance
- func (i *Instance) DeleteJob(id int) 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 int) ([]Comment, error)
- func (i *Instance) GetJob(id int) (Job, error)
- func (i *Instance) GetJobFollow(id int) (Job, error)
- func (i *Instance) GetJobGroup(id int) (JobGroup, error)
- func (instance *Instance) GetJobGroupJobs(id int) ([]int, error)
- func (i *Instance) GetJobGroups() ([]JobGroup, 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) 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) SetApiKey(key string, secret string)
- func (i *Instance) SetMaxRecursionDepth(depth int)
- func (i *Instance) SetVerbose(verbose bool)
- type Job
- type JobGroup
- type JobStatus
- type JobTemplate
- type Machine
- type Product
- type RabbitMQ
- type RabbitMQSubscription
- type Settings
- type TestSuite
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyParams ¶
Types ¶
type Children ¶
type Children struct {
Chained []int `json:"Chained"`
DirectlyChained []int `json:"Directly chained"`
Parallel []int `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
Rendered 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 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) GetJobGroups ¶
func (*Instance) GetJobTemplate ¶
func (i *Instance) GetJobTemplate(id int) (JobTemplate, error)
func (*Instance) GetJobTemplates ¶
func (i *Instance) GetJobTemplates() ([]JobTemplate, error)
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) SetMaxRecursionDepth ¶
Set the maximum allowed number of recursions before failing
func (*Instance) SetVerbose ¶
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 int `json:"clone_id"`
GroupID int `json:"group_id"`
ID int `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
// 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 JobStatus ¶
type JobStatus struct {
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 int `json:"id"`
NewBuild string `json:"newbuild"`
Reason string `json:"reason"`
Remaining int `json:"remaining"`
Result string `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) 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 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) Receive ¶
func (sub *RabbitMQSubscription) Receive() (amqp.Delivery, error)
Receive receives a raw RabbitMQ messages
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