rundeck

package
v0.0.0-...-69f973d Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const MaxRundeckVersion = "31"

MaxRundeckVersion is the maximum version of the api this library supports can be overridden TODO: make this a min/max option and validate

View Source
const RDTime = "2006-01-02T15:04:05Z"

RDTime is the rundeck time format

Variables

View Source
var (

	// ErrInvalidRundeckURL is the error for an invalid rundeck url
	ErrInvalidRundeckURL = errors.New("Invalid Rundeck URL")

	// ErrAuthFailed is the error for a auth failure in an api call
	// this is slightly different the ErrInvalidUsernamePassword
	// as this means auth succeeded with basic auth but a 401 could be returned farther down
	ErrAuthFailed = errors.New("API call failed due to authentication failure")

	// ErrMissingResource is the error type for 404 not found
	ErrMissingResource = errors.New("Rundeck could not find the resource you requested")

	// ErrResourceConflict is the error type for 409 responses
	ErrResourceConflict = errors.New("resource already exists on the rundeck server")
)

Functions

This section is empty.

Types

type ACLPolicies

type ACLPolicies struct {
	responses.ACLResponse
}

ACLPolicies represents ACL Policies

type AbortExecutionOption

type AbortExecutionOption func(m *map[string]string) error

AbortExecutionOption is a function option type for AbortExection options

func AbortExecutionAsUser

func AbortExecutionAsUser(runAsUser string) AbortExecutionOption

AbortExecutionAsUser sets the user for the abort execution call

type AbortedExecution

type AbortedExecution struct {
	responses.AbortExecutionResponse
}

AbortedExecution represents the results of aborting an execution

type AdHocExecution

type AdHocExecution struct {
	responses.AdHocExecutionResponse
}

AdHocExecution represents an adhoc execution

type AdHocRunOption

type AdHocRunOption func(c *requests.AdHocCommandRequest) error

AdHocRunOption is a function option type for adhoc commands

func CmdKeepGoing

func CmdKeepGoing(b bool) AdHocRunOption

CmdKeepGoing is the option to keep running even if a node fails

func CmdNodeFilters

func CmdNodeFilters(filters string) AdHocRunOption

CmdNodeFilters is the option for passing node filters to an adhoc command

func CmdRunAs

func CmdRunAs(user string) AdHocRunOption

CmdRunAs is the option for specifying who to run an adhoc command

func CmdThreadCount

func CmdThreadCount(count int) AdHocRunOption

CmdThreadCount is the option for number of threads to run an adhoc command

type AdHocScriptOption

type AdHocScriptOption func(c *map[string]string) error

AdHocScriptOption is a function option type for adhoc commands

func ScriptArgString

func ScriptArgString(i string) AdHocScriptOption

ScriptArgString is the option for setting arguments passed to the Script being run

func ScriptArgsQuoted

func ScriptArgsQuoted(q bool) AdHocScriptOption

ScriptArgsQuoted is the option for setting if Script and args are quoted when passed to the interpreter

func ScriptFileExtension

func ScriptFileExtension(e string) AdHocScriptOption

ScriptFileExtension is the option for setting the file extension on the remote host

func ScriptInterpreter

func ScriptInterpreter(i string) AdHocScriptOption

ScriptInterpreter is the option to set the Script interpreter

func ScriptKeepGoing

func ScriptKeepGoing(b bool) AdHocScriptOption

ScriptKeepGoing is the option to keep running even if a node fails

func ScriptNodeFilters

func ScriptNodeFilters(filters string) AdHocScriptOption

ScriptNodeFilters is the option for passing node filters to an adhoc command

func ScriptRunAs

func ScriptRunAs(user string) AdHocScriptOption

ScriptRunAs is the option for specifying who to run an adhoc command

func ScriptThreadCount

func ScriptThreadCount(count int) AdHocScriptOption

ScriptThreadCount is the option for number of threads to run an adhoc command

type AdHocScriptURLOption

type AdHocScriptURLOption func(c *map[string]string) error

AdHocScriptURLOption is a function option type for adhoc commands

func ScriptURLArgString

func ScriptURLArgString(i string) AdHocScriptURLOption

ScriptURLArgString is the option for setting arguments passed to the ScriptURL being run

func ScriptURLArgsQuoted

func ScriptURLArgsQuoted(q bool) AdHocScriptURLOption

ScriptURLArgsQuoted is the option for setting if ScriptURL and args are quoted when passed to the interpreter

func ScriptURLFileExtension

func ScriptURLFileExtension(e string) AdHocScriptURLOption

ScriptURLFileExtension is the option for setting the file extension on the remote host

func ScriptURLInterpreter

func ScriptURLInterpreter(i string) AdHocScriptURLOption

ScriptURLInterpreter is the option to set the ScriptURL interpreter

func ScriptURLKeepGoing

func ScriptURLKeepGoing(b bool) AdHocScriptURLOption

ScriptURLKeepGoing is the option to keep running even if a node fails

func ScriptURLNodeFilters

func ScriptURLNodeFilters(filters string) AdHocScriptURLOption

