rundeck

package
v0.0.0-...-2cd72dd Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRundeckVersion = "19"

MaxRundeckVersion is the maximum version of the api this library supports can be overridden

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLListContents

type ACLListContents struct {
	XMLName   xml.Name `xml:"contents"`
	Resources []struct {
		XMLName xml.Name `xml:"resource"`
		Path    string   `xml:"path,attr"`
		Type    string   `xml:"type,attr"`
		Href    string   `xml:"href,attr"`
		Name    string   `xml:"name,attr"`
	} `xml:"resource,omitempty"`
}

ACLListContents represents the contents of an acl list

type ACLPolicies

type ACLPolicies struct {
	XMLName  xml.Name        `xml:"resource"`
	Path     string          `xml:"path,attr"`
	Type     string          `xml:"type,attr"`
	Href     string          `xml:"href,attr"`
	Contents ACLListContents `xml:"contents,omitempty"`
}

ACLPolicies represents ACLPolicies

type CPU

type CPU struct {
	XMLName     xml.Name `xml:"cpu"`
	LoadAverage struct {
		XMLName xml.Name
		Unit    string  `xml:"unit,attr"`
		Value   float64 `xml:",chardata"`
	} `xml:"loadAverage"`
	Processors int64 `xml:"processors"`
}

CPU represents CPU stats

type Client

type Client struct {
	Client     *napping.Session
	HTTPClient *http.Client
	Config     *ClientConfig
	Transport  *http.Transport
}

Client represents a rundeck client

func NewClient

func NewClient(config *ClientConfig) (c Client)

NewClient creates a new client from the provided `ClientConfig`

func NewClientFromEnv

func NewClientFromEnv() (c Client)

NewClientFromEnv returns a new client from provided env vars

func (*Client) CreateSystemACLPolicy

func (c *Client) CreateSystemACLPolicy(name string, contents []byte) error

CreateSystemACLPolicy creates a system acl policy

func (*Client) CreateToken

func (c *Client) CreateToken(u string) (token string, e error)

CreateToken creates a token

func (*Client) Delete

func (rc *Client) Delete(path string, options interface{}) error

Delete performs an authenticated HTTP DELETE

func (*Client) DeleteAllExecutionsForProject

func (c *Client) DeleteAllExecutionsForProject(project string, max int64) (ExecutionsDeleted, error)

DeleteAllExecutionsForProject deletes all executions for a project up to the max (default: 10)

func (*Client) DeleteExecution

func (c *Client) DeleteExecution(id string) error

DeleteExecution deletes an execution

func (*Client) DeleteExecutions

func (c *Client) DeleteExecutions(ids []string) (ExecutionsDeleted, error)

DeleteExecutions deletes a list of executions by id

func (*Client) DeleteJob

func (c *Client) DeleteJob(id string) error

DeleteJob deletes a job

func (*Client) DeleteProject

func (c *Client) DeleteProject(p string) error

DeleteProject deletes a project

func (*Client) DeleteToken

func (c *Client) DeleteToken(token string) error

DeleteToken deletes a token

func (*Client) DisableExecution

func (c *Client) DisableExecution(id string) error

DisableExecution disables an execution

func (*Client) EnableExecution

func (c *Client) EnableExecution(id string) error

EnableExecution enables an execution

func (*Client) ExportJob

func (c *Client) ExportJob(id string, format string) (s string, e error)

ExportJob exports a job

func (*Client) FindJobByName

func (c *Client) FindJobByName(name string, project string) (*JobDetails, error)

FindJobByName runs a job by name

func (*Client) Get

func (rc *Client) Get(i *[]byte, path string, options interface{}) error

Get performs an authenticated HTTP GET

func (*Client) GetExecution

func (c *Client) GetExecution(executionID string) (exec Execution, err error)

GetExecution returns the details of a job execution

func (*Client) GetExecutionOutput

func (c *Client) GetExecutionOutput(executionID string) (ExecutionOutput, error)

GetExecutionOutput returns the output of an execution

func (*Client) GetExecutionState

func (c *Client) GetExecutionState(executionID string) (ExecutionState, error)

GetExecutionState returns the state of an execution

func (*Client) GetHistory

func (c *Client) GetHistory(project string) (Events, error)

