Documentation
¶
Index ¶
- Constants
- type ACL
- type ACLResource
- type Abort
- type AbortExecutionResponse
- type AbortState
- type AdhocAPI
- type AdhocCommandResponse
- type AdhocCommandStringInput
- type AdhocOptions
- type AdhocScriptInput
- type AdhocScriptOptions
- type AdhocURLInput
- type ArchiveExportAsyncStatusResponse
- type ArchiveExportInput
- type ArchiveImportInput
- type ArchiveImportResponse
- type Boolean
- type BulkModifyInput
- type BulkModifyObject
- type BulkModifyResponse
- type CPUStats
- type Client
- func (c *Client) ACL() *ACL
- func (c *Client) Adhoc() *AdhocAPI
- func (c *Client) ClusterScheduler() *ClusterScheduler
- func (c *Client) Executions() *Executions
- func (c *Client) Jobs() *Jobs
- func (c *Client) KeyStorage() *KeyStore
- func (c *Client) LogStore() *LogStore
- func (c *Client) Projects() *Projects
- func (c *Client) SetAPIToken(token string)
- func (c *Client) System() *System
- func (c *Client) Tokens() *Tokens
- func (c *Client) Users() *Users
- type ClusterScheduler
- type Config
- type CreateProjectInput
- type DeleteExecutionsResponse
- type DuplicateOption
- type Error
- type Execution
- type ExecutionMode
- type ExecutionModeResponse
- type ExecutionQueryInput
- type ExecutionState
- type ExecutionStateIndicator
- type ExecutionStateInfo
- type ExecutionStateResponse
- type ExecutionStatus
- type ExecutionStepState
- type ExecutionTimestamp
- type ExecutionType
- type ExecutionWorkflow
- type Executions
- func (e *Executions) Abort(id int, asUser *string) (*AbortExecutionResponse, error)
- func (e *Executions) BulkDelete(ids []int) (*DeleteExecutionsResponse, error)
- func (e *Executions) Delete(id int) error
- func (e *Executions) DeleteExecutions(id int) (*DeleteExecutionsResponse, error)
- func (e *Executions) GetExecutionsForAJob(id int, status *string, paging *PagingInfo) (*ExecutionsResponse, error)
- func (e *Executions) Info(id int) (*Execution, error)
- func (e *Executions) ListInputFiles(id int) (*UploadedFilesResponse, error)
- func (e *Executions) ListRunningExecutions(project string) (*ExecutionsResponse, error)
- func (e *Executions) Output(id int, input *ExecutionsOutputInput) (*ExecutionsOutputResponse, error)
- func (e *Executions) OutputWithState(id int, stateOnly bool) (*ExecutionsOutputResponse, error)
- func (e *Executions) Query(project string, input *ExecutionQueryInput) (*ExecutionsResponse, error)
- func (e *Executions) State(id int) (*ExecutionStateResponse, error)
- type ExecutionsOutputInput
- type ExecutionsOutputResponse
- type ExecutionsResponse
- type ExportJobsInput
- type FileOption
- type FileState
- type HealthCheck
- type ImportJobsInput
- type ImportJobsResponse
- type IncompleteLogStorageResponse
- type JVM
- type Job
- type JobFormat
- type Jobs
- func (j *Jobs) BulkDelete(input *BulkModifyInput) (*BulkModifyResponse, error)
- func (j *Jobs) BulkToggleExecutionsOrSchedules(input *BulkModifyInput, enabled bool, toggleKind ToggleKind) (*BulkModifyResponse, error)
- func (j *Jobs) DeleteDefinition(id string) error
- func (j *Jobs) Export(project string, input *ExportJobsInput) ([]byte, error)
- func (j *Jobs) FileInfo(id string) (*FileOption, error)
- func (j *Jobs) GetDefinition(id string, format *JobFormat) ([]byte, error)
- func (j *Jobs) GetMetadata(id string) (*Job, error)
- func (j *Jobs) Import(project string, input *ImportJobsInput) (*ImportJobsResponse, error)
- func (j *Jobs) List(project string, input *ListJobsInput) ([]*Job, error)
- func (j *Jobs) ListFilesUploadedForJob(id string, fileState *FileState, max *int) (*UploadedFilesResponse, error)
- func (j *Jobs) Retry(jobID string, execID int64, input *RetryJobInput) (*Execution, error)
- func (j *Jobs) Run(jobID string, input *RunJobInput) (*Execution, error)
- func (j *Jobs) ToggleExecutionsOrSchedules(id string, enabled bool, toggleKind ToggleKind) (*SuccessResponse, error)
- func (j *Jobs) UploadFileForJobOption(id, optionName string, content []byte, fileName *string) (*UploadFileResponse, error)
- type KeyMetadata
- type KeyResource
- type KeyStore
- type ListACLsResponse
- type ListJobsInput
- type ListKeysResponse
- type LoadAverageStats
- type LogEntry
- type LogEntryType
- type LogLevel
- type LogStorageMetadata
- type LogStorageStats
- type LogStore
- type MemoryStats
- type Metrics
- type ModifyUserInput
- type NodeEntry
- type NodeEntryAnything
- type OperatingSystem
- type PagingInfo
- type Project
- type ProjectConfigKeyPair
- type ProjectInfo
- type Projects
- func (p *Projects) ArchiveExport(project string, input *ArchiveExportInput) ([]byte, error)
- func (p *Projects) ArchiveExportAsync(project string, input *ArchiveExportInput) (*ArchiveExportAsyncStatusResponse, error)
- func (p *Projects) ArchiveExportAsyncDownload(project, token string) ([]byte, error)
- func (p *Projects) ArchiveExportAsyncStatus(project, token string) (*ArchiveExportAsyncStatusResponse, error)
- func (p *Projects) ArchiveImport(project string, content []byte, input *ArchiveImportInput) (*ArchiveImportResponse, error)
- func (p *Projects) Configuration(project string) (map[string]string, error)
- func (p *Projects) Configure(project string, config map[string]string) (map[string]string, error)
- func (p *Projects) Create(data *CreateProjectInput) (*ProjectInfo, error)
- func (p *Projects) Delete(project string) error
- func (p *Projects) DeleteConfigKey(project, key string) error
- func (p *Projects) GetConfigKey(project, key string) (*ProjectConfigKeyPair, error)
- func (p *Projects) GetInfo(project string) (*ProjectInfo, error)
- func (p *Projects) List() ([]*Project, error)
- func (p *Projects) ListResources(project string, nodeFilters map[string]string) (map[string]*NodeEntry, error)
- func (p *Projects) SetConfigKey(project string, keyPair *ProjectConfigKeyPair) (*ProjectConfigKeyPair, error)
- type ResumedIncompleteLogStorageResponse
- type RetryJobInput
- type RunJobInput
- type Rundeck
- type SchedulerStats
- type Stats
- type Status
- type SuccessResponse
- type System
- type SystemInfo
- type SystemInfoResponse
- type TakeoverJob
- type TakeoverJobInput
- type TakeoverJobs
- type TakeoverSchedule
- type TakeoverScheduleInput
- type TakeoverScheduleResponse
- type TakeoverServer
- type ThreadDump
- type ThreadStats
- type Timestamp
- type ToggleKind
- type Token
- type Tokens
- type UUIDOption
- type UploadFileResponse
- type UploadedFilesResponse
- type UptimeStats
- type UserProfile
- type Users
Constants ¶
const ( // APIVersion24 is defaulted to the specified api version APIVersion24 = 24 // EnvRundeckToken sets the name of the environment variable to read EnvRundeckToken = "RUNDECK_TOKEN" // EnvRundeckServerURL is the name of the environment variable for the server url EnvRundeckServerURL = "RUNDECK_SERVER_URL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct {
// contains filtered or unexported fields
}
ACL in information about API submitted ACLs, not hard-disk ACLs
func (*ACL) Get ¶
Get retrieves the YAML text of the ACL Policy file. The contents of the file as a []byte will be returned.
func (*ACL) List ¶
func (a *ACL) List() (*ListACLsResponse, error)
List returns an overview of the API submitted ACLs
type ACLResource ¶
type ACLResource struct { Path string `json:"path"` Type string `json:"type"` Name string `json:"name"` HREF string `json:"href"` }
ACLResource is an element in the resources portion of the ListACLsReponse payload.
type Abort ¶
type Abort struct { Status AbortState `json:"status"` Reason string `json:"reason"` }
Abort contains the state and reason for the abort
type AbortExecutionResponse ¶
type AbortExecutionResponse struct { Abort Abort `json:"abort"` Execution Execution `json:"execution"` }
AbortExecutionResponse ...
type AbortState ¶
type AbortState string
AbortState will be one of "pending", "failed", or "aborted"
const ( AbortStatePending AbortState = "pending" AbortStateFailed AbortState = "failed" AbortStateAborted AbortState = "aborted" )
type AdhocAPI ¶
type AdhocAPI struct {
// contains filtered or unexported fields
}
AdhocAPI interacts with the adhoc endpoints
func (*AdhocAPI) RunCommandString ¶
func (a *AdhocAPI) RunCommandString(input *AdhocCommandStringInput) (*AdhocCommandResponse, error)
RunCommandString runs an adhoc command
func (*AdhocAPI) RunScript ¶
func (a *AdhocAPI) RunScript(input *AdhocScriptInput) (*AdhocCommandResponse, error)
RunScript runs a script
func (*AdhocAPI) RunURL ¶
func (a *AdhocAPI) RunURL(input *AdhocURLInput) (*AdhocCommandResponse, error)
RunURL runs a script downloaded from a url
type AdhocCommandResponse ¶
type AdhocCommandResponse struct { Message string `json:"message"` Execution Execution `json:"execution"` }
AdhocCommandResponse ...
type AdhocCommandStringInput ¶
type AdhocCommandStringInput struct { Exec string `json:"exec"` AdhocOptions }
AdhocCommandStringInput ...
type AdhocOptions ¶
type AdhocScriptInput ¶
type AdhocScriptInput struct { Script string `json:"script"` AdhocOptions AdhocScriptOptions }
AdhocScriptInput ...
type AdhocScriptOptions ¶
type AdhocURLInput ¶
type AdhocURLInput struct { URL string `json:"url"` AdhocOptions AdhocScriptOptions }
AdhocURLInput ...
type ArchiveExportAsyncStatusResponse ¶
type ArchiveExportAsyncStatusResponse struct { Token string `json:"token"` Ready bool `json:"ready"` Percentage int `json:"int"` }
ArchiveExportAsyncStatusResponse struct
type ArchiveExportInput ¶
type ArchiveExportInput struct { ExecutionIDs []int ExportAll bool ExportJobs bool ExportExecutions bool ExportConfigs bool ExportReadmes bool ExportAcls bool }
ArchiveExportInput ...
type ArchiveImportInput ¶
type ArchiveImportInput struct { JobUUIDOption UUIDOption ImportExecutions bool ImportConfig bool ImportACL bool }
ArchiveImportInput are option parameters for importing a project archive
type ArchiveImportResponse ¶
type ArchiveImportResponse struct { ImportStatus Status `json:"import_status"` Errors []string `json:"errors"` ExecutionErrors []string `json:"execution_errors"` ACLErrors []string `json:"acl_errors"` }
ArchiveImportResponse ...
type BulkModifyInput ¶
type BulkModifyInput struct {
IDs []string `json:"ids"`
}
BulkModifyInput contains a string slice of ids to modify in bulk
type BulkModifyObject ¶
type BulkModifyObject struct { ID string `json:"id"` ErrorCode string `json:"errorCode"` Message string `json:"message"` }
BulkModifyObject is an object in the BulkModifyResponse slices
type BulkModifyResponse ¶
type BulkModifyResponse struct { RequestCount int `json:"requestCount"` AllSuccessful bool `json:"allsuccessful"` Enabled bool `json:"enabled,omitempty"` Succeeded []*BulkModifyObject `json:"successful,omitempty"` Failed []*BulkModifyObject `json:"failed,omitempty"` }
BulkModifyResponse is the response body from the bulk modify endpoint
type CPUStats ¶
type CPUStats struct { LoadAverage LoadAverageStats `json:"loadAverage"` Processors int `json:"processors"` }
CPUStats are basic stats about the CPU usage
type Client ¶
Client is the basic client that interacts with the Rundeck API.
func NewClient ¶
NewClient returns a rundeck client
If config is nil, then the configuration from DefaultConfig() will be used. DefaultConfig() assumes that the environment variable RUNDECK_TOKEN is set, and that its value is a valid Rundeck API token.
func (*Client) ClusterScheduler ¶
func (c *Client) ClusterScheduler() *ClusterScheduler
ClusterScheduler interacts with the cluster endpoints on Rundeck
func (*Client) Executions ¶
func (c *Client) Executions() *Executions
Executions interacts with endpoints pertaining to executions
func (*Client) KeyStorage ¶
KeyStorage returns a keystore for use
func (*Client) SetAPIToken ¶
SetAPIToken will update the token (and associated client transport for the API calls)
type ClusterScheduler ¶
type ClusterScheduler struct {
// contains filtered or unexported fields
}
ClusterScheduler contains information relating to cluster mode in Rundeck
func (*ClusterScheduler) ListScheduledJobs ¶
func (cs *ClusterScheduler) ListScheduledJobs(uuid *string) ([]*Job, error)
ListScheduledJobs lists scheduled jobs with the schedule owned by the server with the specified uuid. If uuid is nil, then the client server will be used.
func (*ClusterScheduler) TakeoverSchedule ¶
func (cs *ClusterScheduler) TakeoverSchedule(input *TakeoverScheduleInput) (*TakeoverScheduleResponse, error)
TakeoverSchedule tells the Rundeck server in cluster mode to claim scheduled jobs from another cluster server
type Config ¶
type Config struct { // ServerURL is expected in the given format, ie: http://localhost:4440, or https://my.rundeck.com. ServerURL string // APIVersion is the version of the api you want to use. APIVersion int // RundeckAuthToken is the authentication token used to communicate with Rundeck RundeckAuthToken string }
Config is the basic configuration needed by the client to communicate with Rundeck
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig implements a localhost basic configuration, relying on and assuming a valid api token set in the environment variable RUNDECK_TOKEN.
The environment variable RUNDECK_SERVER_URL will be used if it is present, otherwise http://localhost:4440 will be used as the server url.
type CreateProjectInput ¶
type CreateProjectInput struct { Name string `json:"name"` Description string `json:"description,omitempty"` Config map[string]string `json:"config,omitempty"` }
CreateProjectInput is the payload when posting for project creation
type DeleteExecutionsResponse ¶
type DeleteExecutionsResponse struct { Failures []struct { ID string `json:"id"` Message string `json:"message"` } `json:"failures"` FailedCount int `json:"failedCount"` SuccessCount int `json:"successCount"` AllSuccessful bool `json:"allsuccessful"` RequestCount int `json:"requestCount"` }
DeleteExecutionsResponse contains information about the success and failures of the delete operation
type DuplicateOption ¶
type DuplicateOption string
DuplicateOption instructs the job importer how to handle duplicate jobs
const ( DuplicateOptionSkip DuplicateOption = "skip" DuplicateOptionCreate DuplicateOption = "create" DuplicateOptionUpdate DuplicateOption = "update" )
type Error ¶
type Error struct { ErrorPresent bool `json:"error"` APIVersion int `json:"apiversion"` ErrorCode string `json:"errorCode"` Message string `json:"message"` }
Error is what Rundeck returns given a bad API call
type Execution ¶
type Execution struct { ID int `json:"id"` HREF string `json:"href"` Permalink string `json:"permalink"` Status ExecutionStatus `json:"status"` CustomStatus string `json:"customStatus"` Project string `json:"project"` User string `json:"user"` ServerUUID string `json:"serverUUID"` DateStarted ExecutionTimestamp `json:"date-started"` DateEnded ExecutionTimestamp `json:"date-ended"` Job Job `json:"job"` Description string `json:"description"` ArgString string `json:"argstring"` Storage LogStorageMetadata `json:"storage"` SuccessfulNodes []string `json:"successfulNodes"` FailedNodes []string `json:"failedNodes"` Errors []string `json:"errors"` }
Execution is information regarding an execution
type ExecutionMode ¶
type ExecutionMode string
ExecutionMode informs the whether or not rundeck can execute jobs
const ( ExecutionModeActive ExecutionMode = "active" ExecutionModePassive ExecutionMode = "passive" )
type ExecutionModeResponse ¶
type ExecutionModeResponse struct { Active bool `json:"active"` ExecutionMode ExecutionMode `json:"executionMode"` }
ExecutionModeResponse is information about the rundeck server's ability to execute jobs
type ExecutionQueryInput ¶
type ExecutionQueryInput struct { PagingInfo Status ExecutionStatus AbortedBy string User string RecentFilter string OlderFilter string Begin *time.Time // unix ms End *time.Time // unix ms AdHoc Boolean JobIDList []string ExcludeJobIDList []string JobList []string ExcludeJobList []string GroupPath string GroupPathExact string ExcludeGroupPath string ExcludeGroupPathExact string JobName string ExcludeJobName string JobNameExact string ExcludeJobNameExact string ExecutionType ExecutionType }
ExecutionQueryInput are parameters to narrow down the result set of a query operation
type ExecutionState ¶
type ExecutionState string
ExecutionState is the state of the execution
const ( ExecutionStateWaiting ExecutionState = "WAITING" ExecutionStateRunning ExecutionState = "RUNNING" ExecutionStateRunningHandler ExecutionState = "RUNNING_HANDLER" ExecutionStateSucceeded ExecutionState = "SUCCEEDED" ExecutionStateFailed ExecutionState = "FAILED" ExecutionStateAborted ExecutionState = "ABORTED" ExecutionStateNodePartialSucceeded ExecutionState = "NODE_PARTIAL_SUCCEEDED" ExecutionStateNodeMixed ExecutionState = "NODE_MIXED" ExecutionStateNotStarted ExecutionState = "NOT_STARTED" )
type ExecutionStateIndicator ¶
type ExecutionStateIndicator struct { ExecutionState ExecutionState `json:"executionState"` StepContextIdentifier string `json:"stepctx"` }
ExecutionStateIndicator ...
type ExecutionStateInfo ¶
type ExecutionStateInfo struct { StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` UpdateTime time.Time `json:"updateTime"` ExecutionState ExecutionState `json:"executionState"` }
ExecutionStateInfo ...
type ExecutionStateResponse ¶
type ExecutionStateResponse struct { ExecutionStateInfo ExecutionWorkflow AllNodes []string `json:"allNodes"` Nodes map[string]ExecutionStateIndicator `json:"nodes"` ServerNode string `json:"serverNode"` ExecutionID int `json:"executionId"` Completed bool `json:"completed"` }
ExecutionStateResponse ...
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus ensure a constant is used in parameters
const ( ExecutionStatusRunning ExecutionStatus = "running" ExecutionStatusSucceeded ExecutionStatus = "succeeded" ExecutionStatusFailed ExecutionStatus = "failed" ExecutionStatusAborted ExecutionStatus = "aborted" ExecutionStatusTimedout ExecutionStatus = "timedout" ExecutionStatusFailedWithRetry ExecutionStatus = "failed-with-retry" ExecutionStatusScheduled ExecutionStatus = "scheduled" ExecutionStatusOther ExecutionStatus = "other" )
type ExecutionStepState ¶
type ExecutionStepState struct { ExecutionStateInfo ID string `json:"id"` StepContextIdentifier string `json:"stepctx"` NodeStep bool `json:"nodeStep"` NodeStates map[string]ExecutionStateInfo `json:"nodeStates"` HasSubworkflow bool `json:"hasSubworkflow"` Workflow ExecutionWorkflow `json:"workflow"` }
ExecutionStepState ...
type ExecutionTimestamp ¶
ExecutionTimestamp is basic time metadata
type ExecutionType ¶
type ExecutionType string
ExecutionType ensure a constant is used in parameters
const ( ExecutionTypeScheduled ExecutionType = "scheduled" ExecutionTypeUser ExecutionType = "user" ExecutionTypeUserScheduled ExecutionType = "user-scheduled" )
type ExecutionWorkflow ¶
type ExecutionWorkflow struct { StepCount int `json:"stepCount"` TargetNodes []string `json:"targetNodes"` Steps []ExecutionStepState `json:"steps"` }
ExecutionWorkflow ...
type Executions ¶
type Executions struct {
// contains filtered or unexported fields
}
Executions is information pertaining to executions API endpoints
func (*Executions) Abort ¶
func (e *Executions) Abort(id int, asUser *string) (*AbortExecutionResponse, error)
Abort aborts a running execution by id
func (*Executions) BulkDelete ¶
func (e *Executions) BulkDelete(ids []int) (*DeleteExecutionsResponse, error)
BulkDelete deletes a set of executions by their ids
func (*Executions) Delete ¶
func (e *Executions) Delete(id int) error
Delete deletes an execution by id
func (*Executions) DeleteExecutions ¶
func (e *Executions) DeleteExecutions(id int) (*DeleteExecutionsResponse, error)
DeleteExecutions deletes all executions for a job
func (*Executions) GetExecutionsForAJob ¶
func (e *Executions) GetExecutionsForAJob(id int, status *string, paging *PagingInfo) (*ExecutionsResponse, error)
GetExecutionsForAJob returns the executions pertaining to a certain job
func (*Executions) Info ¶
func (e *Executions) Info(id int) (*Execution, error)
Info returns information about the specific execution
func (*Executions) ListInputFiles ¶
func (e *Executions) ListInputFiles(id int) (*UploadedFilesResponse, error)
ListInputFiles lists input ifle sused for an execution
func (*Executions) ListRunningExecutions ¶
func (e *Executions) ListRunningExecutions(project string) (*ExecutionsResponse, error)
ListRunningExecutions returns running executions for the specified project ("*" for all projects)
func (*Executions) Output ¶
func (e *Executions) Output(id int, input *ExecutionsOutputInput) (*ExecutionsOutputResponse, error)
Output gets the output for an execution by ID. The execution can be currently running or may have already completed. Output can be filtered down to a specific node or workflow step.
func (*Executions) OutputWithState ¶
func (e *Executions) OutputWithState(id int, stateOnly bool) (*ExecutionsOutputResponse, error)
OutputWithState get the metadata associated with workflow step state changes along with the log output, optionally excluding log output.
func (*Executions) Query ¶
func (e *Executions) Query(project string, input *ExecutionQueryInput) (*ExecutionsResponse, error)
Query queries for executions based on job or execution details
func (*Executions) State ¶
func (e *Executions) State(id int) (*ExecutionStateResponse, error)
State gets detailed about the node and step state of an execution by ID. The execution can be currently running or completed.
type ExecutionsOutputInput ¶
type ExecutionsOutputInput struct { Node string StepContext string Offset int LastLines int LastMod *time.Time Compacted bool }
ExecutionsOutputInput ...
type ExecutionsOutputResponse ¶
type ExecutionsOutputResponse struct { ID string `json:"id"` Message string `json:"message"` Error string `json:"error"` Unmodified bool `json:"unmodified"` Empty bool `json:"empty"` Offset string `json:"offset"` Completed bool `json:"completed"` ExecCompleted bool `json:"execCompleted"` HasFailedNodes bool `json:"hasFailedNodes"` ExecutionState ExecutionState `json:"execState"` LastModified string `json:"lastModified"` ExecDuration int64 `json:"execDuration"` PercentLoaded float32 `json:"percentLoaded"` TotalSize int `json:"totalSize"` // Filter? NodeName StepContext? Compacted bool `json:"compacted"` CompactedAttr string `json:"compactedAttr"` Entries []*LogEntry `json:"entries"` }
ExecutionsOutputResponse ...
type ExecutionsResponse ¶
type ExecutionsResponse struct { PagingInfo `json:"paging"` Executions []*Execution `json:"executions"` }
ExecutionsResponse contains paging information as well as executions
type ExportJobsInput ¶
ExportJobsInput are the optional parameters for the export endpoint
type FileOption ¶
type FileOption struct { ID string `json:"id"` User string `json:"user"` FileState FileState `json:"fileState"` SHA string `json:"sha"` JobID string `json:"jobId"` DateCreated time.Time `json:"dateCreated"` ServerNodeUUID string `json:"serverNodeUUID"` FileName *string `json:"fileName"` Size int64 `json:"size"` ExpirationDate time.Time `json:"expirationDate"` ExecID *int64 `json:"execId"` }
FileOption is the metadata about a file that was uploaded for a job option
type HealthCheck ¶
HealthCheck contains a urll to a page regarding health information
type ImportJobsInput ¶
type ImportJobsInput struct { FileFormat JobFormat DuplicateOption DuplicateOption UUIDOption UUIDOption RawContent []byte }
ImportJobsInput are the parameters for the import endpoint
type ImportJobsResponse ¶
type ImportJobsResponse struct { Succeeded []*Job `json:"succeeded,omitempty"` Failed []*Job `json:"failed,omitempty"` Skipped []*Job `json:"skipped,omitempty"` }
ImportJobsResponse is the response that comes back from importing jobs
type IncompleteLogStorageResponse ¶
type IncompleteLogStorageResponse struct { PagingInfo Executions []*Execution `json:"executions"` }
IncompleteLogStorageResponse is the response from the associated endpoint
type JVM ¶
type JVM struct { Name string `json:"name"` Vendor string `json:"vendor"` Version string `json:"version"` ImplementationVeresion string `json:"implementationVersion"` }
JVM is information about the JVM of Rundeck
type Job ¶
type Job struct { ID string `json:"id,omitempty"` AverageDuration int64 `json:"averageDuration,omitempty"` Name string `json:"name,omitempty"` Group string `json:"group,omitempty"` Project string `json:"project,omitempty"` Description string `json:"description,omitempty"` HREF string `json:"href,omitempty"` Permalink string `json:"permalink,omitempty"` Options map[string]string `json:"options,omitempty"` Scheduled bool `json:"scheduled,omitempty"` ScheduleEnabled bool `json:"scheduleEnabled,omitempty"` Enabled bool `json:"enabled,omitempty"` ServerNodeUUID string `json:"serverNodeUUID,omitempty"` ServerOwner bool `json:"serverOwner,omitempty"` Index int `json:"index,omitempty"` NextScheduledExecution time.Time `json:"nextScheduledExecution,omitempty"` }
Job is information about a Rundeck job
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
Jobs is information pertaining to jobs API endpoints
func (*Jobs) BulkDelete ¶
func (j *Jobs) BulkDelete(input *BulkModifyInput) (*BulkModifyResponse, error)
BulkDelete deletes jobs in bulk by ID
func (*Jobs) BulkToggleExecutionsOrSchedules ¶
func (j *Jobs) BulkToggleExecutionsOrSchedules(input *BulkModifyInput, enabled bool, toggleKind ToggleKind) (*BulkModifyResponse, error)
BulkToggleExecutionsOrSchedules toggles the execution or scheudle value of the suppplied job ids
func (*Jobs) DeleteDefinition ¶
DeleteDefinition deletes a job definition
func (*Jobs) Export ¶
func (j *Jobs) Export(project string, input *ExportJobsInput) ([]byte, error)
Export exports a projects jobs defintions
func (*Jobs) FileInfo ¶
func (j *Jobs) FileInfo(id string) (*FileOption, error)
FileInfo returns information about an uploaded file
func (*Jobs) GetDefinition ¶
GetDefinition returns a job definition as a slice of bytces in either xml or yaml
func (*Jobs) GetMetadata ¶
GetMetadata returns basic information about a job
func (*Jobs) Import ¶
func (j *Jobs) Import(project string, input *ImportJobsInput) (*ImportJobsResponse, error)
Import imports job definitions
func (*Jobs) List ¶
func (j *Jobs) List(project string, input *ListJobsInput) ([]*Job, error)
List returns a list of jobs
func (*Jobs) ListFilesUploadedForJob ¶
func (j *Jobs) ListFilesUploadedForJob(id string, fileState *FileState, max *int) (*UploadedFilesResponse, error)
ListFilesUploadedForJob returns files that were uploaded for a particular job
func (*Jobs) Run ¶
func (j *Jobs) Run(jobID string, input *RunJobInput) (*Execution, error)
Run will execute a job
func (*Jobs) ToggleExecutionsOrSchedules ¶
func (j *Jobs) ToggleExecutionsOrSchedules(id string, enabled bool, toggleKind ToggleKind) (*SuccessResponse, error)
ToggleExecutionsOrSchedules toggles the executions or schedules of the supplied job
func (*Jobs) UploadFileForJobOption ¶
func (j *Jobs) UploadFileForJobOption(id, optionName string, content []byte, fileName *string) (*UploadFileResponse, error)
UploadFileForJobOption uploads a file to rundeck for a job option and returns the file key
type KeyMetadata ¶
type KeyMetadata struct { KeyType string `json:"Rundeck-key-type"` ContentMask string `json:"Rundeck-content-mask"` ContentSize int64 `json:"Rundeck-content-size"` ContentType string `json:"Rundeck-content-type"` }
KeyMetadata ...
type KeyResource ¶
type KeyResource struct { Meta KeyMetadata `json:"meta"` Name string `json:"name"` // contains filtered or unexported fields }
KeyResource ...
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore interacts with the storage facility with regards to keys
func (*KeyStore) KeyMetadata ¶
func (k *KeyStore) KeyMetadata(path, file string) (*KeyMetadata, error)
KeyMetadata returns the metadata about the stored key file
type ListACLsResponse ¶
type ListACLsResponse struct { Path string `json:"path"` Type string `json:"type"` HREF string `json:"href"` Resources []*ACLResource `json:"resources"` }
ListACLsResponse is the response body from the system/acl endpoint
type ListJobsInput ¶
type ListJobsInput struct { IDs []string GroupPath string JobFilter string JobExactFilter string GroupPathExact string ScheduledFilter bool ServerNodeUUIDFilter string }
ListJobsInput adds parameters to the endpoint for listing jobs
type ListKeysResponse ¶
type ListKeysResponse struct { Resources []*KeyResource `json:"resources"` // contains filtered or unexported fields }
ListKeysResponse ...
type LoadAverageStats ¶
LoadAverageStats are stats about the CPU load
type LogEntry ¶
type LogEntry struct { Time string `json:"time"` AbsoluteTime *time.Time `json:"absolute_time"` Level LogLevel `json:"level"` Log string `json:"log"` User string `json:"user"` Command string `json:"command"` Node string `json:"node"` StepContext string `json:"stepctx"` Type LogEntryType `json:"type"` }
LogEntry ...
type LogEntryType ¶
type LogEntryType string
LogEntryType ...
const ( LogEntryTypeLog LogEntryType = "log" LogEntryTypeStepBegin LogEntryType = "stepbegin" LogEntryTypeStepEnd LogEntryType = "stepend" LogEntryTypeNodeBegin LogEntryType = "nodebegin" LogEntryTypeNodeEnd LogEntryType = "nodeend" )
type LogStorageMetadata ¶
type LogStorageMetadata struct { LocalFilesPresent bool `json:"localFilesPresent"` IncompleteFileTypes []string `json:"incompleteFileTypes"` Queued bool `json:"queued"` Failed bool `json:"failed"` Date time.Time `json:"date"` }
LogStorageMetadata is information about an executions associated log storage
type LogStorageStats ¶
type LogStorageStats struct { Enabled bool `json:"enabled"` PluginName string `json:"pluginName"` SucceededCount int64 `json:"succeededCount"` FailedCount int64 `json:"failedCount"` QueuedCount int64 `json:"queuedCount"` TotalCount int64 `json:"totalCount"` ImcompleteCount int64 `json:"incompleteCount"` MissingCount int64 `json:"missingCount"` }
LogStorageStats is the log storage info and stats
type LogStore ¶
type LogStore struct {
// contains filtered or unexported fields
}
LogStore contains information about logstorage in the system API
func (*LogStore) IncompleteLogStorage ¶
func (l *LogStore) IncompleteLogStorage() (*IncompleteLogStorageResponse, error)
IncompleteLogStorage lists executions with incomplete logstorage
func (*LogStore) LogStorage ¶
func (l *LogStore) LogStorage() (*LogStorageStats, error)
LogStorage returns log storage information and stats
func (*LogStore) ResumeIncompleteLogStorage ¶
func (l *LogStore) ResumeIncompleteLogStorage() (*ResumedIncompleteLogStorageResponse, error)
ResumeIncompleteLogStorage resumes processing incomplete log storage uploads
type MemoryStats ¶
type MemoryStats struct { Unit string `json:"unit"` Max int64 `json:"max"` Free int64 `json:"free"` Total int64 `json:"total"` }
MemoryStats are basic stats about memory usage
type ModifyUserInput ¶
type ModifyUserInput struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` }
ModifyUserInput are the fields necessary to modify a user
type NodeEntry ¶
type NodeEntry struct { Nodename string `json:"nodename"` Hostname string `json:"hostname"` Username string `json:"username"` Description string `json:"description"` Tags string `json:"tags"` OSFamily string `json:"osFamily"` OSArch string `json:"osArch"` OSName string `json:"osName"` OSVersion string `json:"osVersion"` EditURL string `json:"editUrl"` RemoteURL string `json:"remoteUrl"` NodeEntryAnything }
NodeEntry contains some specific entries in the node entry map
type NodeEntryAnything ¶
NodeEntryAnything represents everything else that can be added to the node entry map
type OperatingSystem ¶
type OperatingSystem struct { Architecture string `json:"arch"` Name string `json:"name"` Version string `json:"version"` }
OperatingSystem is information regarding the Rundeck host
type PagingInfo ¶
type PagingInfo struct { Count int `json:"count"` Total int `json:"total"` Max int `json:"max"` Offset int `json:"offset"` }
PagingInfo contains information relating to a paginated response
type Project ¶
type Project struct { Name string `json:"name"` Description string `json:"description"` URL string `json:"url"` }
Project is metadata about a project in rundeck
type ProjectConfigKeyPair ¶
ProjectConfigKeyPair is a single key pair from a project configuration
type ProjectInfo ¶
ProjectInfo contains the configuration for the project in addition to the metadata
type Projects ¶
type Projects struct {
// contains filtered or unexported fields
}
Projects is information pertaining to projects API endpoints
func (*Projects) ArchiveExport ¶
func (p *Projects) ArchiveExport(project string, input *ArchiveExportInput) ([]byte, error)
ArchiveExport exports a zip archive of the project synchronously
func (*Projects) ArchiveExportAsync ¶
func (p *Projects) ArchiveExportAsync(project string, input *ArchiveExportInput) (*ArchiveExportAsyncStatusResponse, error)
ArchiveExportAsync exports a zip archive of the project asynchronously
func (*Projects) ArchiveExportAsyncDownload ¶
ArchiveExportAsyncDownload downloads the finished artifact
func (*Projects) ArchiveExportAsyncStatus ¶
func (p *Projects) ArchiveExportAsyncStatus(project, token string) (*ArchiveExportAsyncStatusResponse, error)
ArchiveExportAsyncStatus gets the status of the async archive
func (*Projects) ArchiveImport ¶
func (p *Projects) ArchiveImport(project string, content []byte, input *ArchiveImportInput) (*ArchiveImportResponse, error)
ArchiveImport imports a zip archive into the project
func (*Projects) Configuration ¶
Configuration retrieves the project configuration data
func (*Projects) Create ¶
func (p *Projects) Create(data *CreateProjectInput) (*ProjectInfo, error)
Create will make a new project
func (*Projects) DeleteConfigKey ¶
DeleteConfigKey removes the key
func (*Projects) GetConfigKey ¶
func (p *Projects) GetConfigKey(project, key string) (*ProjectConfigKeyPair, error)
GetConfigKey retieves the value
func (*Projects) GetInfo ¶
func (p *Projects) GetInfo(project string) (*ProjectInfo, error)
GetInfo returns project info
func (*Projects) ListResources ¶
func (p *Projects) ListResources(project string, nodeFilters map[string]string) (map[string]*NodeEntry, error)
ListResources lists resources for a given project
func (*Projects) SetConfigKey ¶
func (p *Projects) SetConfigKey(project string, keyPair *ProjectConfigKeyPair) (*ProjectConfigKeyPair, error)
SetConfigKey modifies the value
type ResumedIncompleteLogStorageResponse ¶
type ResumedIncompleteLogStorageResponse struct {
Resumed bool `json:"resumed"`
}
ResumedIncompleteLogStorageResponse is the response body from the associated endpoint
type RetryJobInput ¶
type RetryJobInput struct { LogLevel LogLevel `json:"loglevel,omitempty"` AsUser string `json:"asUser,omitempty"` Options map[string]string `json:"options,omitempty"` FailedNodes bool `json:"failedNodes,omitempty"` }
RetryJobInput are the optional parameters passed when retrying a job based on execution id
type RunJobInput ¶
type RunJobInput struct { LogLevel LogLevel AsUser string Filters map[string]string RunAtTime *time.Time Options map[string]string }
RunJobInput are the optional paramenters passed when running a job
type Rundeck ¶
type Rundeck struct { Version string `json:"version"` Build string `json:"build"` Node string `json:"node"` APIVersion int `json:"apiversion"` ServerUUID string `json:"serverUUID"` }
Rundeck is information about the build
type SchedulerStats ¶
type SchedulerStats struct { Running int `json:"running"` ThreadPoolSize int `json:"threadPoolSize"` }
SchedulerStats are stats about the Rundeck scheduler
type Stats ¶
type Stats struct { Uptime UptimeStats `json:"uptime"` CPU CPUStats `json:"cpu"` Memory MemoryStats `json:"memory"` Scheduler SchedulerStats `json:"scheduler"` Threads ThreadStats `json:"threads"` }
Stats are basic Rundeck stats
type SuccessResponse ¶
type SuccessResponse struct {
Success bool `json:"success"`
}
SuccessResponse is a response containing whether or not the api call was a success
type System ¶
type System struct {
// contains filtered or unexported fields
}
System is the information regarding system calls
func (*System) Info ¶
func (s *System) Info() (*SystemInfoResponse, error)
Info retrieves Rundeck server information and stats.
func (*System) SetExecutionMode ¶
func (s *System) SetExecutionMode(mode ExecutionMode) (*ExecutionModeResponse, error)
SetExecutionMode sets the execution mode
type SystemInfo ¶
type SystemInfo struct { Timestamp Timestamp `json:"timestamp"` Rundeck Rundeck `json:"rundeck"` Executions ExecutionModeResponse `json:"executions"` OS OperatingSystem `json:"os"` JVM JVM `json:"jvm"` Stats Stats `json:"stats"` Metrics Metrics `json:"metrics"` ThreadDump ThreadDump `json:"threadDump"` HealthCheck HealthCheck `json:"healthcheck"` }
SystemInfo is information about the rundeck system
type SystemInfoResponse ¶
type SystemInfoResponse struct {
System SystemInfo `json:"system"`
}
SystemInfoResponse is Rundeck server information and stats
type TakeoverJob ¶
type TakeoverJob struct { HREF string `json:"href"` Permalink string `json:"permalink"` ID string `json:"id"` PreviousOwner string `json:"previous-owner"` }
TakeoverJob ...
type TakeoverJobInput ¶
type TakeoverJobInput struct {
ID string `json:"id,omitempty"`
}
TakeoverJobInput ...
type TakeoverJobs ¶
type TakeoverJobs struct { Failed []TakeoverJob `json:"failed"` Successful []TakeoverJob `json:"successful"` Total int `json:"total"` }
TakeoverJobs ...
type TakeoverSchedule ¶
type TakeoverSchedule struct { Jobs TakeoverJobs `json:"jobs,omitempty"` Server TakeoverServer `json:"server,omitempty"` Project string `json:"project,omitempty"` }
TakeoverSchedule is the result from issuing a takeover call
type TakeoverScheduleInput ¶
type TakeoverScheduleInput struct { Server *TakeoverServer `json:"server,omitempty"` Project *string `json:"project,omitempty"` Job *TakeoverJobInput `json:"job,omitempty"` }
TakeoverScheduleInput is the payload to takeover jobs in cluster mode
type TakeoverScheduleResponse ¶
type TakeoverScheduleResponse struct { TakeoverSchedule TakeoverSchedule `json:"takeoverSchedule"` Self struct { Server TakeoverServer `json:"server,omitempty"` } `json:"self,omitempty"` Message string `json:"message"` APIVersion int `json:"apiversion"` Success bool `json:"success"` }
TakeoverScheduleResponse is the response body from the endpoint
type TakeoverServer ¶
TakeoverServer ...
type ThreadDump ¶
ThreadDump contains a url to a page regarding thread dump information
type ThreadStats ¶
type ThreadStats struct {
Active int `json:"active"`
}
ThreadStats are stats about thread usage
type Timestamp ¶
type Timestamp struct { Epoch int64 `json:"epoch"` Unit string `json:"unit"` DateTime time.Time `json:"datetime"` }
Timestamp is time information on the Rundeck server
type ToggleKind ¶
type ToggleKind string
ToggleKind informs if executions or scheudles are being targeted
const ( ToggleKindExecution ToggleKind = "execution" ToggleKindSchedule ToggleKind = "schedule" )
type Token ¶
type Token struct { User string `json:"user"` ID string `json:"id"` Creator string `json:"creator"` Expiration time.Time `json:"expiration"` Roles []string `json:"roles"` Expired bool `json:"expired"` }
Token is the information regarding a user token
type Tokens ¶
type Tokens struct {
// contains filtered or unexported fields
}
Tokens is used to perform token specific API operations
func (*Tokens) Create ¶
Create creates a token based on the supplied config.
If duration is nil, Rundeck will use the configured default. NOTE: the duration needs to be something that rundeck can understand. Unfortunately, this isn't a go parseable duration. "120d" is understood by Rundeck while "2880h0m0s" is not (what time.Duration.String() returns for the equivalence).
type UUIDOption ¶
type UUIDOption string
UUIDOption instructs the job importer how to handle duplicate job uuids
const ( UUIDOptionPreserve UUIDOption = "preserve" UUIDOptionRemove UUIDOption = "remove" )
type UploadFileResponse ¶
type UploadFileResponse struct { Total int `json:"total"` Options map[string]string `json:"options"` }
UploadFileResponse is the response from uploading a file for a job. It will contain the fileKey.
type UploadedFilesResponse ¶
type UploadedFilesResponse struct { PagingInfo File []*FileOption `json:"files"` }
UploadedFilesResponse returns the files uploaded for a particular job
type UptimeStats ¶
type UptimeStats struct { Duration int64 `json:"duration"` Unit string `json:"unit"` Since Timestamp `json:"since"` }
UptimeStats are basic stats about system uptime
type UserProfile ¶
type UserProfile struct { Login string `json:"login"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` }
UserProfile is the information relating to a user on Rundeck
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users the is information regarding user profiles
func (*Users) Get ¶
func (u *Users) Get(login *string) (*UserProfile, error)
Get fetches a user profile.
If the login parameter is nil, the profile associated with the supplied auth token will be returned.
func (*Users) List ¶
func (u *Users) List() ([]*UserProfile, error)
List returns a list of all the users
func (*Users) Modify ¶
func (u *Users) Modify(login *string, input *ModifyUserInput) (*UserProfile, error)
Modify will modify the user.
If the user parameter is nil, then the user associated with the auth token will be modified.