rundeck

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2019 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AclPolicyDelete added in v0.2.0

func AclPolicyDelete(d *schema.ResourceData, meta interface{}) error

func AclPolicyExists added in v0.2.0

func AclPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error)

func CreateAclPolicy added in v0.2.0

func CreateAclPolicy(d *schema.ResourceData, meta interface{}) error

func CreateJob

func CreateJob(d *schema.ResourceData, meta interface{}) error

func CreateOrUpdatePrivateKey

func CreateOrUpdatePrivateKey(d *schema.ResourceData, meta interface{}) error

func CreateProject

func CreateProject(d *schema.ResourceData, meta interface{}) error

func CreatePublicKey

func CreatePublicKey(d *schema.ResourceData, meta interface{}) error

func DeleteJob

func DeleteJob(d *schema.ResourceData, meta interface{}) error

func DeletePrivateKey

func DeletePrivateKey(d *schema.ResourceData, meta interface{}) error

func DeleteProject

func DeleteProject(d *schema.ResourceData, meta interface{}) error

func DeletePublicKey

func DeletePublicKey(d *schema.ResourceData, meta interface{}) error

func JobExists

func JobExists(d *schema.ResourceData, meta interface{}) (bool, error)

func PrivateKeyExists

func PrivateKeyExists(d *schema.ResourceData, meta interface{}) (bool, error)

func ProjectExists

func ProjectExists(d *schema.ResourceData, meta interface{}) (bool, error)

func Provider

func Provider() terraform.ResourceProvider

func PublicKeyExists

func PublicKeyExists(d *schema.ResourceData, meta interface{}) (bool, error)

func ReadAclPolicy added in v0.2.0

func ReadAclPolicy(d *schema.ResourceData, meta interface{}) error

func ReadJob

func ReadJob(d *schema.ResourceData, meta interface{}) error

func ReadPrivateKey

func ReadPrivateKey(d *schema.ResourceData, meta interface{}) error

func ReadProject

func ReadProject(d *schema.ResourceData, meta interface{}) error

func ReadPublicKey

func ReadPublicKey(d *schema.ResourceData, meta interface{}) error

func UpdateAclPolicy added in v0.2.0

func UpdateAclPolicy(d *schema.ResourceData, meta interface{}) error

func UpdateJob

func UpdateJob(d *schema.ResourceData, meta interface{}) error

func UpdateProject

func UpdateProject(d *schema.ResourceData, meta interface{}) error

func UpdatePublicKey

func UpdatePublicKey(d *schema.ResourceData, meta interface{}) error

Types

type Boolean added in v0.2.0

type Boolean struct {
	Value bool `xml:",chardata"`
}

type EmailNotification added in v0.2.0

type EmailNotification struct {
	AttachLog  bool               `xml:"attachLog,attr,omitempty"`
	Recipients NotificationEmails `xml:"recipients,attr"`
	Subject    string             `xml:"subject,attr"`
}

type JobCommand added in v0.2.0

type JobCommand struct {
	XMLName xml.Name

	// If the Workflow keepgoing is false, this allows the Workflow to continue when the Error Handler is successful.
	ContinueOnError bool `xml:"keepgoingOnSuccess,attr,omitempty"`

	// Description
	Description string `xml:"description,omitempty"`

	// On error:
	ErrorHandler *JobCommand `xml:"errorhandler,omitempty"`

	// A literal shell command to run.
	ShellCommand string `xml:"exec,omitempty"`

	// Add extension to the temporary filename.
	FileExtension string `xml:"fileExtension,omitempty"`

	// An inline program to run. This will be written to disk and executed, so if it is
	// a shell script it should have an appropriate #! line.
	Script string `xml:"script,omitempty"`

	// A pre-existing file (on the target nodes) that will be executed.
	ScriptFile string `xml:"scriptfile,omitempty"`

	// When ScriptFile is set, the arguments to provide to the script when executing it.
	ScriptFileArgs string `xml:"scriptargs,omitempty"`

	// ScriptInterpreter is used to execute (Script)File with.
	ScriptInterpreter *JobCommandScriptInterpreter `xml:"scriptinterpreter,omitempty"`

	// A reference to another job to run as this command.
	Job *JobCommandJobRef `xml:"jobref"`

	// Configuration for a step plugin to run as this command.
	StepPlugin *JobPlugin `xml:"step-plugin"`

	// Configuration for a node step plugin to run as this command.
	NodeStepPlugin *JobPlugin `xml:"node-step-plugin"`
}