GetHistory returns the history for a project

func (*Client) GetJob

func (c *Client) GetJob(id string) (JobList, error)

GetJob gets a job

func (*Client) GetJobinfo

func (c *Client) GetJobinfo(id string) (JobInfo, error)

GetJobinfo gets a jobs detail

func (*Client) GetLogstorage

func (c *Client) GetLogstorage() (data LogStorage, err error)

GetLogstorage gets the logstorage

func (*Client) GetProject

func (c *Client) GetProject(name string) (p Project, err error)

GetProject gets a project by name

func (*Client) GetRequiredOpts

func (c *Client) GetRequiredOpts(j string) (map[string]string, error)

GetRequiredOpts returns the required options for a job

func (*Client) GetSystemACLPolicies

func (c *Client) GetSystemACLPolicies() (data ACLPolicies, err error)

GetSystemACLPolicies gets the system ACL Policies

func (*Client) GetToken

func (c *Client) GetToken(tokenID string) (data Token, err error)

GetToken gets a token

func (*Client) GetTokens

func (c *Client) GetTokens() (data Tokens, err error)

GetTokens gets all tokens

func (*Client) GetUserTokens

func (c *Client) GetUserTokens(user string) (data Tokens, err error)

GetUserTokens gets the api tokens for a user

func (*Client) ImportJob

func (c *Client) ImportJob(j ImportParams) (string, error)

ImportJob imports a job

func (*Client) ListJobs

func (c *Client) ListJobs(projectID string) (Jobs, error)

ListJobs lists the jobs for a project

func (*Client) ListNodes

func (c *Client) ListNodes(projectID string) (Nodes, error)

ListNodes lists nodes

func (*Client) ListProjectExecutions

func (c *Client) ListProjectExecutions(projectID string, options map[string]string) (Executions, error)

ListProjectExecutions lists a projects executions

func (*Client) ListProjects

func (c *Client) ListProjects() (data Projects, err error)

ListProjects lists all projects

func (*Client) ListRunningExecutions

func (c *Client) ListRunningExecutions(projectID string) (executions Executions, err error)

ListRunningExecutions lists running executions

func (*Client) MakeProject

func (c *Client) MakeProject(p NewProject) error

MakeProject makes a project

func (*Client) Post

func (rc *Client) Post(i *[]byte, path string, data []byte, options interface{}) error

Post performs an authenticated HTTP POST

func (*Client) Put

func (rc *Client) Put(i *[]byte, path string, data []byte, options interface{}) error

Put performs an authenticated HTTP Put

func (*Client) RunAdhoc

func (c *Client) RunAdhoc(projectID string, exec string, nodeFilter string) (ExecutionID, error)

RunAdhoc runs an adhoc job

func (*Client) RunJob

func (c *Client) RunJob(id string, options RunOptions) (Executions, error)

RunJob runs a job

type ClientConfig

type ClientConfig struct {
	BaseURL    string
	Token      string
	VerifySSL  bool
	Username   string
	Password   string
	AuthMethod string
	APIVersion string
	Transport  *http.Transport
	HTTPClient *http.Client
}

ClientConfig represents a client configuration

type ConfigProperty

type ConfigProperty struct {
	XMLName xml.Name `xml:"property"`
	Key     string   `xml:"key,attr"`
	Value   string   `xml:"value,attr"`
}

ConfigProperty is a configuration property

type Contents

type Contents struct {
	XMLName   xml.Name   `xml:"contents"`
	Count     int64      `xml:"count"`
	Resources []Resource `xml:"resource"`
}

Contents represents contents

type Error

type Error struct {
	XMLName    xml.Name `xml:"result"`
	Error      bool     `xml:"error,attr"`
	APIVersion string   `xml:"apiversion,attr"`
	Message    string   `xml:"error>message"`
}

Error represents a rundeck xml error

type Event

