Documentation ¶
Overview ¶
Package targetlist implements a simple target manager that contains a static list of targets. Use it as follows in a job descriptor: "TargetManager": "targetlist",
"TargetManagerAcquireParameters": { "Targets": [ { "Name": "hostname1.example.com", "ID": "id1" }, { "Name": "hostname2.example.com", "ID": "id2" }
] }
hostname1.example.com,1.2.3.4 hostname2,2001:db8::1
In other words, two fields: the first containing a host name (fully qualified or not), and the second containin the IP address of the target (this field is optional).
Index ¶
- Variables
- func Load() (string, target.TargetManagerFactory)
- func New() target.TargetManager
- type AcquireParameters
- type ReleaseParameters
- type TargetList
- func (t *TargetList) Acquire(ctx xcontext.Context, jobID types.JobID, ...) ([]*target.Target, error)
- func (t *TargetList) Release(ctx xcontext.Context, jobID types.JobID, targets []*target.Target, ...) error
- func (t TargetList) ValidateAcquireParameters(params []byte) (interface{}, error)
- func (t TargetList) ValidateReleaseParameters(params []byte) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
var (
Name = "TargetList"
)
Name defined the name of the plugin
Functions ¶
func Load ¶
func Load() (string, target.TargetManagerFactory)
Load returns the name and factory which are needed to register the TargetManager.
Types ¶
type AcquireParameters ¶
AcquireParameters contains the parameters necessary to acquire targets.
type ReleaseParameters ¶
type ReleaseParameters struct { }
ReleaseParameters contains the parameters necessary to release targets.
type TargetList ¶
type TargetList struct { }
TargetList implements the contest.TargetManager interface.
func (*TargetList) Acquire ¶
func (t *TargetList) Acquire(ctx xcontext.Context, jobID types.JobID, jobTargetManagerAcquireTimeout time.Duration, parameters interface{}, tl target.Locker) ([]*target.Target, error)
Acquire implements contest.TargetManager.Acquire
func (*TargetList) Release ¶
func (t *TargetList) Release(ctx xcontext.Context, jobID types.JobID, targets []*target.Target, params interface{}) error
Release releases the acquired resources.
func (TargetList) ValidateAcquireParameters ¶
func (t TargetList) ValidateAcquireParameters(params []byte) (interface{}, error)
ValidateAcquireParameters valides parameters that will be passed to Acquire.
func (TargetList) ValidateReleaseParameters ¶
func (t TargetList) ValidateReleaseParameters(params []byte) (interface{}, error)
ValidateReleaseParameters valides parameters that will be passed to Release.