JobCommand describes a particular command to run within the sequence of commands on a job. The members of this struct are mutually-exclusive except for the pair of ScriptFile and ScriptFileArgs.

type JobCommandJobRef added in v0.2.0

type JobCommandJobRef struct {
	XMLName        xml.Name                  `xml:"jobref"`
	Name           string                    `xml:"name,attr"`
	GroupName      string                    `xml:"group,attr"`
	RunForEachNode bool                      `xml:"nodeStep,attr"`
	Dispatch       *JobDispatch              `xml:"dispatch,omitempty"`
	NodeFilter     *JobNodeFilter            `xml:"nodefilters,omitempty"`
	Arguments      JobCommandJobRefArguments `xml:"arg"`
}

JobCommandJobRef is a reference to another job that will run as one of the commands of a job.

type JobCommandJobRefArguments added in v0.2.0

type JobCommandJobRefArguments string

JobCommandJobRefArguments is a string representing the arguments in a JobCommandJobRef.

func (JobCommandJobRefArguments) MarshalXML added in v0.2.0

func (a JobCommandJobRefArguments) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*JobCommandJobRefArguments) UnmarshalXML added in v0.2.0

func (a *JobCommandJobRefArguments) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobCommandScriptInterpreter added in v0.2.0

type JobCommandScriptInterpreter struct {
	XMLName          xml.Name `xml:"scriptinterpreter"`
	InvocationString string   `xml:",chardata"`
	ArgsQuoted       bool     `xml:"argsquoted,attr,omitempty"`
}

(Inline) Script interpreter

type JobCommandSequence added in v0.2.0

type JobCommandSequence struct {
	XMLName xml.Name `xml:"sequence"`

	// If set, Rundeck will continue with subsequent commands after a command fails.
	ContinueOnError bool `xml:"keepgoing,attr"`

	// Chooses the strategy by which Rundeck will execute commands. Can either be "node-first" or
	// "step-first".
	OrderingStrategy string `xml:"strategy,attr,omitempty"`

	// Sequence of commands to run in the sequence.
	Commands []JobCommand `xml:"command"`

	// Description
	Description string `xml:"description,omitempty"`
}

JobCommandSequence describes the sequence of operations that a job will perform.

type JobDetail added in v0.2.0

type JobDetail struct {
	XMLName                   xml.Name            `xml:"job"`
	ID                        string              `xml:"uuid,omitempty"`
	Name                      string              `xml:"name"`
	GroupName                 string              `xml:"group,omitempty"`
	ProjectName               string              `xml:"context>project,omitempty"`
	OptionsConfig             *JobOptions         `xml:"context>options,omitempty"`
	Description               string              `xml:"description"`
	ExecutionEnabled          bool                `xml:"executionEnabled"`
	LogLevel                  string              `xml:"loglevel,omitempty"`
	AllowConcurrentExecutions bool                `xml:"multipleExecutions,omitempty"`
	Dispatch                  *JobDispatch        `xml:"dispatch,omitempty"`
	CommandSequence           *JobCommandSequence `xml:"sequence,omitempty"`
	Notification              *JobNotification    `xml:"notification,omitempty"`
	Timeout                   string              `xml:"timeout,omitempty"`
	Retry                     string              `xml:"retry,omitempty"`
	NodeFilter                *JobNodeFilter      `xml:"nodefilters,omitempty"`

	/* If Dispatch is enabled, nodesSelectedByDefault is always present with true/false.
	 * by this reason omitempty cannot be present.
	 * This has to be handle by the user.
	 */
	NodesSelectedByDefault *Boolean     `xml:"nodesSelectedByDefault"`
	Schedule               *JobSchedule `xml:"schedule,omitempty"`
	ScheduleEnabled        bool         `xml:"scheduleEnabled"`
}