type Event struct {
	XMLName     xml.Name `xml:"event"`
	StartTime   string   `xml:"starttime,attr"`
	EndTime     string   `xml:"endtime,attr"`
	Title       string   `xml:"title"`
	Status      string   `xml:"status"`
	Summary     string   `xml:"summary"`
	NodeSummary struct {
		XMLName   xml.Name
		Succeeded int64 `xml:"succeeded,attr"`
		Failed    int64 `xml:"failed,attr"`
		Total     int64 `xml:"total,attr"`
	} `xml:"node-summary"`
	User        string `xml:"user"`
	Project     string `xml:"project"`
	DateStarted string `xml:"date-started"`
	DateEnded   string `xml:"date-ended"`
	AbortedBy   string `xml:"abortedby,omitempty"`
	Job         *struct {
		XMLName xml.Name
		ID      string `xml:"id,attr"`
	} `xml:"job,omitempty"`
	Execution struct {
		XMLName xml.Name
		ID      int64 `xml:"id,attr"`
	} `xml:"execution,omitempty"`
}

Event represents an Event

type Events

type Events struct {
	XMLName xml.Name `xml:"events"`
	Count   int64    `xml:"count,attr"`
	Total   int64    `xml:"total,attr"`
	Max     int64    `xml:"max,attr"`
	Offset  int64    `xml:"offset,attr"`
	Events  []Event  `xml:"event"`
}

Events represents a collection of `Event`

type ExecStep

type ExecStep struct {
	XMLName xml.Name
	// contains filtered or unexported fields
}

ExecStep represents an exec step

type Execution

type Execution struct {
	XMLName         xml.Name `xml:"execution"`
	ID              string   `xml:"id,attr"`
	HRef            string   `xml:"href,attr"`
	Status          string   `xml:"status,attr"`
	CustomStatus    string   `xml:"customStatus,omitempty"`
	Project         string   `xml:"project,attr"`
	User            string   `xml:"user"`
	DateEnded       string   `xml:"date-ended,omitempty"`
	UnixTimeEnded   int64    `xml:"date-ended,unixtime,attr,omitempty"`
	DateStarted     string   `xml:"date-started,omitempty"`
	UnixTimeStarted int64    `xml:"date-started,unixtime,attr,omitempty"`
	Job             *Job     `xml:"job"`
	Description     string   `xml:"description,omitempty"`
	SuccessfulNodes Nodes    `xml:"successfulNodes,omitempty"`
	FailedNodes     Nodes    `xml:"failedNodes,omitempty"`
}

Execution represents a job execution

type ExecutionDateTime

type ExecutionDateTime struct {
	UnixTime int64 `xml:"unixtime,attr"`
}

ExecutionDateTime represents an execution timestamp in unixtime format

type ExecutionID

type ExecutionID struct {
	ID string `xml:"id,attr"`
}

ExecutionID represents an execution id

type ExecutionOutput

type ExecutionOutput struct {
	XMLName        xml.Name               `xml:"output"`
	ID             int64                  `xml:"id"`
	Offset         int64                  `xml:"offset"`
	Completed      bool                   `xml:"completed"`
	ExecCompleted  bool                   `xml:"execCompleted"`
	HasFailedNodes bool                   `xml:"hasFailedNodes"`
	ExecState      string                 `xml:"execState"`
	LastModified   ExecutionDateTime      `xml:"lastModified"`
	ExecDuration   int64                  `xml:"execDuration"`
	TotalSize      int64                  `xml:"totalSize"`
	Entries        ExecutionOutputEntries `xml:"entries"`
}

ExecutionOutput represents the output of an execution

type ExecutionOutputEntries

type ExecutionOutputEntries struct {
	Entry []ExecutionOutputEntry `xml:"entry"`
}

ExecutionOutputEntries is a collection of `ExecutionOutputEntry`

type ExecutionOutputEntry

type ExecutionOutputEntry struct {
	XMLName      xml.Name
	Time         string `xml:"time,attr"`
	AbsoluteTime string `xml:"absolute_time,attr"`
	Log          string `xml:"log,attr"`
	Level        string `xml:"level,attr"`
	User         string `xml:"user,attr"`
	Command      string `xml:"command,attr"`
	Stepctx      string `xml:"stepctx,attr"`
	Node         string `xml:"node,attr"`
}

ExecutionOutputEntry represents a single execution output entry

type ExecutionState