ScriptURLNodeFilters is the option for passing node filters to an adhoc command

func ScriptURLRunAs

func ScriptURLRunAs(user string) AdHocScriptURLOption

ScriptURLRunAs is the option for specifying who to run an adhoc command

func ScriptURLThreadCount

func ScriptURLThreadCount(count int) AdHocScriptURLOption

ScriptURLThreadCount is the option for number of threads to run an adhoc command

type AuthError

type AuthError struct {
	// contains filtered or unexported fields
}

AuthError is a custom error type for decoding errors

func (*AuthError) Error

func (e *AuthError) Error() string

Error returns the error message

type BulkToggleResponse

type BulkToggleResponse struct {
	responses.BulkToggleResponse
}

BulkToggleResponse represents the results of a bulk toggle request

type Client

type Client struct {
	HTTPClient *http.Client
	Config     *ClientConfig
}

Client represents a rundeck client

func NewBasicAuthClient

func NewBasicAuthClient(username, password, url string) (*Client, error)

NewBasicAuthClient returns a new client configured for basic auth using default settings

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient creates a new client from the provided `ClientConfig`

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

NewClientFromEnv returns a new client from provided env vars

func NewTokenAuthClient

func NewTokenAuthClient(token, url string) (*Client, error)

NewTokenAuthClient returns a new client configured for token auth using default settings

func (*Client) AbortExecution

func (c *Client) AbortExecution(executionID int, opts ...AbortExecutionOption) (*AbortedExecution, error)

AbortExecution lists input files used for an execution http://rundeck.org/docs/api/index.html#aborting-executions

func (*Client) BulkDeleteExecutions

func (c *Client) BulkDeleteExecutions(ids ...int) (*DeletedExecutions, error)

BulkDeleteExecutions deletes a list of executions by id http://rundeck.org/docs/api/index.html#bulk-delete-executions

func (*Client) BulkDisableExecution

func (c *Client) BulkDisableExecution(ids ...string) (*BulkToggleResponse, error)

BulkDisableExecution disables job execution in bulk http://rundeck.org/docs/api/index.html#bulk-toggle-job-execution

func (*Client) BulkDisableSchedule

func (c *Client) BulkDisableSchedule(ids ...string) (*responses.BulkToggleResponse, error)

BulkDisableSchedule enables scheduled jobs in bulk http://rundeck.org/docs/api/index.html#bulk-toggle-job-schedules

func (*Client) BulkEnableExecution

func (c *Client) BulkEnableExecution(ids ...string) (*BulkToggleResponse, error)

BulkEnableExecution enables job execution in bulk http://rundeck.org/docs/api/index.html#bulk-toggle-job-execution

func (*Client) BulkEnableSchedule

func (c *Client) BulkEnableSchedule(ids ...string) (*responses.BulkToggleResponse, error)

BulkEnableSchedule enables scheduled jobs in bulk http://rundeck.org/docs/api/index.html#bulk-toggle-job-schedules

func (*Client) BulkJobDelete

func (c *Client) BulkJobDelete(ids ...string) error

BulkJobDelete deletes jobs in bulk http://rundeck.org/docs/api/index.html#bulk-job-delete

func (*Client) CreateProject

func (c *Client) CreateProject(name string, properties map[string]string) (*Project, error)

CreateProject makes a project http://rundeck.org/docs/api/index.html#project-creation

func (*Client) CreateProjectACLPolicy

func (c *Client) CreateProjectACLPolicy(projectName, policyName string, contents io.Reader) error

CreateProjectACLPolicy creates a project ACL Policy http://rundeck.org/docs/api/index.html#create-a-project-acl-policy

func (*Client) CreateSystemACLPolicy

func (c *Client) CreateSystemACLPolicy(name string, contents io.Reader) error

CreateSystemACLPolicy creates a system acl policy http://rundeck.org/docs/api/index.html#create-an-acl-policy

func (*Client) CreateToken

func (c *Client) CreateToken(username string, opts ...TokenOption) (*Token, error)

CreateToken creates a token http://rundeck.org/docs/api/index.html#create-a-token

func (*Client) DeleteAllExecutionsForJob

func (c *Client) DeleteAllExecutionsForJob(jobid string) (*DeletedExecutions, error)

DeleteAllExecutionsForJob deletes all executions for a job http://rundeck.org/docs/api/index.html#delete-all-executions-for-a-job

func (*Client) DeleteExecution

func (c *Client) DeleteExecution(executionID int) error

DeleteExecution deletes an execution http://rundeck.org/docs/api/index.html#delete-an-execution

func (*Client) DeleteJob

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

DeleteJob deletes a job http://rundeck.org/docs/api/index.html#deleting-a-job-definition

func (*Client) DeleteKey

func (c *Client) DeleteKey() error

DeleteKey deletes a key http://rundeck.org/docs/api/index.html#delete-keys

func (*Client) DeleteProject

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

DeleteProject deletes a project http://rundeck.org/docs/api/index.html#project-deletion

func (*Client) DeleteProjectACLPolicy

func (c *Client) DeleteProjectACLPolicy(projectName, policyName string) error