JobDetail is a comprehensive description of a job, including its entire definition.

func GetJob added in v0.2.0

func GetJob(c *rundeck.BaseClient, id string) (*JobDetail, error)

GetJob returns the full job details of the job with the given id.

type JobDispatch added in v0.2.0

type JobDispatch struct {
	ExcludePrecedence        *Boolean `xml:"excludePrecedence"`
	MaxThreadCount           int      `xml:"threadcount,omitempty"`
	ContinueOnError          bool     `xml:"keepgoing"`
	RankAttribute            string   `xml:"rankAttribute,omitempty"`
	RankOrder                string   `xml:"rankOrder,omitempty"`
	SuccessOnEmptyNodeFilter bool     `xml:"successOnEmptyNodeFilter,omitempty"`
}

type JobNodeFilter added in v0.2.0

type JobNodeFilter struct {
	ExcludePrecedence bool   `xml:"excludeprecedence"`
	Query             string `xml:"filter,omitempty"`
}

JobNodeFilter describes which nodes from the project's resource list will run the configured commands.

type JobNotification added in v0.2.0

type JobNotification struct {
	OnFailure *Notification `xml:"onfailure,omitempty"`
	OnStart   *Notification `xml:"onstart,omitempty"`
	OnSuccess *Notification `xml:"onsuccess,omitempty"`
}

type JobOption added in v0.2.0

type JobOption struct {
	XMLName xml.Name `xml:"option"`

	// If AllowsMultipleChoices is set, the string that will be used to delimit the multiple
	// chosen options.
	MultiValueDelimiter string `xml:"delimiter,attr,omitempty"`

	// If set, Rundeck will reject values that are not in the set of predefined choices.
	RequirePredefinedChoice bool `xml:"enforcedvalues,attr,omitempty"`

	// When either ValueChoices or ValueChoicesURL is set, controls whether more than one
	// choice may be selected as the value.
	AllowsMultipleValues bool `xml:"multivalued,attr,omitempty"`

	// The name of the option, which can be used to interpolate its value
	// into job commands.
	Name string `xml:"name,attr,omitempty"`

	// Regular expression to be used to validate the option value.
	ValidationRegex string `xml:"regex,attr,omitempty"`

	// If set, Rundeck requires a value to be set for this option.
	IsRequired bool `xml:"required,attr,omitempty"`

	// If set, the input for this field will be obscured in the UI. Useful for passwords
	// and other secrets.
	ObscureInput bool `xml:"secure,attr,omitempty"`

	// If ObscureInput is set, StoragePath can be used to point out credentials.
	StoragePath string `xml:"storagePath,attr,omitempty"`

	// The default value of the option.
	DefaultValue string `xml:"value,attr,omitempty"`

	// If set, the value can be accessed from scripts.
	ValueIsExposedToScripts bool `xml:"valueExposed,attr,omitempty"`

	// A sequence of predefined choices for this option. Mutually exclusive with ValueChoicesURL.
	ValueChoices JobValueChoices `xml:"values,attr"`

	// A URL from which the predefined choices for this option will be retrieved.
	// Mutually exclusive with ValueChoices
	ValueChoicesURL string `xml:"valuesUrl,attr,omitempty"`

	// Description of the value to be shown in the Rundeck UI.
	Description string `xml:"description,omitempty"`
}

JobOption represents a single option on a job.

type JobOptions added in v0.2.0

type JobOptions struct {
	PreserveOrder bool        `xml:"preserveOrder,attr,omitempty"`
	Options       []JobOption `xml:"option"`
}

JobOptions represents the set of options on a job, if any.

type JobPlugin added in v0.2.0

type JobPlugin struct {
	XMLName xml.Name
	Type    string          `xml:"type,attr"`
	Config  JobPluginConfig `xml:"configuration"`
}

Plugin is a configuration for a plugin to run within a job or notification.