type ExecutionState struct {
	XMLName     xml.Name        `xml:"result"`
	Success     bool            `xml:"success,attr"`
	APIVersion  int64           `xml:"apiversion,attr"`
	StartTime   string          `xml:"executionState>startTime"`
	StepCount   int64           `xml:"executionState>stepCount"`
	AllNodes    []Node          `xml:"executionState>allNodes>nodes>node,omitempty"`
	TargetNodes []Node          `xml:"executionState>targetNodes>nodes>node,omitempty"`
	ExecutionID int64           `xml:"executionState>executionId"`
	Completed   bool            `xml:"executionState>completed"`
	UpdateTime  string          `xml:"executionState>updateTime,omitempty"`
	Steps       []ExecutionStep `xml:"executionState>steps>step,omitempty"`
	Nodes       []NodeWithSteps `xml:"executionState>nodes>node"`
}

ExecutionState represents an execution state

type ExecutionStep

type ExecutionStep struct {
	XMLName        xml.Name    `xml:"step"`
	StepCtx        int64       `xml:"stepctx,attr"`
	ID             int64       `xml:"id,attr"`
	StartTime      string      `xml:"startTime"`
	UpdateTime     string      `xml:"updateTime"`
	EndTime        string      `xml:"endTime"`
	ExecutionState string      `xml:"executionState"`
	NodeStep       bool        `xml:"nodeStep"`
	NodeStates     []NodeState `xml:"nodeStates>nodeState"`
}

ExecutionStep represents an execution step

type Executions

type Executions struct {
	Count      int64       `xml:"count,attr"`
	Total      int64       `xml:"total,attr"`
	Max        int64       `xml:"max,attr"`
	Offset     int64       `xml:"offset,attr"`
	Executions []Execution `xml:"execution"`
}

Executions represents a collection of `Execution`

type ExecutionsDeleted

type ExecutionsDeleted struct {
	XMLName       xml.Name `xml:"deleteExecutions"`
	RequestCount  int64    `xml:"requestCount,attr"`
	AllSuccessful bool     `xml:"allSuccessful,attr"`
	Successful    struct {
		XMLName xml.Name `xml:"successful"`
		Count   int64    `xml:"count,attr"`
	} `xml:"successful"`
	Failed struct {
		XMLName  xml.Name                `xml:"failed"`
		Count    int64                   `xml:"count,attr"`
		Failures []FailedExecutionDelete `xml:"execution,omitempty"`
	} `xml:"failed"`
}

ExecutionsDeleted represents a deleted Executions

type FailedExecutionDelete

type FailedExecutionDelete struct {
	XMLName xml.Name `xml:"execution"`
	ID      int64    `xml:"id,attr"`
	Message string   `xml:"message,attr"`
}

FailedExecutionDelete represents a failed execution delete

type ImportParams

type ImportParams struct {
	Filename string
	Format   string
	Dupe     string
	UUID     string
	Project  string
}

ImportParams represents the params for importing a job

type JVM

type JVM struct {
	Name                  string `xml:"name"`
	Vendor                string `xml:"vendor"`
	Version               string `xml:"version"`
	ImplementationVersion string `xml:"implementationVersion"`
}

JVM represents the JVM details

type Job

type Job struct {
	XMLName     xml.Name `xml:"job"`
	ID          string   `xml:"id,attr"`
	Name        string   `xml:"name"`
	Group       string   `xml:"group"`
	Project     string   `xml:"project"`
	Description string   `xml:"description,omitempty"`
	// These two come from Execution output
	AverageDuration int64   `xml:"averageDuration,attr,omitempty"`
	Options         Options `xml:"options,omitempty"`
	// These four come from Import output (depending on success,error,skipped)
	Index int    `xml:"index,attr,omitempty"`
	Href  string `xml:"href,attr,omitempty"`
	Error string `xml:"error,omitempty"`
	URL   string `xml:"url,omitempty"`
}

Job represents a rundeck job

type JobContext

type JobContext struct {
	XMLName xml.Name     `xml:"context"`
	Project string       `xml:"project"`
	Options *[]JobOption `xml:"options>option,omitempty"`
}

JobContext represents the context of a job

type JobDetails