DeleteProjectACLPolicy deletes a project ACL Policy http://rundeck.org/docs/api/index.html#delete-a-project-acl-policy

func (*Client) DeleteProjectConfigurationKey

func (c *Client) DeleteProjectConfigurationKey(projectName, key string) error

DeleteProjectConfigurationKey deletes a configuration key http://rundeck.org/docs/api/index.html#delete-project-configuration-key

func (*Client) DeleteProjectMotd

func (c *Client) DeleteProjectMotd(projectName string) error

DeleteProjectMotd deletes a project's motd.md

func (*Client) DeleteProjectReadme

func (c *Client) DeleteProjectReadme(projectName string) error

DeleteProjectReadme deletes a project's readme.md

func (*Client) DeleteSystemACLPolicy

func (c *Client) DeleteSystemACLPolicy(name string) error

DeleteSystemACLPolicy deletes a system ACL Policy http://rundeck.org/docs/api/index.html#delete-an-acl-policy

func (*Client) DeleteToken

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

DeleteToken deletes a token http://rundeck.org/docs/api/index.html#delete-a-token

func (*Client) DisableExecution

func (c *Client) DisableExecution(executionID int) (bool, error)

DisableExecution disables an execution http://rundeck.org/docs/api/index.html#disable-executions-for-a-job

func (*Client) DisableSCMPluginForProject

func (c *Client) DisableSCMPluginForProject(project, integration, pluginType string) error

DisableSCMPluginForProject disables a plugin for a project http://rundeck.org/docs/api/index.html#enable-scm-plugin-for-a-project

func (*Client) DisableSchedule

func (c *Client) DisableSchedule(id string) (bool, error)

DisableSchedule disables a scheduled job http://rundeck.org/docs/api/index.html#disable-scheduling-for-a-job

func (*Client) EnableExecution

func (c *Client) EnableExecution(executionID int) (bool, error)

EnableExecution enables an execution http://rundeck.org/docs/api/index.html#enable-executions-for-a-job

func (*Client) EnableSCMPluginForProject

func (c *Client) EnableSCMPluginForProject(project, integration, pluginType string) error

EnableSCMPluginForProject enables a plugin for a project http://rundeck.org/docs/api/index.html#enable-scm-plugin-for-a-project

func (*Client) EnableSchedule

func (c *Client) EnableSchedule(id string) (bool, error)

EnableSchedule enables a scheduled job http://rundeck.org/docs/api/index.html#enable-scheduling-for-a-job

func (*Client) ExportJob

func (c *Client) ExportJob(id string, format string) ([]byte, error)

ExportJob exports a job http://rundeck.org/docs/api/index.html#exporting-jobs

func (*Client) FindJobByName

func (c *Client) FindJobByName(name string) ([]JobMetaData, error)

FindJobByName runs a job by name

func (*Client) Get

func (rc *Client) Get(path string, opts ...httpclient.RequestOption) ([]byte, error)

Get performs an http get

func (*Client) GetCurrentUserProfile

func (c *Client) GetCurrentUserProfile() (*User, error)

GetCurrentUserProfile returns information about the current user http://rundeck.org/docs/api/index.html#get-user-profile

func (*Client) GetExecutionInfo

func (c *Client) GetExecutionInfo(executionID int) (*Execution, error)

GetExecutionInfo returns the details of a job execution http://rundeck.org/docs/api/index.html#execution-info

func (*Client) GetExecutionOutput

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

GetExecutionOutput returns the output of an execution http://rundeck.org/docs/api/index.html#execution-output

func (*Client) GetExecutionOutputWithOffset

func (c *Client) GetExecutionOutputWithOffset(executionID int, offset int) (*ExecutionOutput, error)

GetExecutionOutputWithOffset gets the output of an execution at the given offset

func (*Client) GetExecutionState

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

GetExecutionState returns the state of an execution http://rundeck.org/docs/api/index.html#execution-state

func (*Client) GetExecutionsForJob

func (c *Client) GetExecutionsForJob(jobid string) error

GetExecutionsForJob gets executions for a job http://rundeck.org/docs/api/index.html#getting-executions-for-a-job

func (*Client) GetIncompleteLogStorage

func (c *Client) GetIncompleteLogStorage() (*IncompleteLogStorage, error)

GetIncompleteLogStorage gets executions with incomplete logstorage http://rundeck.org/docs/api/index.html#list-executions-with-incomplete-log-storage

func (*Client) GetJobDefinition

func (c *Client) GetJobDefinition(id string, format string) ([]byte, error)

GetJobDefinition gets a job definition http://rundeck.org/docs/api/index.html#getting-a-job-definition

func (*Client) GetJobInfo

func (c *Client) GetJobInfo(id string) (*JobMetaData, error)

GetJobInfo gets a job's details http://rundeck.org/docs/api/index.html#get-job-metadata

func (*Client) GetJobMetaData

func (c *Client) GetJobMetaData(id string) (*JobMetaData, error)

GetJobMetaData gets a job's metadata http://rundeck.org/docs/api/index.html#get-job-metadata

