responses

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: 12 Imported by: 2

README

responses package

This is the package that describes all responses from the rundeck API

Requirements

  • All responses must use the following format
type RundeckAPIActionResponse struct {}

GetProjectSCMConfigResponse is the response for the GetProjectSCMConfig api call

type GetProjectSCMConfigResponse struct {
    SCMResponse
    Config      map[string]string `json:"config"`
    Enabled     bool              `json:"enabled"`
    Integration string            `json:"integration"`
    Project     string            `json:"project"`
    Type        string            `json:"type"`
}
  • All responses must satisfy the VersionedResponse interface

This is critical to being able to easily manage responses across differing versions of the API

This can be done either through embedding if it makes sense (as with the SCMResponse above) or per-response if the response has different version constraints than the top-level construct.

  • All responses should not use nested structs unless it makes sense

If there is a nested struct, chances are it's reused across other responses of the same type so to avoid duplication and copy/paste errors, break those out into their own struct

Nested structs aren't forbidden but use some good sense especially if they're complicated

  • All responses should provide constants for test data in the form of StructNameResponseTestData
// ListKeysResourceResponseTestFile is the test data for a KeyMetaResponse
const ListKeysResourceResponseTestFile = "key_metadata.json"

The content should be gathered from an actual live running rundeck server (you can use rundeck http get), and saved in the testdata directory. The value of the constant should be the name of the saved file.

After saving the file, make bindata should be called from the top-level of the repo to ensure the assets are available.

  • All responses should provide be tested via strict mapstructure decoding

Example:

func TestHistoryResponse(t *testing.T) {
    obj := &HistoryResponse{}
    data, err := getAssetBytes(HistoryResponseTestFile)
    require.NoError(t, err)
    // unmarshal into a map[string]interface
    placeholder := make(map[string]interface{})
    err = json.Unmarshal(data, &placeholder)
    require.NoError(t, err)
    // create a new decoder config and set the result to our instance of type
    config := newMSDecoderConfig()
    config.Result = obj
    decoder, err := mapstructure.NewDecoder(config)
    require.NoError(t, err)
    // attempt to decode our unmarshalled data
    err = decoder.Decode(placeholder)
    require.NoError(t, err)
}

If you get any failures from decoding, your struct definition is wrong for handling the json:

--- FAIL: TestHistoryResponse (0.00s)
    assertions.go:237:

    Error Trace:    history_test.go:26

    Error:        Received unexpected error 6 error(s) decoding:

            * 'events[0]' has invalid keys: statusString
            * 'events[1]' has invalid keys: statusString
            * 'events[2]' has invalid keys: statusString
            * 'events[3]' has invalid keys: job, statusString
            * 'events[4]' has invalid keys: job, statusString
            * 'events[5]' has invalid keys: job, statusString

In this case we had some undocumented fields but using output from a live server and attempting to decode it caught that.

Note that we don't need to test the values of individual fields. Response tests are ONLY concerned with struct definitions matching real world data

Documentation

Index

Constants

View Source
const ACLResponseTestFile = "acl.json"

ACLResponseTestFile is the test data for ACLResourceResponse

View Source
const AbortExecutionResponseTestFile = "execution_aborted.json"

AbortExecutionResponseTestFile is test data for aborting an execution

View Source
const AbsoluteMinimumVersion = 14

AbsoluteMinimumVersion is the absolute minimum version this library will support We set this to `14` as that was the first version of the rundeck API to support JSON

View Source
const AdHocExecutionResponseTestFile = "execution_adhoc.json"

AdHocExecutionResponseTestFile is the test data for an AdHocExecutionResponse

View Source
const AuthenticatedUserRolesTestFile = "get_authenticated_user_roles.json"
View Source
const BulkDeleteExecutionsResponseTestFile = "bulk_delete_executions.json"

BulkDeleteExecutionsResponseTestFile is test data for an ExecutionInputFileResponse

View Source
const BulkDeleteJobResponseTestFile = "bulk_job_delete.json"

BulkDeleteJobResponseTestFile is the test data for BulkDeleteJobResponse

View Source
const BulkToggleResponseTestFile = "bulk_toggle.json"

BulkToggleResponseTestFile is test data for an ExecutionInputFileResponse

View Source
const CurrentVersion = 31

CurrentVersion is the current version of the API that this library is tested against

View Source
const ErrorResponseTestFile = "error.json"

ErrorResponseTestFile is the test data for an ErrorResponse

View Source
const ExecutionInputFilesResponseTestFile = "execution_input_files.json"

ExecutionInputFilesResponseTestFile is test data for an ExecutionInputFileResponse

View Source
const ExecutionOutputResponseTestFile = "execution_output.json"

ExecutionOutputResponseTestFile is test data for getting an output execution response

View Source
const ExecutionResponseTestFile = "execution.json"

ExecutionResponseTestFile is the test data for ExecutionResponse

View Source
const ExecutionStateResponseTestFile = "execution_state.json"

ExecutionStateResponseTestFile is the test data for ExecutionStateResponse

View Source
const ExecutionsMetricsResponseTestFile = "get_executions_metrics.json"

ExecutionsMetricsResponseTestFile is test data for getting system-wide execution metrics

View Source
const FailToggleResponseTestFile = "failed.json"

FailToggleResponseTestFile is the test data for a successful toggle

View Source
const FailedACLValidationResponseTestFile = "failed_acl_validation.json"

FailedACLValidationResponseTestFile is the test data for ACLResourceResponse

View Source
const GetJobSCMDiffResponseTestFileExport = "get_job_scm_diff_export.json"

GetJobSCMDiffResponseTestFileExport is test data for job scm diff import plugins

View Source
const GetJobSCMDiffResponseTestFileImport = "get_job_scm_diff_import.json"

GetJobSCMDiffResponseTestFileImport is test data for job scm diff import plugins

View Source
const GetJobSCMStatusResponseTestFileExport = "get_job_scm_status_export.json"

GetJobSCMStatusResponseTestFileExport is test data for job import plugins

View Source
const GetJobSCMStatusResponseTestFileImport = "get_job_scm_status_import.json"

GetJobSCMStatusResponseTestFileImport is test data for job import plugins

View Source
const GetProjectSCMConfigResponseExportTestFile = "get_project_scm_config_export.json"

GetProjectSCMConfigResponseExportTestFile is testdata for GetProjectSCMConfigResponse for export plugins

View Source
const GetProjectSCMConfigResponseImportTestFile = "get_project_scm_config_import.json"

GetProjectSCMConfigResponseImportTestFile is testdata for GetProjectSCMConfigResponse for import plugins

View Source
const GetProjectSCMStatusResponseExportTestFile = "get_project_scm_status_export.json"

GetProjectSCMStatusResponseExportTestFile is test data for a GetProjectSCMStatusResponse export plugin

View Source
const GetProjectSCMStatusResponseImportTestFile = "get_project_scm_status_import.json"