type JobDetails struct {
	ID                string          `xml:"id"`
	Name              string          `xml:"name"`
	LogLevel          string          `xml:"loglevel"`
	Description       string          `xml:"description,omitempty"`
	UUID              string          `xml:"uuid"`
	Group             string          `xml:"group"`
	Context           JobContext      `xml:"context"`
	Notification      JobNotification `xml:"notification"`
	MultipleExections bool            `xml:"multipleExecutions"`
	Dispatch          JobDispatch     `xml:"dispatch"`
	NodeFilters       struct {
		Filter []string `xml:"filter"`
	} `xml:"nodefilters"`
	Sequence JobSequence `xml:"sequence"`
}

JobDetails represents the details of a `Job`

type JobDispatch

type JobDispatch struct {
	XMLName           xml.Name `xml:"dispatch"`
	ThreadCount       int64    `xml:"threadcount"`
	KeepGoing         bool     `xml:"keepgoing"`
	ExcludePrecedence bool     `xml:"excludePrecendence"`
	RankOrder         string   `xml:"rankOrder"`
}

JobDispatch represents a job dispatch

type JobImportResult

type JobImportResult struct {
	XMLName    xml.Name `xml:"result"`
	Success    bool     `xml:"success,attr,omitempty"`
	Error      bool     `xml:"error,attr,omitempty"`
	APIVersion int64    `xml:"apiversion,attr"`
	Succeeded  struct {
		XMLName xml.Name             `xml:"succeeded"`
		Count   int64                `xml:"count,attr"`
		Jobs    []JobImportResultJob `xml:"job,omitempty"`
	} `xml:"succeeded,omitempty"`
	Failed struct {
		XMLName xml.Name             `xml:"failed"`
		Count   int64                `xml:"count,attr"`
		Jobs    []JobImportResultJob `xml:"job,omitempty"`
	} `xml:"failed,omitempty"`
	Skipped struct {
		XMLName xml.Name             `xml:"skipped"`
		Count   int64                `xml:"count,attr"`
		Jobs    []JobImportResultJob `xml:"job,omitempty"`
	} `xml:"skipped,omitempty"`
}

JobImportResult represents an imported job result

type JobImportResultJob

type JobImportResultJob struct {
	XMLName xml.Name `xml:"job"`
	ID      string   `xml:"id,omitempty"`
	Name    string   `xml:"name"`
	Group   string   `xml:"group"`
	Project string   `xml:"project"`
	Index   int      `xml:"index,attr,omitempty"`
	Href    string   `xml:"href,attr,omitempty"`
	Error   string   `xml:"error,omitempty"`
	URL     string   `xml:"url,omitempty"`
}

JobImportResultJob represents an imported job

type JobInfo

type JobInfo struct {
	XMLName         xml.Name `xml:"job"`
	ID              string   `xml:"id,attr"`
	Href            string   `xml:"href,attr,omitempty"`
	Permalink       string   `xml:"permalink,attr,omitempty"`
	Scheduled       bool     `xml:"scheduled,attr,omitempty"`
	ScheduleEnabled bool     `xml:"scheduleEnabled,attr,omitempty"`
	Enabled         bool     `xml:"enabled,attr,omitempty"`
	AverageDuration int64    `xml:"averageDuration,attr,omitempty"`
	Name            string   `xml:"name,omitempty"`
	Group           string   `xml:"group,omitempty"`
	Project         string   `xml:"project,omitempty"`
	Description     string   `xml:"description,omitempty"`
}

JobInfo represents a rundeck jobinfo

type JobList

type JobList struct {
	XMLName xml.Name   `xml:"joblist"`
	Job     JobDetails `xml:"job"`
}

JobList represents a list of `Job`

type JobNotification

type JobNotification struct {
	XMLName   xml.Name   `xml:"notification"`
	OnStart   JobPlugins `xml:"onstart,omitempty"`
	OnSuccess JobPlugins `xml:"onsuccess,omitempty"`
	OnFailure JobPlugins `xml:"onfailure,omitempty"`
}

JobNotification represents a job notification

type JobNotifications

type JobNotifications struct {
	Notifications []JobNotification `xml:"notification,omitempty"`
}

JobNotifications is a collection of `JobNotification`

type JobOption

type JobOption struct {
	XMLName      xml.Name `xml:"option"`
	Name         string   `xml:"name,attr"`
	Required     bool     `xml:"required,attr,omitempty"`
	Secure       bool     `xml:"secure,attr,omitempty"`
	ValueExposed bool     `xml:"valueExposed,attr,omitempty"`
	DefaultValue string   `xml:"value,attr,omitempty"`
	Description  string   `xml:"description,omitempty"`
}

JobOption is a single option for a job

type JobOptions

type JobOptions struct {
	XMLName xml.Name
	Options []JobOption `xml:"option"`
}

JobOptions is a collection of `JobOption`

type JobPlugin

type JobPlugin struct {
	XMLName       xml.Name               `xml:"plugin"`
	PluginType    string                 `xml:"type,attr"`
	Configuration JobPluginConfiguration `xml:"configuration,omitempty"`
}

JobPlugin represents a job plugin

type JobPluginConfiguration

type JobPluginConfiguration struct {
	XMLName xml.Name                      `xml:"configuration"`
	Entries []JobPluginConfigurationEntry `xml:"entry,omitempty"`
}

JobPluginConfiguration represents the configuration for a job plugin

type JobPluginConfigurationEntry

type JobPluginConfigurationEntry struct {
	Key   string `xml:"key,attr"`
	Value string `xml:"value,attr,omitempty"`
}

JobPluginConfigurationEntry is an entry for a job plugin configuration

type JobPlugins

type JobPlugins struct {
	Plugins []JobPlugin `xml:"plugin,omitempty"`
}

JobPlugins is a collection on `JobPlugin`

type JobRefStep

type JobRefStep struct {
	XMLName  xml.Name
	Name     string `xml:"name,attr,omitempty"`
	Group    string `xml:"group,attr,omitempty"`
	NodeStep bool   `xml:"nodeStep,attr,omitempty"`
}

JobRefStep represents a job reference step

type JobSequence

type JobSequence struct {
	XMLName   xml.Name
	KeepGoing bool           `xml:"keepgoing,attr"`
	Strategy  string         `xml:"strategy,attr"`
	Steps     []SequenceStep `xml:"command"`
}

JobSequence represents a job sequence

type Jobs

type Jobs struct {
	XMLName xml.Name
	Count   int64 `xml:"count,attr"`
	Jobs    []Job `xml:"job"`
}

Jobs is a collection of `Job`

type LogStorage

type LogStorage struct {
	XMLName         xml.Name `xml:"logStorage"`
	Enabled         bool     `xml:"enabled,attr"`
	PluginName      string   `xml:"pluginName,attr"`
	SucceededCount  int64    `xml:"succeededCount"`
	FailedCount     int64    `xml:"failedCount"`
	QueuedCount     int64    `xml:"queuedCount"`
	TotalCount      int64    `xml:"TotalCount"`
	IncompleteCount int64    `xml:"incompleteCount"`
	MissingCount    int64    `xml:"missingCount"`
}

LogStorage represents log storage

type Memory

type Memory struct {
	XMLName xml.Name `xml:"memory"`
	Unit    string   `xml:"unit,attr"`
	Max     int64    `xml:"max"`
	Free    int64    `xml:"free"`
	Total   int64    `xml:"total"`
}

Memory represents memory stats

type Metrics

type Metrics struct {
	XMLName     xml.Name `xml:"metrics"`
	Href        string   `xml:"href,attr"`
	ContentType string   `xml:"contentType,attr"`
}

Metrics represents rundeck's internal metrics

type NewProject

type NewProject struct {
	XMLName     xml.Name         `xml:"project"`
	Name        string           `xml:"name"`
	Description string           `xml:"description"`
	Config      []ConfigProperty `xml:"config>property,omitempty"`
}

NewProject represents a new project

type Node

type Node struct {
	XMLName     xml.Name `xml:"node"`
	Name        string   `xml:"name,attr"`
	Description string   `xml:"description,attr,omitempty"`
	Tags        string   `xml:"tags,attr,omitempty"`
	Hostname    string   `xml:"hostname,attr,omitempty"`
	OsArch      string   `xml:"osArch,attr,omitempty"`
	OsFamily    string   `xml:"osFamily,attr,omitempty"`
	OsName      string   `xml:"osName,attr,omitempty"`
	OsVersion   string   `xml:"osVersion,attr,omitempty"`
	Username    string   `xml:"username,attr,omitempty"`
}

Node represents a node TODO: Convert to a Basic Node that just has "name,attr"

type NodeState

type NodeState struct {
	XMLName        xml.Name `xml:"nodeState"`
	Name           string   `xml:"name,attr"`
	StartTime      string   `xml:"startTime"`
	UpdateTime     string   `xml:"updateTime"`
	EndTime        string   `xml:"endTime"`
	ExecutionState string   `xml:"executionState"`
}

NodeState represents a node's state

type NodeStep

type NodeStep struct {
	XMLName        xml.Name `xml:"step"`
	StepCtx        int64    `xml:"stepctx"`
	ExecutionState string   `xml:"executionState"`
}

NodeStep represents a node step

type NodeWithSteps

type NodeWithSteps struct {
	XMLName xml.Name   `xml:"node"`
	Name    string     `xml:"name,attr"`
	Steps   []NodeStep `xml:"steps>step"`
}

NodeWithSteps represents a node with its steps

type Nodes

type Nodes struct {
	Nodes []Node `xml:"node"`
}

Nodes is a collection of `Node`

type OS

type OS struct {
	Arch    string `xml:"arch"`
	Name    string `xml:"name"`
	Version string `xml:"version"`
}

OS represents the OS details

type Option

type Option struct {
	XMLName xml.Name `xml:"option"`
	Name    string   `xml:"name,attr"`
	Value   string   `xml:"value,attr,omitempty"`
}

Option represents an xml option

type Options

type Options struct {
	XMLName xml.Name
	Options []Option `xml:"option"`
}

Options represents a group of xml `Option`

type PluginStep

type PluginStep struct {
	XMLName       xml.Name
	Type          string `xml:"type,attr"`
	Configuration []struct {
		XMLName xml.Name `xml:"entry"`
		Key     string   `xml:"key,attr"`
		Value   string   `xml:"value,attr"`
	} `xml:"configuration>entry,omitempty"`
}

PluginStep represents a plugin step

type Project

type Project struct {
	XMLName     xml.Name `xml:"project"`
	Name        string   `xml:"name"`
	Description string   `xml:"description,omitempty"`
	URL         string   `xml:"url,attr"`
}

Project represents a project

type Projects

type Projects struct {
	Count    int64     `xml:"count,attr"`
	Projects []Project `xml:"project"`
}

Projects is a collection of `Project`

type Resource

type Resource struct {
	XMLName      xml.Name     `xml:"resource"`
	Path         string       `xml:"path,attr"`
	ResourceType string       `xml:"type,attr"`
	URL          string       `xml:"url,attr"`
	Name         string       `xml:"name,omitempty"`
	MetaData     ResourceMeta `xml:"resource-meta,omitempty"`
	Contents     Contents     `xml:"contents,omitempty"`
}

Resource represents a resource

type ResourceMeta

type ResourceMeta struct {
	XMLName             xml.Name `xml:"resource-meta"`
	ContentType         string   `xml:"Rundeck-content-type"`
	Size                int64    `xml:"Rundeck-content-size"`
	CreationTime        string   `xml:"Rundeck-content-creation-time"`
	ModifyTime          string   `xml:"Rundeck-content-modify-time"`
	AuthCreatedUsername string   `xml:"Rundeck-auth-created-username"`
	KeyType             string   `xml:"Rundeck-key-type"`
}

ResourceMeta represents resource metadata

type Resources

type Resources struct {
	Resources []Resource `xml:"resource"`
}

Resources is a collection of `Resource`

type Result

type Result struct {
	XMLName         xml.Name `xml:"result"`
	Succeeded       bool     `xml:"success,attr,omitempty"`
	Errored         bool     `xml:"error,attr,omitempty"`
	APIVersion      string   `xml:"apiversion,attr,omitempty"`
	SuccessMessages []string `xml:"success>message,omitempty"`
	ErrorMessages   []string `xml:"error>message,omitempty"`
}

Result represents an XML result

type RunOptions