func (*Client) GetJobOpts

func (c *Client) GetJobOpts(j string) ([]*JobOption, error)

GetJobOpts returns the required options for a job

func (*Client) GetJobSCMActionInputFields

func (c *Client) GetJobSCMActionInputFields(jobid, integration, action string) (*SCMActionInputFields, error)

GetJobSCMActionInputFields Get the input fields and selectable items for a specific action. http://rundeck.org/docs/api/index.html#get-job-scm-action-input-fields

func (*Client) GetJobSCMDiff

func (c *Client) GetJobSCMDiff(jobid, integration string) (*SCMJobDiff, error)

GetJobSCMDiff Retrieve the file diff for the Job, if there are changes for the integration. http://rundeck.org/docs/api/index.html#get-job-scm-diff

func (*Client) GetJobSCMStatus

func (c *Client) GetJobSCMStatus(jobid, integration string) (*SCMJobStatus, error)

GetJobSCMStatus gets a job's scm status http://rundeck.org/docs/api/index.html#get-job-scm-status

func (*Client) GetKeyContents

func (c *Client) GetKeyContents() error

GetKeyContents provides the public key content http://rundeck.org/docs/api/index.html#get-key-contents

func (*Client) GetKeyMetaData

func (c *Client) GetKeyMetaData() error

GetKeyMetaData returns the metadata about a stored key http://rundeck.org/docs/api/index.html#get-key-metadata

func (*Client) GetLogStorageInfo

func (c *Client) GetLogStorageInfo() (*LogStorage, error)

GetLogStorageInfo gets the logstorage http://rundeck.org/docs/api/index.html#log-storage-info

func (*Client) GetProjectACLPolicy

func (c *Client) GetProjectACLPolicy(projectName, policyName string) ([]byte, error)

GetProjectACLPolicy gets a project ACL Policy http://rundeck.org/docs/api/index.html#get-a-project-acl-policy

func (*Client) GetProjectArchiveExport

func (c *Client) GetProjectArchiveExport(p string, w io.Writer, opts ...ProjectExportOption) error

GetProjectArchiveExport export exports a zip file of the project http://rundeck.org/docs/api/index.html#project-archive-export

func (*Client) GetProjectArchiveExportAsync

func (c *Client) GetProjectArchiveExportAsync(p string, opts ...ProjectExportOption) (string, error)

GetProjectArchiveExportAsync export a zip archive of a project async http://rundeck.org/docs/api/index.html#project-archive-export-async

func (*Client) GetProjectArchiveExportAsyncDownload

func (c *Client) GetProjectArchiveExportAsyncDownload(p, token string, w io.Writer) error

GetProjectArchiveExportAsyncDownload downloads an async project export archive file http://rundeck.org/docs/api/index.html#project-archive-export-async-download

func (*Client) GetProjectArchiveExportAsyncStatus

func (c *Client) GetProjectArchiveExportAsyncStatus(p, token string) (*responses.ProjectArchiveExportAsyncResponse, error)

GetProjectArchiveExportAsyncStatus gets the status of an async export request http://rundeck.org/docs/api/index.html#project-archive-export-async-status

func (*Client) GetProjectConfiguration

func (c *Client) GetProjectConfiguration(p string) (map[string]string, error)

GetProjectConfiguration gets a project's configuration http://rundeck.org/docs/api/index.html#get-project-configuration

func (*Client) GetProjectConfigurationKey

func (c *Client) GetProjectConfigurationKey(projectName, key string) (string, error)

GetProjectConfigurationKey gets a specific configuration key http://rundeck.org/docs/api/index.html#get-project-configuration-key

func (*Client) GetProjectInfo

func (c *Client) GetProjectInfo(name string) (*Project, error)

GetProjectInfo gets a project by name http://rundeck.org/docs/api/index.html#getting-project-info

func (*Client) GetProjectMotd

func (c *Client) GetProjectMotd(projectName string) (string, error)

GetProjectMotd gets a project's Motd.md http://rundeck.org/docs/api/index.html#get-readme-file

func (*Client) GetProjectReadme

func (c *Client) GetProjectReadme(projectName string) (string, error)

GetProjectReadme gets a project's readme.md http://rundeck.org/docs/api/index.html#get-readme-file

func (*Client) GetProjectSCMActionInputFields

func (c *Client) GetProjectSCMActionInputFields(project, integration, action string) (*SCMActionInputFields, error)

GetProjectSCMActionInputFields Get the input fields and selectable items for a specific action. http://rundeck.org/docs/api/index.html#get-project-scm-action-input-fields

func (*Client) GetProjectSCMConfig

func (c *Client) GetProjectSCMConfig(projectName, integration string) (*ProjectSCMConfig, error)

GetProjectSCMConfig Get the configuration properties for the current plugin. http://rundeck.org/docs/api/index.html#get-project-scm-config

func (*Client) GetProjectSCMPluginInputFields

func (c *Client) GetProjectSCMPluginInputFields(projectName, integration, pluginType string) (*SCMPluginInputFields, error)

GetProjectSCMPluginInputFields List the input fields for a specific plugin. http://rundeck.org/docs/api/index.html#get-scm-plugin-input-fields

func (*Client) GetProjectSCMStatus

func (c *Client) GetProjectSCMStatus(project, integration string) (*SCMProjectStatus, error)

GetProjectSCMStatus Get the SCM plugin status and available actions for the project. http://rundeck.org/docs/api/index.html#get-project-scm-status

func (*Client) GetRequiredOpts

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

GetRequiredOpts returns the required options for a job

func (*Client) GetResourceInfo

func (c *Client) GetResourceInfo(projectName, resourceName string) (*ResourceDetail, error)

GetResourceInfo get a specific resource within a project (usually a node) http://rundeck.org/docs/api/index.html#getting-resource-info

func (*Client) GetSystemACLPolicy

func (c *Client) GetSystemACLPolicy(policy string) ([]byte, error)

GetSystemACLPolicy returns the named acl policy http://rundeck.org/docs/api/index.html#get-an-acl-policy

func (*Client) GetSystemInfo

func (c *Client) GetSystemInfo() (*SystemInfo, error)

GetSystemInfo gets system information from the rundeck server http://rundeck.org/docs/api/index.html#system-info

func (*Client) GetToken

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

GetToken gets a token http://rundeck.org/docs/api/index.html#get-a-token

func (*Client) GetUploadedFileInfo

func (c *Client) GetUploadedFileInfo(ids ...string) error

GetUploadedFileInfo gets info about an uploaded file http://rundeck.org/docs/api/index.html#get-info-about-an-uploaded-file

func (*Client) GetUserProfile

func (c *Client) GetUserProfile(login string) (*User, error)

GetUserProfile returns information about the named user - requires admin privileges http://rundeck.org/docs/api/index.html#get-another-user-profile

func (*Client) ImportJob

func (c *Client) ImportJob(project string, data io.Reader, opt ...JobImportOption) (*JobImportResult, error)

ImportJob imports a job http://rundeck.org/docs/api/index.html#importing-jobs

func (*Client) ListFilesUploadedForJob

func (c *Client) ListFilesUploadedForJob(ids ...string) error

ListFilesUploadedForJob lists files that have been uploaded for a job http://rundeck.org/docs/api/index.html#list-files-uploaded-for-a-job

func (*Client) ListHistory

func (c *Client) ListHistory(project string, opts ...map[string]string) (*History, error)

ListHistory returns the history for a project http://rundeck.org/docs/api/index.html#listing-history

func (*Client) ListInputFilesForExecution

func (c *Client) ListInputFilesForExecution() error

ListInputFilesForExecution lists input files used for an execution http://rundeck.org/docs/api/index.html#list-input-files-for-an-execution

func (*Client) ListJobs

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

ListJobs lists the jobs for a project http://rundeck.org/docs/api/index.html#listing-jobs

func (*Client) ListKeys

func (c *Client) ListKeys() error

ListKeys lists key resources http://rundeck.org/docs/api/index.html#list-keys

func (*Client) ListProjectACLPolicies

func (c *Client) ListProjectACLPolicies(name string) (*ACLPolicies, error)

ListProjectACLPolicies gets a project ACL Policies http://rundeck.org/docs/api/index.html#list-project-acl-policies

func (*Client) ListProjectExecutions

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

ListProjectExecutions lists a projects executions http://rundeck.org/docs/api/index.html#execution-query

func (*Client) ListProjects

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

ListProjects lists all projects http://rundeck.org/docs/api/index.html#listing-projects

func (*Client) ListResourcesForProject

func (c *Client) ListResourcesForProject(p string) (*Resources, error)

ListResourcesForProject returns resources for a project (usually nodes) http://rundeck.org/docs/api/index.html#list-resources-for-a-project

func (*Client) ListRunningExecutions

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

ListRunningExecutions lists running executions http://rundeck.org/docs/api/index.html#listing-running-executions

func (*Client) ListSCMPlugins

func (c *Client) ListSCMPlugins(projectName string) (*SCMPlugins, error)

ListSCMPlugins list the available plugins for the specified integration http://rundeck.org/docs/api/index.html#list-scm-plugins One minor customization we do here is to return both import and export in this for a nicer bit of sugar

func (*Client) ListSystemACLPolicies

func (c *Client) ListSystemACLPolicies() (*ACLPolicies, error)

ListSystemACLPolicies gets the system ACL Policies http://rundeck.org/docs/api/index.html#list-system-acl-policies

func (*Client) ListTokens

func (c *Client) ListTokens() ([]*Token, error)

ListTokens gets all tokens for the current user http://rundeck.org/docs/api/index.html#list-tokens

func (*Client) ListTokensForUser

func (c *Client) ListTokensForUser(user string) ([]*Token, error)

ListTokensForUser gets the api tokens for a user http://rundeck.org/docs/api/index.html#list-tokens

func (*Client) ListUsers

func (c *Client) ListUsers() (Users, error)

ListUsers returns all rundeck users http://rundeck.org/docs/api/index.html#list-users

func (*Client) ModifyUserProfile

func (c *Client) ModifyUserProfile(u *User) (*User, error)

ModifyUserProfile updates a user http://rundeck.org/docs/api/index.html#modify-user-profile

func (*Client) PerformJobSCMAction

func (c *Client) PerformJobSCMAction() error

PerformJobSCMAction Perform the action for the SCM integration plugin, with a set of input parameters, selected Jobs, or Items, or Items to delete. http://rundeck.org/docs/api/index.html#perform-job-scm-action

func (*Client) PerformProjectSCMAction

func (c *Client) PerformProjectSCMAction(project, integration, action string, opts ...SCMActionOption) (*SCMPluginForProject, error)

PerformProjectSCMAction Perform the action for the SCM integration plugin, with a set of input parameters, selected Jobs, or Items, or Items to delete. http://rundeck.org/docs/api/index.html#perform-project-scm-action

func (*Client) ProjectArchiveImport

func (c *Client) ProjectArchiveImport(projectName string, f io.Reader, opts ...ProjectImportOption) (*responses.ProjectImportArchiveResponse, error)

ProjectArchiveImport imports a zip archive to a project http://rundeck.org/docs/api/index.html#project-archive-import

func (*Client) PutProjectConfiguration

func (c *Client) PutProjectConfiguration(projectName string, config map[string]string) (map[string]string, error)

PutProjectConfiguration replaces all configuration data with the submitted values http://rundeck.org/docs/api/index.html#put-project-configuration

func (*Client) PutProjectConfigurationKey

func (c *Client) PutProjectConfigurationKey(projectName, key, value string) error

PutProjectConfigurationKey sets a value for a configuration key http://rundeck.org/docs/api/index.html#put-project-configuration-key

func (*Client) PutProjectMotd

func (c *Client) PutProjectMotd(projectName string, motd io.Reader) error

PutProjectMotd creates or modifies a project's motd.md http://rundeck.org/docs/api/index.html#put-readme-file

func (*Client) PutProjectReadme

func (c *Client) PutProjectReadme(projectName string, readme io.Reader) error

PutProjectReadme creates or modifies a project's readme.md http://rundeck.org/docs/api/index.html#put-readme-file

func (*Client) ResumeIncompleteLogStorage

func (c *Client) ResumeIncompleteLogStorage() (bool, error)

ResumeIncompleteLogStorage resumes processing incomplete log storage uploads http://rundeck.org/docs/api/index.html#resume-incomplete-log-storage

func (*Client) RunAdHocCommand

func (c *Client) RunAdHocCommand(projectID string, exec string, opts ...AdHocRunOption) (*AdHocExecution, error)

RunAdHocCommand runs an adhoc job - all nodes by default http://rundeck.org/docs/api/index.html#running-adhoc-commands

func (*Client) RunAdHocScript

func (c *Client) RunAdHocScript(projectID string, scriptData io.Reader, opts ...AdHocScriptOption) (*AdHocExecution, error)

RunAdHocScript runs a Script ad-hoc http://rundeck.org/docs/api/index.html#running-adhoc-scripts Because script contents can be overly complicated and large, we do not currently run scripts via json body post

func (*Client) RunAdHocScriptFromURL

func (c *Client) RunAdHocScriptFromURL(projectID, scriptURL string, opts ...AdHocScriptURLOption) (*AdHocExecution, error)

RunAdHocScriptFromURL runs a ScriptURL ad-hoc from a url http://rundeck.org/docs/api/index.html#running-adhoc-ScriptURL-urls Due to the fact that we must still provide scriptURL as a query param, we do not currently run script urls via json body post

func (*Client) RunJob

func (c *Client) RunJob(id string, opts ...RunJobOption) (*Execution, error)

RunJob runs a job http://rundeck.org/docs/api/index.html#running-a-job

func (*Client) SetupSCMPluginForProject

func (c *Client) SetupSCMPluginForProject(project, integration, pluginType string, params map[string]string) (*SCMPluginForProject, error)

SetupSCMPluginForProject configures and enables a plugin for a project http://rundeck.org/docs/api/index.html#setup-scm-plugin-for-a-project

func (*Client) UpdateProjectACLPolicy

func (c *Client) UpdateProjectACLPolicy(projectName, policyName string, contents io.Reader) error

UpdateProjectACLPolicy updates a project ACL Policy http://rundeck.org/docs/api/index.html#update-a-project-acl-policy

func (*Client) UpdateSystemACLPolicy

func (c *Client) UpdateSystemACLPolicy(name string, contents io.Reader) error

UpdateSystemACLPolicy creates a system acl policy http://rundeck.org/docs/api/index.html#update-an-acl-policy

func (*Client) UploadFileForJobOption

func (c *Client) UploadFileForJobOption(ids ...string) error

UploadFileForJobOption uploads a file for a job 'file' option type http://rundeck.org/docs/api/index.html#upload-a-file-for-a-job-option

func (*Client) UploadKey

func (c *Client) UploadKey() error

UploadKey stores keys on the rundeck server http://rundeck.org/docs/api/index.html#upload-keys

func (*Client) WaitFor

func (c *Client) WaitFor(f func() (bool, error), max time.Duration) (bool, error)

WaitFor runs the provided func up to max wait time until it is done

type ClientConfig

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

ClientConfig represents a client configuration

type DeletedExecutions

type DeletedExecutions struct {
	responses.BulkDeleteExecutionsResponse
}

DeletedExecutions represents the results of a bulk execution delete

type Execution

type Execution struct {
	responses.ExecutionResponse
}

Execution represents a job execution

type ExecutionOutput

type ExecutionOutput struct {
	responses.ExecutionOutputResponse
}

ExecutionOutput represents the output of an execution

type ExecutionState

type ExecutionState struct {
	responses.ExecutionStateResponse
}

ExecutionState represents a job execution state

type Executions

type Executions struct {
	responses.ListRunningExecutionsResponse
}

Executions represents a list of executions for a project

type History

type History struct {
	responses.HistoryResponse
}

History represents a project history

type IncompleteLogStorage

type IncompleteLogStorage struct {
	responses.IncompleteLogStorageResponse
}

IncompleteLogStorage represents IncompleteLogStorage

type Job

type Job struct {
	responses.JobResponse
}

Job represents a rundeck job

type JobImportDefinition

type JobImportDefinition struct {
	Format     string
	DupeOption string
	UUIDOption string
}

JobImportDefinition is a type for importing a job

type JobImportOption

type JobImportOption func(j *JobImportDefinition) error

JobImportOption is a functional option for importing jobs

func ImportDupe

func ImportDupe(f string) JobImportOption

ImportDupe sets dupe handling for the job import

func ImportFormat

func ImportFormat(f string) JobImportOption

ImportFormat sets the format of the job import

func ImportUUID

func ImportUUID(f string) JobImportOption

ImportUUID sets uuid handling for the job import

type JobImportResult

type JobImportResult struct {
	responses.ImportedJobResponse
}

JobImportResult is the result of a job import

type JobList

type JobList []Job

JobList is a list of rundeck jobs

type JobMetaData

type JobMetaData struct {
	responses.JobMetaDataResponse
}

JobMetaData is the result of getting a job's metadata

type JobOption

type JobOption struct {
	Description string
	Name        string
	Regex       string
	Required    bool
	Value       string
}

JobOption represents a job option

type LogStorage

type LogStorage struct {
	responses.LogStorageResponse
}

LogStorage represents log storage

type MarshalError

type MarshalError struct {
	// contains filtered or unexported fields
}

MarshalError is a custom error type for decoding errors

func (*MarshalError) Error

func (e *MarshalError) Error() string

Error returns the error message

type OptionError

type OptionError struct {
	// contains filtered or unexported fields
}

OptionError is a custom error type for option errors

func (*OptionError) Error

func (e *OptionError) Error() string

Error returns the error message

type PolicyValidationError

type PolicyValidationError struct {
	// contains filtered or unexported fields
}

PolicyValidationError is a custom error type for policy validation errors

func (*PolicyValidationError) Error

func (e *PolicyValidationError) Error() string

Error returns the error message

type Project

type Project struct {
	URL         string
	Name        string
	Description string
	Properties  map[string]string
}

Project is a rundeck project

type ProjectExportOption

type ProjectExportOption func(p *map[string]string) error

ProjectExportOption is a functional option for project exports

func ProjectExportAcls

func ProjectExportAcls(b bool) ProjectExportOption

ProjectExportAcls toggles exporting project acls

func ProjectExportAll

func ProjectExportAll(b bool) ProjectExportOption

ProjectExportAll toggles exporting everything

func ProjectExportConfigs

func ProjectExportConfigs(b bool) ProjectExportOption

ProjectExportConfigs toggles exporting configs

func ProjectExportExecutionIDs

func ProjectExportExecutionIDs(ids ...string) ProjectExportOption

ProjectExportExecutionIDs specifies the execution ids to export

func ProjectExportExecutions

func ProjectExportExecutions(b bool) ProjectExportOption

ProjectExportExecutions toggles exporting executions

func ProjectExportJobs

func ProjectExportJobs(b bool) ProjectExportOption

ProjectExportJobs toggles exporting jobs

func ProjectExportReadmes

func ProjectExportReadmes(b bool) ProjectExportOption

ProjectExportReadmes toggles exporting readmes and motds

type ProjectImportOption

type ProjectImportOption func(p *map[string]string) error

ProjectImportOption is a functional option for project imports

func ProjectImportAcls

func ProjectImportAcls(b bool) ProjectImportOption

ProjectImportAcls toggles importing acls with the project

func ProjectImportConfigs

func ProjectImportConfigs(b bool) ProjectImportOption

ProjectImportConfigs toggles importing configs with the project

func ProjectImportExecutions

func ProjectImportExecutions(b bool) ProjectImportOption

ProjectImportExecutions toggles importing executions with the project

func ProjectImportJobUUIDs

func ProjectImportJobUUIDs(s string) ProjectImportOption

ProjectImportJobUUIDs toggles importing job uuids with the project

type ProjectSCMConfig

type ProjectSCMConfig struct {
	responses.GetProjectSCMConfigResponse
}

ProjectSCMConfig represents a project's SCM config

type Projects

type Projects []*Project

Projects is a collection of `Project`

type Resource

type Resource map[string]ResourceDetail

Resource represents a project resource (usually a node)

type ResourceDetail

type ResourceDetail struct {
	responses.ResourceDetailResponse
}

ResourceDetail represents a resource's details

type Resources

type Resources map[string]ResourceDetail

Resources represents a collection of project resources (usually nodes)

type RunJobOption

type RunJobOption func(*requests.RunJobRequest) error

RunJobOption is a type for functional options

func RunJobArgs

func RunJobArgs(a string) RunJobOption

RunJobArgs runs the job with the specified arg string

func RunJobAs

func RunJobAs(u string) RunJobOption

RunJobAs runs a job as a specific user

func RunJobFilter

func RunJobFilter(a string) RunJobOption

RunJobFilter runs the job with the specified filter

func RunJobLogLevel

func RunJobLogLevel(l string) RunJobOption

RunJobLogLevel runs the job with the specified log level

func RunJobOpts

func RunJobOpts(a map[string]string) RunJobOption

RunJobOpts runs the job with the specified filter

func RunJobRunAt

func RunJobRunAt(t time.Time) RunJobOption

RunJobRunAt runs the specified job at the specified time

type SCMAction

type SCMAction struct {
	Input   map[string]string
	Jobs    []string
	Items   []string
	Deleted []string
}

SCMAction is the type for scm actions

type SCMActionInputFields

type SCMActionInputFields struct {
	responses.GetSCMActionInputFieldsResponse
}

SCMActionInputFields represents project scm action input fields

type SCMActionOption

type SCMActionOption func(*SCMAction) error

SCMActionOption is the functional option type for setting an SCMAction

func SCMActionDeleted

func SCMActionDeleted(deleted ...string) SCMActionOption

SCMActionDeleted sets the jobs for an SCMAction

func SCMActionInput

func SCMActionInput(m map[string]string) SCMActionOption

SCMActionInput sets the input map for an SCMAction

func SCMActionItems

func SCMActionItems(items ...string) SCMActionOption

SCMActionItems sets the itemss for an SCMAction

func SCMActionJobs

func SCMActionJobs(jobs ...string) SCMActionOption

SCMActionJobs sets the jobs for an SCMAction

type SCMJobDiff

type SCMJobDiff struct {
	responses.GetJobSCMDiffResponse
}

SCMJobDiff represent's a job's scm diff

type SCMJobStatus

type SCMJobStatus struct {
	responses.GetJobSCMStatusResponse
}

SCMJobStatus represents a job's scm status

type SCMPluginForProject

type SCMPluginForProject struct {
	responses.SCMPluginForProjectResponse
}

SCMPluginForProject represents an scm plugin for a project

type SCMPluginInputFields

type SCMPluginInputFields struct {
	responses.GetSCMPluginInputFieldsResponse
}

SCMPluginInputFields are input fields for scm plugins

type SCMPlugins

type SCMPlugins struct {
	Import []responses.SCMPluginResponse
	Export []responses.SCMPluginResponse
}

SCMPlugins is a list of SCM plugins grouped by Integration (import or export)

type SCMProjectStatus

type SCMProjectStatus struct {
	responses.GetProjectSCMStatusResponse
}

SCMProjectStatus represents a project's scm status

type SCMValidationError

type SCMValidationError struct {
	// contains filtered or unexported fields
}

SCMValidationError is a custom error type for scm validation errors

func (*SCMValidationError) Error

func (e *SCMValidationError) Error() string

Error returns the error message

type SystemInfo

type SystemInfo struct {
	responses.SystemInfoResponse
}

SystemInfo represents the rundeck server system info output

type Token

type Token struct {
	responses.TokenResponse
}

Token is a token

type TokenOption

type TokenOption func(*TokenRequest) error

TokenOption is a type for options in creating new tokens

func TokenDuration

func TokenDuration(duration string) TokenOption

TokenDuration is an option for setting the duration of a new token

func TokenRoles

func TokenRoles(roles ...string) TokenOption

TokenRoles is an option to set the roles for a new token

type TokenRequest

type TokenRequest struct {
	requests.TokenRequest
}

TokenRequest is a new token request

type Tokens

Tokens is a collection of Token

type UnmarshalError

type UnmarshalError struct {
	// contains filtered or unexported fields
}

UnmarshalError is a custom error type for decoding errors

func (*UnmarshalError) Error

func (e *UnmarshalError) Error() string

Error returns the error message

type User

type User struct {
	Login     string
	FirstName string
	LastName  string
	Email     string
	Created   time.Time
	Updated   time.Time
	LastJob   time.Time
	Tokens    int
}

User represents a user in rundeck

type Users

type Users []User

Users represents a collection of users

type WaitingJob

type WaitingJob struct {
	Done  bool
	Error error
}

WaitingJob is a type for determining if work is done

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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