GetProjectSCMStatusResponseImportTestFile is test data for a GetProjectSCMStatusResponse import plugin

View Source
const GetSCMActionInputFieldsResponseTestFileJobExport = "get_job_scm_action_input_fields_export.json"

GetSCMActionInputFieldsResponseTestFileJobExport is test data for job export plugins

View Source
const GetSCMActionInputFieldsResponseTestFileJobImport = "get_job_scm_action_input_fields_import.json"

GetSCMActionInputFieldsResponseTestFileJobImport is test data for job import plugins

View Source
const GetSCMActionInputFieldsResponseTestFileProjectExport = "get_project_scm_action_input_fields_export.json"

GetSCMActionInputFieldsResponseTestFileProjectExport is test data for project export plugins

View Source
const GetSCMActionInputFieldsResponseTestFileProjectImport = "get_project_scm_action_input_fields_import.json"

GetSCMActionInputFieldsResponseTestFileProjectImport is test data for project import plugins

View Source
const GetSCMPluginInputFieldsResponseExportTestData = "get_scm_input_plugin_fields_export.json"

GetSCMPluginInputFieldsResponseExportTestData is test data for GetSCMPluginInputFieldsResponse export plugins

View Source
const GetSCMPluginInputFieldsResponseImportTestData = "get_scm_input_plugin_fields_import.json"

GetSCMPluginInputFieldsResponseImportTestData is test data for GetSCMPluginInputFieldsResponse import plugins

View Source
const HistoryResponseTestFile = "history.json"

HistoryResponseTestFile is the test data for a HistoryResponse

View Source
const ImportedJobResponseTestFile = "imported_job.json"

ImportedJobResponseTestFile is the test data for an ImportedJobResponse

View Source
const IncompleteLogStorageResponseTestFile = "incomplete_logstorage_executions.json"

IncompleteLogStorageResponseTestFile is test data for an IncompleteLogStorageResponse

View Source
const JobMetaDataResponseTestFile = "job_metadata.json"

JobMetaDataResponseTestFile is the test data for a JobMetaDataResponse

View Source
const JobOptionFileUploadResponseTestFile = "job_option_upload.json"

JobOptionFileUploadResponseTestFile is the test data for a JobOptionFileUploadResponse

View Source
const JobYAMLResponseTestFile = "job_definition.yaml"

JobYAMLResponseTestFile is test data for a job definition

View Source
const JobsResponseTestFile = "jobs.json"

JobsResponseTestFile is the test data for JobsResponse

View Source
const ListKeysResourceResponseTestFile = "key_metadata.json"

ListKeysResourceResponseTestFile is the test data for a KeyMetaResponse

View Source
const ListKeysResponseTestFile = "list_keys.json"

ListKeysResponseTestFile is the test data for a ListKeysResponse

View Source
const ListProjectsResponseTestFile = "list_projects.json"

ListProjectsResponseTestFile is test data for a ListProjectsResponse

View Source
const ListRunningExecutionsResponseTestFile = "executions.json"

ListRunningExecutionsResponseTestFile is the test data for JobExecutionResponse

View Source
const ListSCMPluginsResponseExportTestFile = "list_scm_plugins_export.json"

ListSCMPluginsResponseExportTestFile is the test data for list scm plugins response for export scm

View Source
const ListSCMPluginsResponseImportTestFile = "list_scm_plugins_import.json"

ListSCMPluginsResponseImportTestFile is the test data for list scm plugins response for import scm

View Source
const ListTokensResponseTestFile = "tokens.json"

ListTokensResponseTestFile is test data for a TokensResponse

View Source
const ListUsersResponseTestFile = "users.json"

ListUsersResponseTestFile is test data for a UsersInfoResponse

View Source
const LogStorageResponseTestFile = "logstorage.json"

LogStorageResponseTestFile is the test data for a LogStorageResponse

View Source
const ProjectArchiveExportAsyncResponseTestFile = "project_archive_export_async.json"

ProjectArchiveExportAsyncResponseTestFile is test data for a ProjectArchiveExportAsyncResponse

View Source
const ProjectConfigItemResponseTestFile = "config_item.json"

ProjectConfigItemResponseTestFile is test data for a ProjectConfigItemResponse

View Source
const ProjectConfigResponseTestFile = "project_config.json"

ProjectConfigResponseTestFile is test data for a ProjectConfigResponse

View Source
const ProjectExecutionsMetricsResponseTestFile = "get_project_executions_metrics.json"

ProjectExectionsMetricsResponseTestFile is the test data

View Source
const ProjectImportArchiveFailedResponseTestFile = "project_archive_import_failed.json"

ProjectImportArchiveFailedResponseTestFile is test data for a failed ProjectImportArchiveResponse

View Source
const ProjectImportArchiveResponseTestFile = "project_archive_import.json"

ProjectImportArchiveResponseTestFile is test data for a ProjectImportArchiveResponse

View Source
const ProjectInfoResponseTestFile = "project_info.json"

ProjectInfoResponseTestFile is test data for a ProjectInfoResponse

View Source
const ResourceCollectionResponseTestFile = "resources.json"

ResourceCollectionResponseTestFile is the testdata used in testing

View Source
const ResourceResponseTestFile = "resource.json"

ResourceResponseTestFile is the testdata user in testing

View Source
const SCMPluginForProjectResponseDisableExportTestFile = "disable_scm_plugin_export.json"

SCMPluginForProjectResponseDisableExportTestFile is test data for disabling an scm export plugin

View Source
const SCMPluginForProjectResponseDisableImportTestFile = "disable_scm_plugin_import.json"

SCMPluginForProjectResponseDisableImportTestFile is test data for disabling an scm import plugin

View Source
const SCMPluginForProjectResponseEnableExportTestFile = "enable_scm_plugin_export.json"

SCMPluginForProjectResponseEnableExportTestFile is test data for enabling an scm export plugin

View Source
const SCMPluginForProjectResponseEnableImportTestFile = "enable_scm_plugin_import.json"

SCMPluginForProjectResponseEnableImportTestFile is test data for enabling an scm import plugin

View Source
const SuccessToggleResponseTestFile = "success.json"

SuccessToggleResponseTestFile is the test data for a successful toggle

View Source
const SystemInfoResponseTestFile = "systeminfo.json"

SystemInfoResponseTestFile is test data for a SystemInfoResponse

View Source
const TokenResponseTestFile = "token.json"

TokenResponseTestFile is test data for a TokenResponse

View Source
const UploadedJobInputFilesResponseTestFile = "uploaded_job_input_files.json"

UploadedJobInputFilesResponseTestFile is the test data for a UploadedJobInputFileResponse

View Source
const UserProfileResponseTestFile = "user.json"

UserProfileResponseTestFile is test data for a UserInfoResponse

Variables

This section is empty.

Functions

func GetMaxVersionFor

func GetMaxVersionFor(a VersionedResponse) int

GetMaxVersionFor gets the maximum api version required for a response

func GetMinVersionFor

func GetMinVersionFor(a VersionedResponse) int

GetMinVersionFor gets the minimum api version required for a response

func GetTestData

func GetTestData(fileName string) ([]byte, error)

GetTestData returns the contents of testdata/fileName as a []byte

func IsDeprecated

func IsDeprecated(a VersionedResponse) bool

IsDeprecated indicates if a response is deprecated or not

Types

type ACLResourceResponse

type ACLResourceResponse struct {
	Path string `json:"path"`
	Type string `json:"type"`
	Href string `json:"href"`
	Name string `json:"name,omitempty"`
}

ACLResourceResponse represent an ACL Resource response

type ACLResponse

type ACLResponse struct {
	Path      string                `json:"path"`
	Type      string                `json:"type"`
	Href      string                `json:"href"`
	Resources []ACLResourceResponse `json:"resources,omitempty"`
}

ACLResponse represents acl response

func (*ACLResponse) FromBytes

func (a *ACLResponse) FromBytes(f []byte) error

FromBytes returns an ACLResponse from a byte slice

func (*ACLResponse) FromFile

func (a *ACLResponse) FromFile(f string) error

FromFile returns an ACLResponse from a file

func (*ACLResponse) FromReader

func (a *ACLResponse) FromReader(i io.Reader) error

FromReader returns an ACLResponse from an io.Reader

type AbortExecutionResponse

type AbortExecutionResponse struct {
	Abort struct {
		Status string `json:"status"`
		Reason string `json:"reason"`
	} `json:"abort"`
	Execution struct {
		ID     string `json:"id"`
		Status string `json:"status"`
		HRef   string `json:"href"`
	} `json:"execution"`
}

AbortExecutionResponse is the response for aborting an execution

type AdHocExecutionItemResponse

type AdHocExecutionItemResponse struct {
	ID        int    `json:"id"`
	HRef      string `json:"href"`
	Permalink string `json:"permalink"`
}

AdHocExecutionItemResponse is an individual adhoc execution response

type AdHocExecutionResponse

type AdHocExecutionResponse struct {
	Message   string                     `json:"message"`
	Execution AdHocExecutionItemResponse `json:"execution"`
}

AdHocExecutionResponse is the response for an running and adhoc command

type ArtbitraryResourcePropertiesResponse

type ArtbitraryResourcePropertiesResponse map[string]string

ArtbitraryResourcePropertiesResponse represents custom properties in a resource response

type AuthenticatedUserRoles

type AuthenticatedUserRoles struct {
	Roles []string `json:"roles"`
}

AuthenticatedUserRoles represents the details of the authenticated user's roles

type BulkDeleteExecutionFailureResponse

type BulkDeleteExecutionFailureResponse struct {
	ID      string `json:"id"`
	Message string `json:"message"`
}

BulkDeleteExecutionFailureResponse represents an individual bulk delete executions failure entry

type BulkDeleteExecutionsResponse

type BulkDeleteExecutionsResponse struct {
	FailedCount   int                                  `json:"failedCount"`
	SuccessCount  int                                  `json:"successCount"`
	AllSuccessful bool                                 `json:"allsuccessful"`
	RequestCount  int                                  `json:"requestCount"`
	Failures      []BulkDeleteExecutionFailureResponse `json:"failures"`
}

BulkDeleteExecutionsResponse represents a bulk delete execution response

type BulkDeleteJobResponse

type BulkDeleteJobResponse struct {
	RequestCount  int                    `json:"requestCount"`
	AllSuccessful bool                   `json:"allSuccessful"`
	Succeeded     []BulkJobEntryResponse `json:"succeeded"`
	Failed        []BulkJobEntryResponse `json:"failed"`
}

BulkDeleteJobResponse represents a bulk job delete response

type BulkJobEntryResponse

type BulkJobEntryResponse struct {
	ID        string `json:"id"`
	Message   string `json:"message"`
	ErrorCode string `json:"errorCode,omitempty"`
}

BulkJobEntryResponse represents a bulk job entry response

type BulkToggleEntryResponse

type BulkToggleEntryResponse struct {
	ID        string `json:"id"`
	ErrorCode string `json:"errorCode,omitempty"`
	Message   string `json:"message"`
}

BulkToggleEntryResponse represents an individual entry in a BulkToggleResponse

type BulkToggleResponse

type BulkToggleResponse struct {
	Enabled       bool                      `json:"enabled"`
	AllSuccessful bool                      `json:"allsuccessful"`
	RequestCount  int                       `json:"requestCount"`
	Failed        []BulkToggleEntryResponse `json:"failed"`
	Succeeded     []BulkToggleEntryResponse `json:"succeeded"`
}

BulkToggleResponse represents a bulk toggle response

{
  "requestCount": #integer#,
  "enabled": true/false,
  "allsuccessful": true/false,
  "succeeded": [...],
  "failed":[...]
}

The list of succeeded/failed will contain objects of this form:

{
  "id": "[UUID]",
  "errorCode": "(error code, see above)",
  "message": "(success or failure message)"
}

type ErrorResponse

type ErrorResponse struct {
	IsError    bool   `json:"error"`
	APIVersion int    `json:"apiVersion"`
	ErrorCode  string `json:"errorCode"`
	Message    string `json:"message"`
}

ErrorResponse is the response for an api error

type ExecutionInputFileResponse

type ExecutionInputFileResponse struct {
	ID             string    `json:"id"`
	User           string    `json:"user"`
	FileState      string    `json:"fileState"`
	SHA            string    `json:"sha"`
	JobID          string    `json:"jobId"`
	DateCreated    *JSONTime `json:"dateCreated"`
	ServerNodeUUID string    `json:"serverNodeUUID"`
	FileName       string    `json:"fileName"`
	Size           int64     `json:"size"`
	ExpirationDate *JSONTime `json:"expirationDate"`
	ExecID         int       `json:"execId"`
}

ExecutionInputFileResponse is an individual execution input file entry response

type ExecutionInputFilesResponse

type ExecutionInputFilesResponse struct {
	Files []ExecutionInputFileResponse `json:"files"`
}

ExecutionInputFilesResponse is a response for listing execution input files

type ExecutionJobEntryResponse

type ExecutionJobEntryResponse struct {
	ID              string            `json:"id"`
	AverageDuration int64             `json:"averageDuration"`
	Name            string            `json:"name"`
	Group           string            `json:"group"`
	Project         string            `json:"project"`
	Description     string            `json:"description"`
	HRef            string            `json:"href"`
	Permalink       string            `json:"permalink"`
	Options         map[string]string `json:"options"`
}

ExecutionJobEntryResponse represents an individual job execution entry response

type ExecutionOutputResponse

type ExecutionOutputResponse struct {
	ID             string  `json:"id"`
	Offset         string  `json:"offset"`
	Completed      bool    `json:"completed"`
	ExecCompleted  bool    `json:"execCompleted"`
	HasFailedNodes bool    `json:"hasFailedNodes"`
	ExecState      string  `json:"execState"`
	LastModified   string  `json:"lastModified"`
	ExecDuration   int     `json:"execDuration"`
	PercentLoaded  float64 `json:"percentLoaded"`
	TotalSize      int     `json:"totalSize"`
	RetryBackoff   int     `json:"retryBackoff"`
	ClusterExec    bool    `json:"clusterExec"`
	ServerNodeUUID string  `json:"serverNodeUUID"`
	Compacted      bool    `json:"compacted"`
	Entries        []struct {
		Time         string    `json:"time"`
		AbsoluteTime *JSONTime `json:"absolute_time"`
		Log          string    `json:"log"`
		Level        string    `json:"level"`
		User         string    `json:"user"`
		StepCTX      string    `json:"stepctx"`
		Node         string    `json:"node"`
	} `json:"entries"`
}

ExecutionOutputResponse is the response for getting execution output

type ExecutionResponse

type ExecutionResponse struct {
	ID           int    `json:"id"`
	HRef         string `json:"href"`
	Permalink    string `json:"permalink"`
	Status       string `json:"status"`
	CustomStatus string `json:"customStatus"`
	Project      string `json:"project"`
	User         string `json:"user"`
	ServerUUID   string `json:"serverUUID"`
	DateStarted  struct {
		UnixTime int64     `json:"unixtime"`
		Date     *JSONTime `json:"date"`
	} `json:"date-started"`
	DateEnded struct {
		UnixTime int64     `json:"unixtime"`
		Date     *JSONTime `json:"date"`
	} `json:"date-ended"`
	Job             ExecutionJobEntryResponse `json:"job"`
	Description     string                    `json:"description"`
	ArgString       string                    `json:"argstring"`
	SuccessfulNodes []string                  `json:"successfulNodes"`
	FailedNodes     []string                  `json:"failedNodes"`
}

ExecutionResponse represents an individual execution response

type ExecutionStateNodeEntryResponse

type ExecutionStateNodeEntryResponse struct {
	ExecutionState string `json:"executionState"`
	StepCtx        string `json:"stepctx"`
}

ExecutionStateNodeEntryResponse represents an individual node entry response

type ExecutionStateResponse

type ExecutionStateResponse struct {
	Completed      bool                                         `json:"completed"`
	ExecutionState string                                       `json:"executionState"`
	EndTime        *JSONTime                                    `json:"endTime"`
	ServerNode     string                                       `json:"serverNode"`
	StartTime      *JSONTime                                    `json:"startTime"`
	UpdateTime     *JSONTime                                    `json:"updateTime"`
	StepCount      int                                          `json:"stepCount"`
	AllNodes       []string                                     `json:"allNodes"`
	TargetNodes    []string                                     `json:"targetNodes"`
	Nodes          map[string][]ExecutionStateNodeEntryResponse `json:"nodes"`
	ExecutionID    int                                          `json:"executionId"`
	Steps          []interface{}                                `json:"steps"`
}

ExecutionStateResponse is an execution state response

type ExecutionStepResponse

type ExecutionStepResponse struct {
	ID              string                        `json:"id"`
	StepCTX         string                        `json:"stepctx"`
	ParameterStates map[string]interface{}        `json:"parameterStates"`
	Duration        int                           `json:"duration"`
	NodeStep        bool                          `json:"nodeStep"`
	ExecutionState  string                        `json:"executionState"`
	StartTime       *JSONTime                     `json:"startTime"`
	UpdateTime      *JSONTime                     `json:"updateTime"`
	EndTime         *JSONTime                     `json:"endTime"`
	NodeStates      map[string]*NodeStateResponse `json:"nodeStates"`
}

ExecutionStepResponse represents an execution step

type ExecutionsMetricsResponse

type ExecutionsMetricsResponse struct {
	Duration struct {
		Average *JSONDuration `json:"average"`
		Min     *JSONDuration `json:"min"`
		Max     *JSONDuration `json:"max"`
	} `json:"duration"`
	Total  int `json:"total"`
	Status struct {
		Running         int `json:"running"`
		Other           int `json:"other"`
		Aborted         int `json:"aborted"`
		Failed          int `json:"failed"`
		Succeeded       int `json:"succeeded"`
		TimedOut        int `json:"timedout"`
		FailedWithRetry int `json:"failed-with-retry"`
		Scheduled       int `json:"scheduled"`
	}
}

ExecutionsMetricsResponse represents the response for getting executions metrics

type FailedACLPolicyResponse

type FailedACLPolicyResponse struct {
	Policy string   `json:"policy"`
	Errors []string `json:"errors"`
}

FailedACLPolicyResponse represents a failed ACL policy

type FailedACLValidationResponse

type FailedACLValidationResponse struct {
	Valid    bool                      `json:"valid"`
	Policies []FailedACLPolicyResponse `json:"policies"`
}

FailedACLValidationResponse represents a failed ACL validation response

func (*FailedACLValidationResponse) FromBytes

func (a *FailedACLValidationResponse) FromBytes(f []byte) error

FromBytes returns a FaileACLValidationResponse from a byte slice

func (*FailedACLValidationResponse) FromFile

func (a *FailedACLValidationResponse) FromFile(f string) error

FromFile returns a FailedACLValidationResponse from a file

func (*FailedACLValidationResponse) FromReader

func (a *FailedACLValidationResponse) FromReader(i io.Reader) error

FromReader returns a FailedACLValidationResponse from an io.Reader

type GenericVersionedResponse

type GenericVersionedResponse struct{}

GenericVersionedResponse is for version checking Some operations don't have a response (think DELETE or PUT) but we still want to do a version check on ALL functions anyway This response simply responds to that

type GetJobSCMDiffResponse

type GetJobSCMDiffResponse struct {
	SCMResponse
	Commit struct {
		Author   string            `json:"author"`
		CommitID string            `json:"commitId"`
		Date     string            `json:"date"`
		Info     map[string]string `json:"info"`
		Message  string            `json:"message"`
	} `json:"commit,omitempty"`
	DiffContent    string `json:"diffContent"`
	ID             string `json:"id"`
	IncomingCommit struct {
		Author   string            `json:"author"`
		CommitID string            `json:"commitId"`
		Date     string            `json:"date"`
		Info     map[string]string `json:"info"`
		Message  string            `json:"message"`
	} `json:"incomingCommit,omitempty"`
	Integration string `json:"integration"`
	Project     string `json:"project"`
}

GetJobSCMDiffResponse is the response for a job scm diff http://rundeck.org/docs/api/index.html#get-job-scm-diff TODO: break Commit into its own type to avoid nested structs issues

func (*GetJobSCMDiffResponse) FromBytes

func (a *GetJobSCMDiffResponse) FromBytes(f []byte) error

FromBytes returns a GetJobSCMDiffResponse from a byte slice

func (*GetJobSCMDiffResponse) FromReader

func (a *GetJobSCMDiffResponse) FromReader(i io.Reader) error

FromReader returns a GetJobSCMDiffResponse from an io.Reader

type GetJobSCMStatusResponse

type GetJobSCMStatusResponse struct {
	SCMResponse
	Actions *[]string `json:"actions,omitempty"`
	Commit  struct {
		Author   string            `json:"author"`
		CommitID string            `json:"commitId"`
		Date     string            `json:"date"`
		Info     map[string]string `json:"info"`
		Message  string            `json:"message"`
	}
	ID          string `json:"id"`
	Integration string `json:"integration"`
	Message     string `json:"message"`
	Project     string `json:"project"`
	SynchState  string `json:"synchState"`
}

GetJobSCMStatusResponse is the response for getting a job's scm status http://rundeck.org/docs/api/index.html#get-job-scm-status Note: import status will not include any actions for the job, refer to the Project status to list import actions.

type GetProjectSCMConfigResponse

type GetProjectSCMConfigResponse struct {
	SCMResponse
	Config      *map[string]string `json:"config"`
	Enabled     bool               `json:"enabled"`
	Integration string             `json:"integration"`
	Project     string             `json:"project"`
	Type        string             `json:"type"`
}

GetProjectSCMConfigResponse is the response for getting a project's scm config http://rundeck.org/docs/api/index.html#get-project-scm-config

type GetProjectSCMStatusResponse

type GetProjectSCMStatusResponse struct {
	SCMResponse
	Actions     []string `json:"actions"`
	Integration string   `json:"integration"`
	Message     string   `json:"message,omitempty"`
	Project     string   `json:"project"`
	SynchState  string   `json:"synchState"`
}

GetProjectSCMStatusResponse is the response for getting a project's scm status http://rundeck.org/docs/api/index.html#get-project-scm-status

type GetSCMActionInputFieldsResponse

type GetSCMActionInputFieldsResponse struct {
	SCMResponse
	ActionID    string                   `json:"actionId"`
	Description string                   `json:"description"`
	Fields      []map[string]interface{} `json:"fields"`
	Integration string                   `json:"integration"`
	Title       string                   `json:"title"`
	ImportItems []struct {
		ItemID string `json:"itemId"`
		Job    struct {
			GroupPath string `json:"groupPath"`
			JobID     string `json:"jobId"`
			JobName   string `json:"jobName"`
		}
		Tracked bool `json:"tracked"`
	} `json:"importItems,omitempty"`
	ExportItems []struct {
		Deleted bool   `json:"deleted"`
		ItemID  string `json:"itemId"`
		Job     struct {
			GroupPath string `json:"groupPath"`
			JobID     string `json:"jobId"`
			JobName   string `json:"jobName"`
		}
		OriginalID string `json:"originalId"`
		Renamed    bool   `json:"renamed"`
	} `json:"exportItems,omitempty"`
}

GetSCMActionInputFieldsResponse is the response for getting a project's scm action input fields http://rundeck.org/docs/api/index.html#get-project-scm-action-input-fields http://rundeck.org/docs/api/index.html#get-job-scm-action-input-fields

type GetSCMPluginInputFieldsResponse

type GetSCMPluginInputFieldsResponse struct {
	SCMResponse
	Fields []struct {
		DefaultValue     string            `json:"defaultValue"`
		Description      string            `json:"description"`
		Name             string            `json:"name"`
		RenderingOptions map[string]string `json:"renderingOptions"`
		Required         bool              `json:"required"`
		Scope            string            `json:"scope"`
		Title            string            `json:"title"`
		Type             string            `json:"type"`
		Values           []string          `json:"values,omitempty"`
	} `json:"fields"`
	Integration string `json:"integration"`
	Type        string `json:"type"`
}

GetSCMPluginInputFieldsResponse is the response listing scm plugin input fields http://rundeck.org/docs/api/index.html#get-scm-plugin-input-fields

type HistoryEventResponse

type HistoryEventResponse struct {
	StartTime    int       `json:"starttime"`
	EndTime      int       `json:"endtime"`
	DateStarted  *JSONTime `json:"date-started"`
	DateEnded    *JSONTime `json:"date-ended"`
	Title        string    `json:"title"`
	Status       string    `json:"status"`
	StatusString string    `json:"statusString"`
	Job          *struct {
		ID        string `json:"id"`
		HRef      string `json:"href"`
		Permalink string `json:"permalink"`
	} `json:"job,omitempty"`
	Summary     string `json:"summary"`
	NodeSummary *struct {
		Succeeded int `json:"succeeded"`
		Failed    int `json:"failed"`
		Total     int `json:"total"`
	} `json:"node-summary"`
	User      string `json:"user"`
	Project   string `json:"project"`
	Execution *struct {
		ID        string `json:"id"`
		HRef      string `json:"href"`
		Permalink string `json:"permalink"`
	} `json:"execution"`
}

HistoryEventResponse represents an individual event in a history response

type HistoryResponse

type HistoryResponse struct {
	Paging *PagingResponse         `json:"paging"`
	Events []*HistoryEventResponse `json:"events"`
}

HistoryResponse represents a project history response http://rundeck.org/docs/api/index.html#listing-history

type ImportedJobEntryResponse

type ImportedJobEntryResponse struct {
	Index     int    `json:"index"`
	ID        string `json:"id"`
	Name      string `json:"name"`
	Group     string `json:"group"`
	Project   string `json:"project"`
	HRef      string `json:"href"`
	Permalink string `json:"permalink"`
	Messages  string `json:"error,omitempty"`
}

ImportedJobEntryResponse is an imported Job response

type ImportedJobResponse

type ImportedJobResponse struct {
	Succeeded []ImportedJobEntryResponse `json:"succeeded"`
	Failed    []ImportedJobEntryResponse `json:"failed"`
	Skipped   []ImportedJobEntryResponse `json:"skipped"`
}

ImportedJobResponse is an imported jobs response

type IncompleteLogStorageExecutionResponse

type IncompleteLogStorageExecutionResponse struct {
	ID        int    `json:"id"`
	Project   string `json:"project"`
	HRef      string `json:"href"`
	Permalink string `json:"permalink"`
	Storage   struct {
		LocalFilesPresent   bool      `json:"localFilesPresent"`
		IncompleteFiletypes string    `json:"incompleteFiletypes"`
		Queued              bool      `json:"queued"`
		Failed              bool      `json:"failed"`
		Date                *JSONTime `json:"date"`
	} `json:"storage"`
	Errors []string `json:"errors"`
}

IncompleteLogStorageExecutionResponse represents an incomplete log storage execution response

type IncompleteLogStorageResponse

type IncompleteLogStorageResponse struct {
	Total      int                                      `json:"total"`
	Max        int                                      `json:"max"`
	Offset     int                                      `json:"offset"`
	Executions []*IncompleteLogStorageExecutionResponse `json:"executions"`
}

IncompleteLogStorageResponse represents an incomplete log storage response

type JSONDuration

type JSONDuration struct {
	time.Duration
}

JSONDuration is for custom marshal/unmarshal of duration strings

func (*JSONDuration) UnmarshalJSON

func (d *JSONDuration) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a string into a Duration

type JSONTime

type JSONTime struct {
	time.Time
}

JSONTime is for custom marshal/unmarshal of rundeck datetime values

func (*JSONTime) UnmarshalJSON

func (t *JSONTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the rundeck datetime format

type JobCommandsYAMLResponse

type JobCommandsYAMLResponse struct {
	Commands map[string]interface{} `yaml:"commands,inline"`
}

JobCommandsYAMLResponse represents a jobs commands in a yaml job definition response

type JobExecutionsResponse

type JobExecutionsResponse ListRunningExecutionsResponse

JobExecutionsResponse is the response for listing the executions for a job

type JobMetaDataResponse

type JobMetaDataResponse struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Group           string `json:"group"`
	Project         string `json:"project"`
	Description     string `json:"description"`
	HRef            string `json:"href"`
	Permalink       string `json:"permalink"`
	Scheduled       bool   `json:"scheduled"`
	ScheduleEnabled bool   `json:"scheduleEnabled"`
	Enabled         bool   `json:"enabled"`
	AverageDuration int64  `json:"averageDuration"`
}

JobMetaDataResponse represents a job metadata response

type JobOptionFileUploadResponse

type JobOptionFileUploadResponse struct {
	Total   int               `json:"total"`
	Options map[string]string `json:"options"`
}

JobOptionFileUploadResponse represents a job option file upload response

type JobOptionYAMLResponse

type JobOptionYAMLResponse struct {
	Description string `yaml:"description,omitempty"`
	Name        string `yaml:"name"`
	Regex       string `yaml:"regex,omitempty"`
	Required    bool   `yaml:"required"`
	Value       string `yaml:"value,omitempty"`
}

JobOptionYAMLResponse represents a jobs options in a yaml job definition response

type JobResponse

type JobResponse struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Group           string `json:"group"`
	Project         string `json:"project"`
	Description     string `json:"description"`
	HRef            string `json:"href"`
	Permalink       string `json:"permalink"`
	Scheduled       bool   `json:"scheduled"`
	ScheduleEnabled bool   `json:"scheduleEnabled"`
	Enabled         bool   `json:"enabled"`
	// The following are only visible in cluster mode
	ServerNodeUUID string `json:"serverNodeUUID"`
	ServerOwned    bool   `json:"serverOwned"`
}

JobResponse represents a job response

type JobYAMLDetailResponse

type JobYAMLDetailResponse struct {
	Description        string                   `yaml:"description"`
	LogLevel           string                   `yaml:"loglevel"`
	ExecutionEnabled   string                   `yaml:"executionEnabled"`
	Group              string                   `yaml:"group"`
	ID                 string                   `yaml:"id"`
	MultipleExecutions bool                     `yaml:"multipleExecutions"`
	Name               string                   `yaml:"name"`
	NodeFilterEditable bool                     `yaml:"nodeFilterEditable"`
	Options            []*JobOptionYAMLResponse `yaml:"options,omitempty"`
	ScheduleEnabled    bool                     `yaml:"scheduleEnabled"`
	UUID               string                   `yaml:"uuid"`
	Sequence           *JobCommandsYAMLResponse `yaml:"sequence"`
}

JobYAMLDetailResponse represents the details of a yaml job definition response

type JobYAMLResponse

type JobYAMLResponse []*JobYAMLDetailResponse

JobYAMLResponse represents a rundeck job-yaml response

type JobsResponse

type JobsResponse []JobResponse

JobsResponse is a collection of JobResponse

type KeyMetaResponse

type KeyMetaResponse struct {
	RundeckKeyType     string `json:"Rundeck-key-type"`
	RundeckContentMask string `json:"Rundeck-content-mask"`
	RundeckContentSize string `json:"Rundeck-content-size"`
	RundeckContentType string `json:"Rundeck-content-type"`
}

KeyMetaResponse is the metadata about an individual list keys resource

type ListKeysResourceResponse

type ListKeysResourceResponse struct {
	Meta KeyMetaResponse `json:"meta"`
	URL  string          `json:"url"`
	Name string          `json:"name"`
	Type string          `json:"type"`
	Path string          `json:"path"`
}

ListKeysResourceResponse is an individual resource in a list keys response

type ListKeysResponse

type ListKeysResponse struct {
	Resources []ListKeysResourceResponse `json:"resources"`
	URL       string                     `json:"url"`
	Type      string                     `json:"type"`
	Path      string                     `json:"path"`
}

ListKeysResponse represents a list keys response

type ListProjectsEntryResponse

type ListProjectsEntryResponse struct {
	URL         string `json:"url"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

ListProjectsEntryResponse represents an item in a list projects response

type ListProjectsResponse

type ListProjectsResponse []*ListProjectsEntryResponse

ListProjectsResponse represents a list projects response

type ListRunningExecutionsResponse

type ListRunningExecutionsResponse struct {
	Paging     PagingResponse      `json:"paging"`
	Executions []ExecutionResponse `json:"executions"`
}

ListRunningExecutionsResponse is the response for listing the running executions for a project

type ListSCMPluginsResponse

type ListSCMPluginsResponse struct {
	SCMResponse
	Integration string              `json:"integration"`
	Plugins     []SCMPluginResponse `json:"plugins"`
}

ListSCMPluginsResponse is the response listing Scm plugins http://rundeck.org/docs/api/index.html#list-scm-plugins

type ListTokensResponse

type ListTokensResponse []TokenResponse

ListTokensResponse is a collection of `Token` http://rundeck.org/docs/api/index.html#list-tokens

type ListUserProfileResponse

type ListUserProfileResponse struct {
	Login     string    `json:"login"`
	FirstName string    `json:"firstName,omitempty"`
	LastName  string    `json:"lastName,omitempty"`
	Email     string    `json:"email,omitempty"`
	Created   *JSONTime `json:"created,omitempty"`
	Updated   *JSONTime `json:"updated,omitempty"`
	LastJob   *JSONTime `json:"lastJob,omityempty"`
	Tokens    int       `json:"tokens"`
}

ListUserProfileResponse represents the details of a user in a collection of users

type ListUsersResponse

type ListUsersResponse []ListUserProfileResponse

ListUsersResponse is a collection of `UserInfo` http://rundeck.org/docs/api/index.html#list-users

type LogStorageResponse

type LogStorageResponse struct {
	Enabled         bool   `json:"enabled"`
	PluginName      string `json:"pluginName"`
	SucceededCount  int    `json:"succeededCount"`
	FailedCount     int    `json:"failedCount"`
	QueuedCount     int    `json:"queuedCount"`
	TotalCount      int    `json:"totalCount"`
	IncompleteCount int    `json:"incompleteCount"`
	MissingCount    int    `json:"missingCount"`
}

LogStorageResponse represents a LogStorageResponse response

type NodeStateResponse

type NodeStateResponse struct {
	Duration       int       `json:"duration"`
	ExecutionState string    `json:"executionState"`
	EndTime        *JSONTime `json:"endTime"`
	UpdateTime     *JSONTime `json:"updateTime"`
	StartTime      *JSONTime `json:"startTime"`
}

NodeStateResponse represents a nodeState response

type PagingResponse

type PagingResponse struct {
	Offset int `json:"offset"`
	Max    int `json:"max"`
	Total  int `json:"total"`
	Count  int `json:"count"`
}

PagingResponse represents paging data in a response

type PerformJobSCMActionResponse

type PerformJobSCMActionResponse struct {
	SCMResponse
	Input struct {
		Message string `json:"message"`
	} `json:"input"`
}

PerformJobSCMActionResponse is the response for performing a job scm action http://rundeck.org/docs/api/index.html#perform-job-scm-action

type ProjectArchiveExportAsyncResponse

type ProjectArchiveExportAsyncResponse struct {
	Token      string `json:"token"`
	Ready      bool   `json:"ready"`
	Percentage int    `json:"percentage"`
}

ProjectArchiveExportAsyncResponse represents the response from an async project archive

type ProjectConfigItemResponse

type ProjectConfigItemResponse struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

ProjectConfigItemResponse represents the response from an individual key

type ProjectConfigResponse

type ProjectConfigResponse map[string]string

ProjectConfigResponse represents a projects configuration response

type ProjectExecutionsMetricsResponse

type ProjectExecutionsMetricsResponse ExecutionsMetricsResponse

ProjectExecutionsMetricsResponse represents the response for getting execution metrics for a project

type ProjectImportArchiveResponse

type ProjectImportArchiveResponse struct {
	ImportStatus    string    `json:"import_status"`
	Errors          *[]string `json:"errors,omitempty"`
	ExecutionErrors *[]string `json:"execution_errors,omitempty"`
	ACLErrors       *[]string `json:"acl_errors,omitempty"`
}

ProjectImportArchiveResponse represents the response from a project archive import

type ProjectInfoResponse

type ProjectInfoResponse struct {
	URL         string                 `json:"url"`
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Config      *ProjectConfigResponse `json:"config"`
}

ProjectInfoResponse represents a project's details

type ResourceCollectionResponse

type ResourceCollectionResponse ResourceResponse

ResourceCollectionResponse represents a collection of resource response

func (*ResourceCollectionResponse) FromBytes

func (a *ResourceCollectionResponse) FromBytes(f []byte) error

FromBytes returns a ResourceCollectionResponse from a byte slice

func (*ResourceCollectionResponse) FromFile

func (a *ResourceCollectionResponse) FromFile(f string) error

FromFile returns a ResourceCollectionResponse from a file

func (*ResourceCollectionResponse) FromReader

func (a *ResourceCollectionResponse) FromReader(i io.Reader) error

FromReader returns a ResourceCollectionResponse from an io.Reader

type ResourceDetailResponse

type ResourceDetailResponse struct {
	NodeName          string                                `json:"nodename"`
	Tags              string                                `json:"tags,omitempty"`
	OsFamily          string                                `json:"osFamily,omitempty"`
	OsVersion         string                                `json:"osVersion,omitempty"`
	OsArch            string                                `json:"osArch,omitempty"`
	OsName            string                                `json:"osName,omitempty"`
	SSHKeyStoragePath string                                `json:"ssh-key-storage-path,omitempty"`
	UserName          string                                `json:"username"`
	Description       string                                `json:"description,omitempty"`
	HostName          string                                `json:"hostname"`
	FileCopier        string                                `json:"file-copier"`
	NodeExectutor     string                                `json:"node-executor"`
	RemoteURL         string                                `json:"remoteUrl,omitempty"`
	EditURL           string                                `json:"editUrl,omitempty"`
	CustomProperties  *ArtbitraryResourcePropertiesResponse `json:",-"`
}

ResourceDetailResponse represents a project resource response

type ResourceResponse

type ResourceResponse map[string]ResourceDetailResponse

ResourceResponse is a single resource in a response

func (*ResourceResponse) FromBytes

func (a *ResourceResponse) FromBytes(f []byte) error

FromBytes returns a ResourceResponse from a byte slice

func (*ResourceResponse) FromFile

func (a *ResourceResponse) FromFile(f string) error

FromFile returns a ResourceResponse from a file

func (*ResourceResponse) FromReader

func (a *ResourceResponse) FromReader(i io.Reader) error

FromReader returns a ResourceResponse from an io.Reader

type SCMPluginForProjectResponse

type SCMPluginForProjectResponse struct {
	SCMResponse
	Message          string            `json:"message"`
	NextAction       string            `json:"nextAction,omitempty"`
	Success          bool              `json:"success"`
	ValidationErrors map[string]string `json:"validationErrors,omitempty"`
}

SCMPluginForProjectResponse is the response for setting up, enabling or disabling an scm plugin for a project http://rundeck.org/docs/api/index.html#setup-scm-plugin-for-a-project http://rundeck.org/docs/api/index.html#enable-scm-plugin-for-a-project http://rundeck.org/docs/api/index.html#disable-scm-plugin-for-a-project

type SCMPluginResponse

type SCMPluginResponse struct {
	SCMResponse
	Configured  bool   `json:"configured"`
	Description string `json:"description"`
	Enabled     bool   `json:"enabled"`
	Title       string `json:"title"`
	Type        string `json:"type"`
}

SCMPluginResponse is an individual Plugin entry in ListSCMPluginsResponse

type SCMResponse

type SCMResponse struct{}

SCMResponse is current a placeholder response for SCM http://rundeck.org/docs/api/index.html#scm

type SysInfoExecutionsResponse

type SysInfoExecutionsResponse struct {
	Active        bool   `json:"active"`
	ExecutionMode string `json:"executionMode"`
}

SysInfoExecutionsResponse represents an executions response in a systeminfo response

type SysInfoJVMResponse

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

SysInfoJVMResponse represents a jvm response

type SysInfoMetricsResponse

type SysInfoMetricsResponse struct {
	HRef        string `json:"href"`
	ContentType string `json:"contentType"`
}

SysInfoMetricsResponse is a metrics response

type SysInfoOSResponse

type SysInfoOSResponse struct {
	Arch    string `json:"arch"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

SysInfoOSResponse represents an OS response

type SysInfoRundeckResponse

type SysInfoRundeckResponse struct {
	Version    string `json:"version"`
	Build      string `json:"build"`
	Node       string `json:"node"`
	Base       string `json:"base"`
	APIVersion int    `json:"apiversion"`
	ServerUUID string `json:"serverUUID"`
}

SysInfoRundeckResponse represents a rundeck response

type SysInfoStatsResponse

type SysInfoStatsResponse struct {
	Uptime *struct {
		Duration int64                     `json:"duration"`
		Unit     string                    `json:"unit"`
		Since    *SysInfoTimestampResponse `json:"since"`
	} `json:"uptime"`
	CPU *struct {
		Processors  int `json:"processors"`
		LoadAverage struct {
			Unit    string  `json:"unit"`
			Average float64 `json:"average"`
		} `json:"loadAverage"`
	} `json:"cpu"`
	Memory *struct {
		Unit  string `json:"unit"`
		Max   int64  `json:"max"`
		Free  int64  `json:"free"`
		Total int64  `json:"total"`
	} `json:"memory"`
	Scheduler *struct {
		Running        int `json:"running"`
		ThreadPoolSize int `json:"threadPoolSize"`
	} `json:"scheduler"`
	Threads *struct {
		Active int `json:"active"`
	} `json:"threads"`
}

SysInfoStatsResponse is a stats response

type SysInfoThreadDumpResponse

type SysInfoThreadDumpResponse struct {
	HRef        string `json:"href"`
	ContentType string `json:"contentType"`
}

SysInfoThreadDumpResponse is a thread dump response

type SysInfoTimestampResponse

type SysInfoTimestampResponse struct {
	Epoch    int64     `json:"epoch"`
	Unit     string    `json:"unit"`
	DateTime *JSONTime `json:"datetime"`
}

SysInfoTimestampResponse represents a timestamp response

type SystemInfoResponse

type SystemInfoResponse struct {
	System *SystemsResponse `json:"system"`
}

SystemInfoResponse represents a system info response http://rundeck.org/docs/api/index.html#system-info

func (*SystemInfoResponse) FromBytes

func (a *SystemInfoResponse) FromBytes(f []byte) error

FromBytes returns a SystemInfoResponse from a byte slice

func (*SystemInfoResponse) FromFile

func (a *SystemInfoResponse) FromFile(f string) error

FromFile returns a SystemInfoResponse from a file

func (*SystemInfoResponse) FromReader

func (a *SystemInfoResponse) FromReader(i io.Reader) error

FromReader returns a SystemInfoResponse from an io.Reader

type SystemsResponse

type SystemsResponse struct {
	Timestamp  *SysInfoTimestampResponse  `json:"timestamp"`
	Rundeck    *SysInfoRundeckResponse    `json:"rundeck"`
	Executions *SysInfoExecutionsResponse `json:"executions"`
	OS         *SysInfoOSResponse         `json:"os"`
	JVM        *SysInfoJVMResponse        `json:"jvm"`
	Stats      *SysInfoStatsResponse      `json:"stats"`
	Metrics    *SysInfoMetricsResponse    `json:"metrics"`
	ThreadDump *SysInfoThreadDumpResponse `json:"threadDump"`
}

SystemsResponse represents a systems response http://rundeck.org/docs/api/index.html#system-info

type ToggleResponse

type ToggleResponse struct {
	Success bool `json:"success"`
}

ToggleResponse is the response for a toggled job, exeuction or schedule

type TokenResponse

type TokenResponse struct {
	ID         string    `json:"id,omitempty"`
	User       string    `json:"user,omitempty"`
	Token      string    `json:"token,omitempty"`
	Creator    string    `json:"creator,omitempty"`
	Expiration *JSONTime `json:"expiration,omitempty"`
	Roles      []string  `json:"roles,omitempty"`
	Expired    bool      `json:"expired,omitempty"`
}

TokenResponse represents a user and token http://rundeck.org/docs/api/index.html#get-a-token

func (*TokenResponse) FromBytes

func (t *TokenResponse) FromBytes(f []byte) error

FromBytes returns a TokenResponse from a byte slice

func (*TokenResponse) FromFile

func (t *TokenResponse) FromFile(f string) error

FromFile returns a TokenResponse from a file

func (*TokenResponse) FromReader

func (t *TokenResponse) FromReader(i io.Reader) error

FromReader returns a TokenResponse from an io.Reader

type UploadedJobInputFileResponse

type UploadedJobInputFileResponse struct {
	ID             string    `json:"id"`
	User           string    `json:"user"`
	FileState      string    `json:"fileState"`
	SHA            string    `json:"sha"`
	JobID          string    `json:"jobId"`
	DateCreated    *JSONTime `json:"dateCreated"`
	ServerNodeUUID string    `json:"serverNodeUUID"`
	FileName       string    `json:"fileName"`
	Size           int64     `json:"size"`
	ExpirationDate *JSONTime `json:"expirationDate"`
	ExecID         int       `json:"execId"`
}

UploadedJobInputFileResponse represents an entry in an UploadedJobInputFilesResponse

type UploadedJobInputFilesResponse

type UploadedJobInputFilesResponse struct {
	Paging PagingResponse                 `json:"paging"`
	Files  []UploadedJobInputFileResponse `json:"files"`
}

UploadedJobInputFilesResponse is a response to an uploaded job input file list request

type UserProfileResponse

type UserProfileResponse struct {
	Login     string `json:"login"`
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
	Email     string `json:"email,omitempty"`
}

UserProfileResponse represents a user info response http://rundeck.org/docs/api/index.html#get-user-profile

type VersionedResponse

type VersionedResponse interface {
	// contains filtered or unexported methods
}

VersionedResponse is an interface for a Rundeck Response that supports versioning information

type WorkflowResponse

type WorkflowResponse struct {
	Completed      bool          `json:"completed"`
	EndTime        *JSONTime     `json:"endTime"`
	StartTime      *JSONTime     `json:"startTime"`
	UpdateTime     *JSONTime     `json:"updateTime"`
	StepCount      int           `json:"stepCount"`
	AllNodes       []string      `json:"allNodes"`
	TargetNodes    []string      `json:"targetNodes"`
	ExecutionState string        `json:"executionState"`
	Steps          []interface{} `json:"steps"`
}

WorkflowResponse represents a workflow response

type WorkflowStepResponse

type WorkflowStepResponse struct {
	ID              string                 `json:"id"`
	StepCTX         string                 `json:"stepctx"`
	ParameterStates map[string]interface{} `json:"parameterStates"`
	Duration        int                    `json:"duration"`
	NodeStep        bool                   `json:"nodeStep"`
	ExecutionState  string                 `json:"executionState"`
	StartTime       *JSONTime              `json:"startTime"`
	UpdateTime      *JSONTime              `json:"updateTime"`
	EndTime         *JSONTime              `json:"endTime"`
	Workflow        *WorkflowResponse      `json:"workflow"`
	HasSubworkFlow  bool                   `json:"hasSubworkFlow"`
}

WorkflowStepResponse represents a workflow step response

Jump to

Keyboard shortcuts

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