type RunOptions struct {
	LogLevel string `json:"loglevel,omitempty"`
	AsUser   string `json:"asUser,omitempty"`
	Filter   string `json:"filter,omitempty"`

	RunAtTime time.Time         `json:"-"`
	Options   map[string]string `json:"options,omitempty"`
	// backwards compatibility for now
	Arguments string `json:"argString,omitempty"`
	// contains filtered or unexported fields
}

RunOptions represents the options for a job

type Rundeck

type Rundeck struct {
	XMLName    xml.Name `xml:"rundeck"`
	Version    string   `xml:"version"`
	APIVersion int64    `xml:"apiversion"`
	Build      string   `xml:"build"`
	Node       string   `xml:"node"`
	Base       string   `xml:"base"`
	ServerUUID string   `xml:"serverUUID,omitempty"`
}

Rundeck represents the rundeck server itself

type Scheduler

type Scheduler struct {
	Running int64 `xml:"running"`
}

Scheduler represents the scheduler

type ScriptStep

type ScriptStep struct {
	XMLName           xml.Name
	Script            *string `xml:"script,omitempty"`
	ScriptArgs        *string `xml:"scriptargs,omitempty"`
	ScriptFile        *string `xml:"scriptfile,omitempty"`
	ScriptURL         *string `xml:"scripturl,omitempty"`
	ScriptInterpreter *string `xml:"scriptinterpreter,omitempty"`
}

ScriptStep represents a script step

type SequenceStep

type SequenceStep struct {
	XMLName        xml.Name
	Description    string      `xml:"description,omitempty"`
	JobRef         *JobRefStep `xml:"jobref,omitempty"`
	NodeStepPlugin *PluginStep `xml:"node-step-plugin,omitempty"`
	StepPlugin     *PluginStep `xml:"step-plugin,omitempty"`
	Exec           *string     `xml:"exec,omitempty"`
	*ScriptStep    `xml:",omitempty"`
}

SequenceStep represents a sequence step

type Stats

type Stats struct {
	XMLName   xml.Name  `xml:"stats"`
	Uptime    Uptime    `xml:"uptime"`
	CPU       CPU       `xml:"cpu"`
	Memory    Memory    `xml:"memory"`
	Scheduler Scheduler `xml:"scheduler"`
	Threads   Threads   `xml:"threads"`
}

Stats represents the stats

type SystemInfo

type SystemInfo struct {
	XMLName    xml.Name   `xml:"system"`
	Timestamp  TS         `xml:"timestamp"`
	Rundeck    Rundeck    `xml:"rundeck"`
	OS         OS         `xml:"os"`
	JVM        JVM        `xml:"jvm"`
	Stats      Stats      `xml:"stats"`
	Metrics    Metrics    `xml:"metrics"`
	ThreadDump ThreadDump `xml:"threadDump"`
}

SystemInfo represents the rundeck system information

type TS

type TS struct {
	Epoch    string `xml:"epoch,attr"`
	Unit     string `xml:"unit,attr"`
	DateTime string `xml:"datetime"`
}

TS represents a timestamp

type ThreadDump

type ThreadDump struct {
	XMLName     xml.Name `xml:"threadDump"`
	Href        string   `xml:"href,attr"`
	ContentType string   `xml:"contentType,attr"`
}

ThreadDump is a thread dump

type Threads

type Threads struct {
	Active int64 `xml:"active"`
}

Threads represents the number of active threads

type Token

type Token struct {
	XMLName xml.Name `xml:"token"`
	ID      string   `xml:"id,attr"`
	User    string   `xml:"user,attr"`
}

Token represents a user and token

type Tokens

type Tokens struct {
	XMLName  xml.Name `xml:"tokens"`
	Count    int64    `xml:"count,attr"`
	AllUsers *bool    `xml:"allusers,omitempty"`
	User     *string  `xml:"user,attr"`
	Tokens   []*Token `xml:"token"`
}

Tokens is a collection of `Token`

type Uptime

type Uptime struct {
	XMLName  xml.Name `xml:"uptime"`
	Duration string   `xml:"duration,attr"`
	Unit     string   `xml:"unit,attr"`
	Since    struct {
		XMLName  xml.Name
		TS       `xml:"since"`
		DateTime string `xml:"datetime"`
	} `xml:"since"`
}

Uptime represents Uptime

Jump to

Keyboard shortcuts

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