type JobPluginConfig added in v0.2.0

type JobPluginConfig map[string]string

JobPluginConfig is a specialization of map[string]string for job plugin configuration.

func (JobPluginConfig) MarshalXML added in v0.2.0

func (c JobPluginConfig) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*JobPluginConfig) UnmarshalXML added in v0.2.0

func (c *JobPluginConfig) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type JobSchedule added in v0.2.0

type JobSchedule struct {
	XMLName    xml.Name               `xml:"schedule"`
	DayOfMonth *JobScheduleDayOfMonth `xml:"dayofmonth,omitempty"`
	Time       JobScheduleTime        `xml:"time"`
	Month      JobScheduleMonth       `xml:"month"`
	WeekDay    *JobScheduleWeekDay    `xml:"weekday,omitempty"`
	Year       JobScheduleYear        `xml:"year"`
}

type JobScheduleDayOfMonth added in v0.2.0

type JobScheduleDayOfMonth struct {
	XMLName xml.Name `xml:"dayofmonth"`
}

type JobScheduleMonth added in v0.2.0

type JobScheduleMonth struct {
	XMLName xml.Name `xml:"month"`
	Day     string   `xml:"day,attr,omitempty"`
	Month   string   `xml:"month,attr"`
}

type JobScheduleTime added in v0.2.0

type JobScheduleTime struct {
	XMLName xml.Name `xml:"time"`
	Hour    string   `xml:"hour,attr"`
	Minute  string   `xml:"minute,attr"`
	Seconds string   `xml:"seconds,attr"`
}

type JobScheduleWeekDay added in v0.2.0

type JobScheduleWeekDay struct {
	XMLName xml.Name `xml:"weekday"`
	Day     string   `xml:"day,attr"`
}

type JobScheduleYear added in v0.2.0

type JobScheduleYear struct {
	XMLName xml.Name `xml:"year"`
	Year    string   `xml:"year,attr"`
}

type JobSummary added in v0.2.0

type JobSummary struct {
	XMLName     xml.Name `xml:"job"`
	ID          string   `xml:"id,attr"`
	Name        string   `xml:"name"`
	GroupName   string   `xml:"group"`
	ProjectName string   `xml:"project"`
	Description string   `xml:"description,omitempty"`
}

JobSummary is an abbreviated description of a job that includes only its basic descriptive information and identifiers.

type JobValueChoices added in v0.2.0

type JobValueChoices []string

JobValueChoices is a specialization of []string representing a sequence of predefined values for a job option.

func (JobValueChoices) MarshalXMLAttr added in v0.2.0

func (c JobValueChoices) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

func (*JobValueChoices) UnmarshalXMLAttr added in v0.2.0

func (c *JobValueChoices) UnmarshalXMLAttr(attr xml.Attr) error

type NotFoundError added in v0.2.0

type NotFoundError struct{}

func (NotFoundError) Error added in v0.2.0

func (err NotFoundError) Error() string

type Notification added in v0.2.0

type Notification struct {
	Email   *EmailNotification   `xml:"email,omitempty"`
	WebHook *WebHookNotification `xml:"webhook,omitempty"`
	Plugin  *JobPlugin           `xml:"plugin"`
}

type NotificationEmails added in v0.2.0

type NotificationEmails []string

func (NotificationEmails) MarshalXMLAttr added in v0.2.0

func (c NotificationEmails) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

func (*NotificationEmails) UnmarshalXMLAttr added in v0.2.0

func (c *NotificationEmails) UnmarshalXMLAttr(attr xml.Attr) error

type NotificationUrls added in v0.2.0

type NotificationUrls []string

func (NotificationUrls) MarshalXMLAttr added in v0.2.0

func (c NotificationUrls) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

func (*NotificationUrls) UnmarshalXMLAttr added in v0.2.0

func (c *NotificationUrls) UnmarshalXMLAttr(attr xml.Attr) error

type WebHookNotification added in v0.2.0

type WebHookNotification struct {
	Urls NotificationUrls `xml:"urls,attr"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL