Documentation ¶
Index ¶
- Constants
- Variables
- func AddAction(name string, params []Parameter, requirements []Requirement) error
- func AddActionStep(actionName string, child Action) error
- func AddApplication(key, appName string) error
- func AddApplicationFromReposManager(projectkey, rmname, repoFullname string) error
- func AddApplicationPipeline(projectKey, appName, pipelineName string) error
- func AddApplicationVariable(projectKey, appName, varName, varValue string, varType VariableType) error
- func AddCapabilityToWorkerModel(modelID int64, name string, capaType string, value string) error
- func AddEnvironment(key, envName string) error
- func AddEnvironmentVariable(projectKey, envName, varName, varValue string, varType VariableType) error
- func AddGroup(name string) error
- func AddGroupInApplication(projectKey, appName, groupName string, permission int) error
- func AddGroupInEnvironment(projectKey, envName, groupName string, permission int) error
- func AddGroupInPipeline(projectKey, pipelineName, groupName string, permission int) error
- func AddGroupInProject(projectKey, groupname string, permission int, recursive bool) error
- func AddHookOnRepositoriesManager(projectKey, appName, reposManager, repoFullname, pipelineName string) error
- func AddJoinedAction(projectKey, pipelineName string, stageID int64, a *Action) error
- func AddParameterInPipeline(...) error
- func AddPipeline(name string, projectKey string, pipelineType PipelineType, params []Parameter) error
- func AddProject(name, key, groupName string) error
- func AddProjectVariable(key, name, val string, t VariableType) error
- func AddStage(projectKey, pipelineName, name string) error
- func AddTrigger(t *PipelineTrigger) error
- func AddUser(name, fname, email, callback string) error
- func AddUsersInGroup(groupName string, users []string) error
- func AddVariableInProject(projectKey, varName, varValue, varType string) error
- func AttachApplicationToReposistoriesManager(projectKey, appName, reposManager, repoFullname string) error
- func AttachPipeline(key, app, pip string) error
- func Authorization(h string)
- func ChangeStageState(projectKey, pipelineName, pipelineStageID string, enabled bool) error
- func ConnectReposManager(key, name string) (string, string, error)
- func ConnectReposManagerCallback(key, name, requestToken, verifier string) (string, string, error)
- func DecodeError(data []byte) error
- func DeleteAction(name string) error
- func DeleteApplication(pk, name string) error
- func DeleteEnvironment(pk, name string) error
- func DeleteHook(project, application, pipeline string, id int64) error
- func DeleteHookOnRepositoriesManager(projectKey, appName, reposManager string, hookID int64) error
- func DeletePipeline(key, name string) error
- func DeletePipelineAction(projectKey string, pipelineName string, actionPipelineID int64) error
- func DeletePipelineScheduler(projectKey, appName, pipelineName string, s *PipelineScheduler) error
- func DeletePlugin(name string) error
- func DeleteProject(key string) error
- func DeleteStage(projectKey, pipelineName, pipelineStageID string) error
- func DeleteTemplate(name string) error
- func DeleteTrigger(proj, app, pip string, id int64) error
- func DeleteUser(name string) error
- func DeleteWorkerCapability(workerModelID int64, capaName string) error
- func DeleteWorkerModel(workerModelID int64) error
- func DetachApplicationToReposistoriesManager(projectKey, appName, reposManager string) error
- func DisableWorker(workerID string) error
- func DisconnectReposManager(key, name string) error
- func DisplayStream(buffer io.ReadCloser) error
- func DownloadArtifact(project, app, pip, tag, destdir, env, filename string) error
- func DownloadArtifacts(project string, application string, pipeline string, tag string, ...) error
- func DownloadPlugin(name string, destdir string) error
- func Exit(format string, args ...interface{})
- func GenerateWorkerToken(group string, e Expiration) (string, error)
- func GetStatus() ([]string, error)
- func GetVersion() (string, error)
- func InitEndpoint(en string)
- func IsAdmin() (bool, error)
- func IsInArray(elt string, array []string) bool
- func MoveActionInPipeline(projectKey, pipelineName string, actionPipelineID int64, newOrder int) error
- func MoveStage(projectKey, pipelineName string, pipelineStageID int64, buildOrder int) error
- func NeedPlaceholder(t VariableType) bool
- func Options(h, u, p, t string)
- func ProcessError(target error, al string) (string, int)
- func ReadConfig() error
- func RemoveApplicationPipeline(projectKey, appName, pipelineName string) error
- func RemoveApplicationVariable(projectKey, appName, varName string) error
- func RemoveEnvironmentVariable(projectKey, envName, varName string) error
- func RemoveGroup(name string) error
- func RemoveGroupFromApplication(projectKey, appName, groupName string) error
- func RemoveGroupFromEnvironment(projectKey, envName, groupName string) error
- func RemoveGroupFromPipeline(projectKey, pipelineName, groupName string) error
- func RemoveGroupFromProject(projectKey, groupname string) error
- func RemoveParameterFromPipeline(projectKey, pipelineName, paramName string) error
- func RemoveProject(key string) error
- func RemoveUserFromGroup(groupName string, userName string) error
- func RemoveVariableFromProject(projectKey, varName string) error
- func RenameApplication(pk, name, newName string) error
- func RenameGroup(oldName, newName string) error
- func RenameProject(key, newName string) error
- func RenameStage(projectKey, pipelineName, pipelineStageID, newName string) error
- func RenameUser(name, fname string) error
- func Request(method string, path string, args []byte, mods ...RequestModifier) ([]byte, int, error)
- func ResetUser(name, email, callback string) error
- func RestartPipeline(key, app, pip, env string, bn int) (chan Log, error)
- func RunPipeline(key, appName, name, env string, stream bool, request RunRequest, ...) (chan Log, error)
- func SetAgent(a Agent)
- func SetHTTPClient(c HTTPClient)
- func SetRetry(n int)
- func SetUserGroupAdmin(groupName string, userName string) error
- func SetWorkerStatus(s Status) error
- func Stream(method string, path string, args []byte, mods ...RequestModifier) (io.ReadCloser, int, error)
- func StreamPipelineBuild(key, appName, pipelineName, env string, buildID int, followTrigger bool) (chan Log, error)
- func UnsetUserGroupAdmin(groupName string, userName string) error
- func UpdateAction(a Action) error
- func UpdateApplicationPipeline(projectKey, appName, pipelineName string, params []Parameter) error
- func UpdateApplicationVariable(projectKey, appName, oldName, varName, varValue, varType string) error
- func UpdateCapabilityToWorkerModel(modelID int64, name string, capaType string, value string) error
- func UpdateEnvironment(key, oldName, newName string) error
- func UpdateEnvironmentVariable(projectKey, envName, oldVarName, varName, varValue, varType string) error
- func UpdateGroupInApplication(projectKey, appName, groupName string, permission int) error
- func UpdateGroupInEnvironment(projectKey, envName, groupName string, permission int) error
- func UpdateGroupInPipeline(projectKey, pipelineName, groupName string, permission int) error
- func UpdateGroupInProject(projectKey, groupname string, permission int) error
- func UpdateJoinedAction(projectKey, pipelineName string, stage int, a Action) error
- func UpdateParameterInPipeline(...) error
- func UpdateTrigger(t *PipelineTrigger) error
- func UpdateUserEmail(name, email string) error
- func UpdateUsername(oldUsername, newUsername string) error
- func UpdateVariableInProject(projectKey, oldName, varName, varValue, varType string) error
- func UpdateWorkerModel(id int64, name string, t string, value string) error
- func Upload(method string, path string, body io.ReadCloser, mods ...RequestModifier) ([]byte, int, error)
- func UploadArtifact(project string, pipeline string, application string, tag string, ...) error
- func UploadMultiPart(method string, path string, body *bytes.Buffer, mods ...RequestModifier) ([]byte, int, error)
- func UploadPlugin(filePath string, update bool) ([]byte, error)
- func UploadTemplate(filePath string, update bool, name string) ([]byte, error)
- type Action
- func GetAction(name string) (Action, error)
- func ImportAction(action *Action) (*Action, error)
- func ListActions() ([]Action, error)
- func NewAction(name string) *Action
- func NewActionArtifactDownload(path, tag string) Action
- func NewActionArtifactUpload(path, tag string) Action
- func NewActionFromRemoteScript(url string, params []Parameter) (*Action, error)
- func NewActionFromScript(btes []byte) (*Action, error)
- func NewActionJUnit(path string) Action
- func NewActionPlugin(pluginname string, parameters []Parameter) Action
- func NewActionScript(script string, requirements []Requirement) Action
- func NewJoinedAction(actionName string, parameters []Parameter) (*Action, error)
- func NewScriptAction(content string) Action
- type ActionAudit
- type ActionBuild
- type ActionPlugin
- type ActionScript
- type Agent
- type Application
- type ApplicationGroup
- type ApplicationPipeline
- type ApplyTemplatesOptions
- type Artifact
- type Auth
- type BuildState
- type CDPipeline
- type Environment
- type EnvironmentGroup
- type Error
- type Event
- type EventEngine
- type EventJob
- type EventNotif
- type EventPipelineBuild
- type Expiration
- type Group
- type GroupPermission
- type HTTPClient
- type Hatchery
- type Hook
- type JabberEmailUserNotificationSettings
- type Job
- type Log
- type Mod
- type Model
- type ModelStatus
- type OpenstackModelData
- type Parameter
- type ParameterType
- type Pipeline
- type PipelineAction
- type PipelineBuild
- func GetBuildState(projectKey, appName, pipelineName, env, buildID string) (PipelineBuild, error)
- func GetBuildingPipelineByHash(hash string) ([]PipelineBuild, error)
- func GetBuildingPipelines() ([]PipelineBuild, error)
- func GetPipelineBuildHistory(key, appName, name, env string) ([]PipelineBuild, error)
- func GetPipelineBuildStatus(proj, app, pip, env string, buildNumber int64) (PipelineBuild, error)
- type PipelineBuildTrigger
- type PipelineGroup
- type PipelineScheduler
- func AddPipelineScheduler(projectKey, appName, pipelineName, cronExpr, envName string, ...) (*PipelineScheduler, error)
- func GetPipelineScheduler(projectKey, appName, pipelineName string) ([]PipelineScheduler, error)
- func UpdatePipelineScheduler(projectKey, appName, pipelineName string, s *PipelineScheduler) (*PipelineScheduler, error)
- type PipelineSchedulerExecution
- type PipelineTrigger
- type PipelineType
- type Prerequisite
- type Project
- type ProjectGroup
- type ProjectLastUpdates
- type RepositoriesManager
- type RepositoriesManagerClient
- type RepositoriesManagerDriver
- type RepositoriesManagerType
- type Repository
- type RepositoryPoller
- type RequestModifier
- type Requirement
- type Result
- type RunRequest
- type Stage
- type Stats
- type Status
- type Template
- type TemplateExtension
- type TemplateParam
- type Test
- type TestSuite
- type Tests
- type User
- type UserAPIRequest
- type UserAPIResponse
- type UserLoginRequest
- type UserNotification
- type UserNotificationEventType
- type UserNotificationSettings
- type UserNotificationSettingsType
- type UserNotificationTemplate
- type UserToken
- type VCSAuthor
- type VCSBranch
- type VCSCommit
- type VCSPushEvent
- type VCSRepo
- type Variable
- func GetEnvironmentVariable(projectKey, envName, varName string) (*Variable, error)
- func GetVariableInApplication(projectKey, appName, name string) (*Variable, error)
- func GetVariableInProject(projectKey, name string) (*Variable, error)
- func ShowApplicationVariable(projectKey, appName string) ([]Variable, error)
- func ShowEnvironmentVariable(projectKey, envName string) ([]Variable, error)
- func ShowVariableInProject(projectKey string) ([]Variable, error)
- type VariableAudit
- type VariableType
- type Warning
- type Week
- type Worker
Constants ¶
const ( DefaultAction = "Default" BuiltinAction = "Builtin" PluginAction = "Plugin" JoinedAction = "Joined" )
Action type
const ( ScriptAction = "Script" NotifAction = "Notif" JUnitAction = "JUnit" )
Builtin Action
const ( //BinaryRequirement refers to the need to a specific binary on host running the action BinaryRequirement = "binary" // NetworkAccessRequirement refers to the need of an opened network acces to given endpoint. NetworkAccessRequirement = "network" // ModelRequirement refers to the need fo a specific model ModelRequirement = "model" // HostnameRequirement checks the hostname of the worker HostnameRequirement = "hostname" //PluginRequirement installs & checks plugins of the worker PluginRequirement = "plugin" //ServiceRequirement links a service to a worker ServiceRequirement = "service" //MemoryRequirement set memory limit on a container MemoryRequirement = "memory" )
const ( ArtifactUpload = "Artifact Upload" ArtifactDownload = "Artifact Download" )
Builtin artifact manipulation actions
const ( SDKAgent Agent = "CDS/sdk" WorkerAgent = "CDS/worker" HatcheryAgent = "CDS/hatchery" )
Different values of agent
const ( Docker = "docker" HostProcess = "host" Openstack = "openstack" )
Existing worker type
const (
ArtifactFileName = "ARTIFACT-FILENAME"
)
Header name for artifact upload
const NamePattern = "^[a-zA-Z0-9._-]{1,}$"
NamePattern Pattern for project/application/pipeline/group name
const (
PasswordPlaceholder string = "**********"
)
Value of passwords when leaving the API
const ProjectKeyPattern = "^[A-Z0-9]{1,}$"
ProjectKeyPattern pattern for project key
const UserEmailPattern = "(\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,3})"
UserEmailPattern pattern for user email address
const VERSION = "0.1.0"
VERSION of CDS SDK
Variables ¶
var ( ErrUnknownError = &Error{ID: 1, Status: http.StatusInternalServerError} ErrActionAlreadyUpdated = &Error{ID: 2, Status: http.StatusBadRequest} ErrNoAction = &Error{ID: 3, Status: http.StatusNotFound} ErrActionLoop = &Error{ID: 4, Status: http.StatusBadRequest} ErrInvalidID = &Error{ID: 5, Status: http.StatusBadRequest} ErrInvalidProject = &Error{ID: 6, Status: http.StatusBadRequest} ErrInvalidProjectKey = &Error{ID: 7, Status: http.StatusBadRequest} ErrProjectHasPipeline = &Error{ID: 8, Status: http.StatusConflict} ErrProjectHasApplication = &Error{ID: 9, Status: http.StatusConflict} ErrForbidden = &Error{ID: 11, Status: http.StatusForbidden} ErrPipelineNotFound = &Error{ID: 12, Status: http.StatusBadRequest} ErrPipelineNotAttached = &Error{ID: 13, Status: http.StatusBadRequest} ErrNoEnvironmentProvided = &Error{ID: 14, Status: http.StatusBadRequest} ErrEnvironmentProvided = &Error{ID: 15, Status: http.StatusBadRequest} ErrUnknownEnv = &Error{ID: 16, Status: http.StatusBadRequest} ErrEnvironmentExist = &Error{ID: 17, Status: http.StatusConflict} ErrNoPipelineBuild = &Error{ID: 18, Status: http.StatusNotFound} ErrApplicationNotFound = &Error{ID: 19, Status: http.StatusNotFound} ErrGroupNotFound = &Error{ID: 20, Status: http.StatusNotFound} ErrInvalidUsername = &Error{ID: 21, Status: http.StatusBadRequest} ErrInvalidEmail = &Error{ID: 22, Status: http.StatusBadRequest} ErrGroupPresent = &Error{ID: 23, Status: http.StatusBadRequest} ErrInvalidName = &Error{ID: 24, Status: http.StatusBadRequest} ErrInvalidUser = &Error{ID: 25, Status: http.StatusBadRequest} ErrBuildArchived = &Error{ID: 26, Status: http.StatusBadRequest} ErrNoEnvironment = &Error{ID: 27, Status: http.StatusNotFound} ErrModelNameExist = &Error{ID: 28, Status: http.StatusConflict} ErrNoWorkerModel = &Error{ID: 29, Status: http.StatusNotFound} ErrNoProject = &Error{ID: 30, Status: http.StatusNotFound} ErrVariableExists = &Error{ID: 31, Status: http.StatusConflict} ErrInvalidGroupPattern = &Error{ID: 32, Status: http.StatusBadRequest} ErrGroupExists = &Error{ID: 33, Status: http.StatusConflict} ErrNotEnoughAdmin = &Error{ID: 34, Status: http.StatusBadRequest} ErrInvalidProjectName = &Error{ID: 35, Status: http.StatusBadRequest} ErrInvalidApplicationPattern = &Error{ID: 36, Status: http.StatusBadRequest} ErrInvalidPipelinePattern = &Error{ID: 37, Status: http.StatusBadRequest} ErrNotFound = &Error{ID: 38, Status: http.StatusNotFound} ErrNoWorkerModelCapa = &Error{ID: 39, Status: http.StatusNotFound} ErrNoHook = &Error{ID: 40, Status: http.StatusNotFound} ErrNoAttachedPipeline = &Error{ID: 41, Status: http.StatusNotFound} ErrNoReposManager = &Error{ID: 42, Status: http.StatusNotFound} ErrNoReposManagerAuth = &Error{ID: 43, Status: http.StatusUnauthorized} ErrNoReposManagerClientAuth = &Error{ID: 44, Status: http.StatusForbidden} ErrRepoNotFound = &Error{ID: 45, Status: http.StatusNotFound} ErrSecretStoreUnreachable = &Error{ID: 46, Status: http.StatusMethodNotAllowed} ErrSecretKeyFetchFailed = &Error{ID: 47, Status: http.StatusMethodNotAllowed} ErrInvalidGoPath = &Error{ID: 48, Status: http.StatusBadRequest} ErrCommitsFetchFailed = &Error{ID: 49, Status: http.StatusNotFound} ErrInvalidSecretFormat = &Error{ID: 50, Status: http.StatusInternalServerError} ErrUnknownTemplate = &Error{ID: 51, Status: http.StatusNotFound} ErrNoPreviousSuccess = &Error{ID: 52, Status: http.StatusNotFound} ErrNoEnvExecution = &Error{ID: 53, Status: http.StatusForbidden} ErrSessionNotFound = &Error{ID: 54, Status: http.StatusUnauthorized} ErrInvalidSecretValue = &Error{ID: 55, Status: http.StatusBadRequest} ErrPipelineHasApplication = &Error{ID: 56, Status: http.StatusBadRequest} ErrNoDirectSecretUse = &Error{ID: 57, Status: http.StatusForbidden} ErrNoBranch = &Error{ID: 58, Status: http.StatusNotFound} ErrLDAPConn = &Error{ID: 59, Status: http.StatusInternalServerError} ErrParseUserNotification = &Error{ID: 61, Status: http.StatusBadRequest} ErrNotSupportedUserNotification = &Error{ID: 62, Status: http.StatusBadRequest} ErrGroupNeedAdmin = &Error{ID: 63, Status: http.StatusBadRequest} ErrGroupNeedWrite = &Error{ID: 64, Status: http.StatusBadRequest} ErrNoVariable = &Error{ID: 65, Status: http.StatusNotFound} ErrPluginInvalid = &Error{ID: 66, Status: http.StatusBadRequest} ErrConflict = &Error{ID: 67, Status: http.StatusConflict} ErrPipelineAlreadyAttached = &Error{ID: 68, Status: http.StatusConflict} ErrApplicationExist = &Error{ID: 69, Status: http.StatusConflict} ErrBranchNameNotProvided = &Error{ID: 70, Status: http.StatusBadRequest} ErrInfiniteTriggerLoop = &Error{ID: 71, Status: http.StatusBadRequest} ErrInvalidResetUser = &Error{ID: 72, Status: http.StatusBadRequest} ErrUserConflict = &Error{ID: 73, Status: http.StatusBadRequest} ErrWrongRequest = &Error{ID: 74, Status: http.StatusBadRequest} ErrAlreadyExist = &Error{ID: 75, Status: http.StatusConflict} ErrInvalidType = &Error{ID: 76, Status: http.StatusBadRequest} ErrParentApplicationAndPipelineMandatory = &Error{ID: 77, Status: http.StatusBadRequest} ErrNoParentBuildFound = &Error{ID: 78, Status: http.StatusNotFound} ErrParameterExists = &Error{ID: 79, Status: http.StatusConflict} ErrNoHatchery = &Error{ID: 80, Status: http.StatusNotFound} )
Existing CDS errors Note: the error id is useless except to ensure objects are different in map
var ( // Host defines the endpoint for all SDK requests Host string // AuthHeader is used as HTTP header AuthHeader = "X_AUTH_HEADER" // RequestedWithHeader is used as HTTP header RequestedWithHeader = "X-Requested-With" // RequestedWithValue is used as HTTP header RequestedWithValue = "X-CDS-SDK" //SessionTokenHeader is user as HTTP header SessionTokenHeader = "Session-Token" // CDSConfigFile is path to the default config file CDSConfigFile = path.Join(os.Getenv("HOME"), ".cds", "config.json") )
var ( // AvailableParameterType list all existing parameters type in CDS AvailableParameterType = []string{ string(StringParameter), string(NumberParameter), string(TextParameter), string(EnvironmentParameter), string(BooleanParameter), string(ListParameter), string(PipelineParameter), } )
var AvailablePipelineType = []string{ string(BuildPipeline), string(DeploymentPipeline), string(TestingPipeline), }
AvailablePipelineType List of all pipeline type
var ( // AvailableRequirementsType List of all requirements AvailableRequirementsType = []string{ BinaryRequirement, NetworkAccessRequirement, ModelRequirement, HostnameRequirement, PluginRequirement, ServiceRequirement, MemoryRequirement, } )
var ( // AvailableVariableType list all exising variable type in CDS AvailableVariableType = []VariableType{ SecretVariable, TextVariable, StringVariable, KeyVariable, BooleanVariable, NumberVariable, } )
var ( // AvailableWorkerModelType List of all worker model type AvailableWorkerModelType = []string{ string(Docker), string(HostProcess), string(Openstack), } )
var DefaultEnv = Environment{
ID: 1,
Name: "NoEnv",
}
DefaultEnv Default environment for pipeline build
var SupportedLanguages = []language.Tag{ language.AmericanEnglish, language.French, }
SupportedLanguages on API errors
Functions ¶
func AddAction ¶
func AddAction(name string, params []Parameter, requirements []Requirement) error
AddAction creates a new action available only to creator by default params are stringParameter only (for now), with no description
func AddActionStep ¶
AddActionStep add a new step of type Action to given action
func AddApplication ¶
AddApplication create an application in the given project
func AddApplicationFromReposManager ¶
AddApplicationFromReposManager create the application from the repofullname
func AddApplicationPipeline ¶
AddApplicationPipeline add a pipeline in an application
func AddApplicationVariable ¶
func AddApplicationVariable(projectKey, appName, varName, varValue string, varType VariableType) error
AddApplicationVariable add a variable in an application
func AddCapabilityToWorkerModel ¶
AddCapabilityToWorkerModel adds a capability to given model
func AddEnvironment ¶
AddEnvironment create an environment
func AddEnvironmentVariable ¶
func AddEnvironmentVariable(projectKey, envName, varName, varValue string, varType VariableType) error
AddEnvironmentVariable add a variable in an environment
func AddGroupInApplication ¶
AddGroupInApplication add a group in an application
func AddGroupInEnvironment ¶
AddGroupInEnvironment add a group in an environment
func AddGroupInPipeline ¶
AddGroupInPipeline add a group in a pipeline
func AddGroupInProject ¶
AddGroupInProject add a group in a project
func AddHookOnRepositoriesManager ¶
func AddHookOnRepositoriesManager(projectKey, appName, reposManager, repoFullname, pipelineName string) error
AddHookOnRepositoriesManager create hook on stash
func AddJoinedAction ¶
AddJoinedAction creates a joined action in given pipeline
func AddParameterInPipeline ¶
func AddParameterInPipeline(projectKey, pipelineName, paramName, paramValue, paramType, paramDescription string) error
AddParameterInPipeline add a variable in a pipeline
func AddPipeline ¶
func AddPipeline(name string, projectKey string, pipelineType PipelineType, params []Parameter) error
AddPipeline creates a new empty pipeline
func AddProject ¶
AddProject creates a new project available only to creator by default
func AddProjectVariable ¶
func AddProjectVariable(key, name, val string, t VariableType) error
AddProjectVariable adds a project wide variable
func AddTrigger ¶
func AddTrigger(t *PipelineTrigger) error
AddTrigger adds a trigger between two pipelines
func AddUsersInGroup ¶
AddUsersInGroup call API to add users in the group
func AddVariableInProject ¶
AddVariableInProject add a variable in a project
func AttachApplicationToReposistoriesManager ¶
func AttachApplicationToReposistoriesManager(projectKey, appName, reposManager, repoFullname string) error
AttachApplicationToReposistoriesManager attachs the application to the repo identified by its fullname in the reposManager
func AttachPipeline ¶
AttachPipeline allows pipeline to be used in application context
func Authorization ¶
func Authorization(h string)
Authorization set authorization header for all next call
func ChangeStageState ¶
ChangeStageState Enabled/Disabled a stage
func ConnectReposManager ¶
ConnectReposManager add a new repositories manager in CDS for a project It returns accessToken and authorize URL
func ConnectReposManagerCallback ¶
ConnectReposManagerCallback returns accessToken and accessTokenSecret
func DeleteAction ¶
DeleteAction remove given action from CDS if action is not used in any pipeline
func DeleteApplication ¶
DeleteApplication delete an application from CDS
func DeleteEnvironment ¶
DeleteEnvironment delete an environment from CDS
func DeleteHook ¶
DeleteHook remove a hook previously created
func DeleteHookOnRepositoriesManager ¶
DeleteHookOnRepositoriesManager delete hook on stash
func DeletePipeline ¶
DeletePipeline remove given pipeline from CDS
func DeletePipelineAction ¶
DeletePipelineAction delete the given action from the given pipeline
func DeletePipelineScheduler ¶
func DeletePipelineScheduler(projectKey, appName, pipelineName string, s *PipelineScheduler) error
DeletePipelineScheduler update a pipeline scheduler
func DeleteProject ¶
DeleteProject removes a project and all its pipeline from CDS
func DeleteStage ¶
DeleteStage Call API to delete the given stage from the given pipeline
func DeleteTrigger ¶
DeleteTrigger removes a trigger between two pipelines
func DeleteWorkerCapability ¶
DeleteWorkerCapability removes a capability from given worker model
func DeleteWorkerModel ¶
DeleteWorkerModel deletes a worker model and all its capabilities
func DetachApplicationToReposistoriesManager ¶
DetachApplicationToReposistoriesManager attachs the application from any reposManager
func DisableWorker ¶
DisableWorker order the engine to disable given worker, not allowing it to take builds
func DisconnectReposManager ¶
DisconnectReposManager removes access token for the project
func DisplayStream ¶
func DisplayStream(buffer io.ReadCloser) error
DisplayStream decode each line from http buffer and print either message or error
func DownloadArtifact ¶
DownloadArtifact downloads a single artifact from API
func DownloadArtifacts ¶
func DownloadArtifacts(project string, application string, pipeline string, tag string, destdir string, env string) error
DownloadArtifacts retrieves and download artifacts related to given project-pipeline-tag and download them into destdir
func DownloadPlugin ¶
DownloadPlugin download plugin from action
func Exit ¶
func Exit(format string, args ...interface{})
Exit func display an error message on stderr and exit 1
func GenerateWorkerToken ¶
func GenerateWorkerToken(group string, e Expiration) (string, error)
GenerateWorkerToken creates a key tied to calling user that allow registering workers
func InitEndpoint ¶
func InitEndpoint(en string)
InitEndpoint force sdk package request to given endpoint
func MoveActionInPipeline ¶
func MoveActionInPipeline(projectKey, pipelineName string, actionPipelineID int64, newOrder int) error
MoveActionInPipeline Move an action in a pipeline
func NeedPlaceholder ¶
func NeedPlaceholder(t VariableType) bool
NeedPlaceholder returns true if variable type is either secret or key
func ProcessError ¶
ProcessError tries to recognize given error and return error message in a language matching Accepted-Language
func RemoveApplicationPipeline ¶
RemoveApplicationPipeline remove a pipeline from an application
func RemoveApplicationVariable ¶
RemoveApplicationVariable remove a variable from an application
func RemoveEnvironmentVariable ¶
RemoveEnvironmentVariable remove a variable from an environment
func RemoveGroupFromApplication ¶
RemoveGroupFromApplication call api to remove a group from the given application
func RemoveGroupFromEnvironment ¶
RemoveGroupFromEnvironment call api to remove a group from the given environment
func RemoveGroupFromPipeline ¶
RemoveGroupFromPipeline call api to remove a group from the given pipeline
func RemoveGroupFromProject ¶
RemoveGroupFromProject call api to remove a group from the project
func RemoveParameterFromPipeline ¶
RemoveParameterFromPipeline remove a parameter from a pipeline
func RemoveProject ¶
RemoveProject call api to delete a project
func RemoveUserFromGroup ¶
RemoveUserFromGroup call API to remove a user in the group
func RemoveVariableFromProject ¶
RemoveVariableFromProject remove a variable from a project
func RenameApplication ¶
RenameApplication renames an application from CDS
func RenameProject ¶
RenameProject call API to update project
func RenameStage ¶
RenameStage Rename a stage
func RestartPipeline ¶
RestartPipeline will have two distinct behavior: - If the pipeline build result is failed, it will only restart failed actions - If the pipeline build result is success, it will restart all actions
func RunPipeline ¶
func RunPipeline(key, appName, name, env string, stream bool, request RunRequest, followTriggers bool) (chan Log, error)
RunPipeline trigger a CDS pipeline
func SetHTTPClient ¶
func SetHTTPClient(c HTTPClient)
SetHTTPClient aims to change the default http client of the sdk
func SetUserGroupAdmin ¶
SetUserGroupAdmin grants to given user privileges on given group
func Stream ¶
func Stream(method string, path string, args []byte, mods ...RequestModifier) (io.ReadCloser, int, error)
Stream makes an authenticated http request and return io.ReadCloser
func StreamPipelineBuild ¶
func StreamPipelineBuild(key, appName, pipelineName, env string, buildID int, followTrigger bool) (chan Log, error)
StreamPipelineBuild poll the api to fetch logs of building pipeline and push them in returned channel
func UnsetUserGroupAdmin ¶
UnsetUserGroupAdmin removes user priviles on group
func UpdateApplicationPipeline ¶
UpdateApplicationPipeline add a pipeline in an application
func UpdateApplicationVariable ¶
func UpdateApplicationVariable(projectKey, appName, oldName, varName, varValue, varType string) error
UpdateApplicationVariable update a variable in an application
func UpdateCapabilityToWorkerModel ¶
UpdateCapabilityToWorkerModel updates a capability to given model
func UpdateEnvironment ¶
UpdateEnvironment create an environment
func UpdateEnvironmentVariable ¶
func UpdateEnvironmentVariable(projectKey, envName, oldVarName, varName, varValue, varType string) error
UpdateEnvironmentVariable update a variable in an environment
func UpdateGroupInApplication ¶
UpdateGroupInApplication call api to update group permission for the given application
func UpdateGroupInEnvironment ¶
UpdateGroupInEnvironment call api to update group permission for the given environment
func UpdateGroupInPipeline ¶
UpdateGroupInPipeline call api to update group permission on pipeline
func UpdateGroupInProject ¶
UpdateGroupInProject call api to update group permission on project
func UpdateJoinedAction ¶
UpdateJoinedAction update given joined action in given pipeline stage
func UpdateParameterInPipeline ¶
func UpdateParameterInPipeline(projectKey, pipelineName, paramName, paramValue, paramType, paramDescription string) error
UpdateParameterInPipeline update a variable in a pipeline
func UpdateTrigger ¶
func UpdateTrigger(t *PipelineTrigger) error
UpdateTrigger adds a trigger between two pipelines
func UpdateUserEmail ¶
UpdateUserEmail Change user email address
func UpdateUsername ¶
UpdateUsername Change username
func UpdateVariableInProject ¶
UpdateVariableInProject update a variable in a project
func UpdateWorkerModel ¶
UpdateWorkerModel updates all characteristics of a worker model
func Upload ¶
func Upload(method string, path string, body io.ReadCloser, mods ...RequestModifier) ([]byte, int, error)
Upload upload content in given io.Reader to given HTTP endpoint
func UploadArtifact ¶
func UploadArtifact(project string, pipeline string, application string, tag string, filePath string, buildNumber int, env string) error
UploadArtifact read file at filePath and upload it in projet-pipeline-tag starage directory
func UploadMultiPart ¶
func UploadMultiPart(method string, path string, body *bytes.Buffer, mods ...RequestModifier) ([]byte, int, error)
UploadMultiPart upload multipart
func UploadPlugin ¶
UploadPlugin uploads binary file to perform a new action
Types ¶
type Action ¶
type Action struct { ID int64 `json:"id" yaml:"-"` Name string `json:"name"` Type string `json:"type" yaml:"-"` // Source - Build - Packaging - Deployment Description string `json:"description" yaml:"desc,omitempty"` Requirements []Requirement `json:"requirements"` Parameters []Parameter `json:"parameters"` Actions []Action `json:"actions" yaml:"actions,omitempty"` Enabled bool `json:"enabled" yaml:"-"` PipelineStageID int64 `json:"pipeline_stage_id" yaml:"-"` PipelineActionID int64 `json:"pipeline_action_id" yaml:"-"` Final bool `json:"final" yaml:"-"` LastModified int64 `json:"last_modified"` }
Action is the base element of CDS pipeline
func ImportAction ¶
ImportAction imports an action on CDS
func ListActions ¶
ListActions returns all available actions to caller
func NewActionArtifactDownload ¶
NewActionArtifactDownload creates a builtin action artifactDownload
func NewActionArtifactUpload ¶
NewActionArtifactUpload creates a builtin action artifactUpload
func NewActionFromRemoteScript ¶
NewActionFromRemoteScript creates an action from an URL giving an HCL file
func NewActionFromScript ¶
NewActionFromScript creates an action from a HCL file as bytes
func NewActionJUnit ¶
NewActionJUnit creates a builtin action junit
func NewActionPlugin ¶
NewActionPlugin creates a plugin action
func NewActionScript ¶
func NewActionScript(script string, requirements []Requirement) Action
NewActionScript creates a builtin action script
func NewJoinedAction ¶
NewJoinedAction is a helper to build an action object acting as an joined action
func NewScriptAction ¶
NewScriptAction setup a new Action object with all attribute ok for script action
type ActionAudit ¶
type ActionAudit struct { ActionID int64 `json:"action_id"` User User `json:"user"` Change string `json:"change"` Versionned time.Time `json:"versionned"` Action Action `json:"action"` }
ActionAudit Audit on action
type ActionBuild ¶
type ActionBuild struct { ID int64 `json:"id"` BuildNumber int `json:"build_number"` PipelineBuildID int64 `json:"pipeline_build_id"` PipelineID int64 `json:"pipeline_id"` ActionName string `json:"action_name"` PipelineActionID int64 `json:"pipeline_action_id"` PipelineStageID int64 `json:"-"` Args []Parameter `json:"args"` Status Status `json:"status"` Requirements []Requirement `json:"requirements"` Queued time.Time `json:"queued,omitempty"` Start time.Time `json:"start,omitempty"` Done time.Time `json:"done,omitempty"` Logs string `json:"logs,omitempty"` Model string `json:"model,omitempty"` }
ActionBuild represents an action to be run
func GetBuildQueue ¶
func GetBuildQueue() ([]ActionBuild, error)
GetBuildQueue retrieves current CDS build in queue
type ActionPlugin ¶
type ActionPlugin struct { ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Author string `json:"author"` Filename string `json:"filename"` Path string `json:"path"` Size int64 `json:"size,omitempty"` Perm uint32 `json:"perm,omitempty"` MD5sum string `json:"md5sum,omitempty"` ObjectPath string `json:"object_path,omitempty"` }
ActionPlugin is the Action Plugin representation from Engine side
func (*ActionPlugin) GetName ¶
func (a *ActionPlugin) GetName() string
GetName returns the name the action plugin
func (*ActionPlugin) GetPath ¶
func (a *ActionPlugin) GetPath() string
GetPath returns the storage path of the action plugin
type ActionScript ¶
type ActionScript struct { Name string `json:"name"` Description string `json:"description,omitempty"` Requirements map[string]Requirement `json:"requirement,omitempty"` Parameters map[string]Parameter `json:"parameters,omitempty"` Steps []struct { Enabled *bool `json:"enabled"` Final bool `json:"final"` ArtifactUpload map[string]string `json:"artifactUpload,omitempty"` ArtifactDownload map[string]string `json:"artifactDownload,omitempty"` Script string `json:"script,omitempty"` JUnitReport string `json:"jUnitReport,omitempty"` Plugin map[string]map[string]string `json:"plugin,omitempty"` } `json:"steps"` }
ActionScript represents the structure of a HCL action file
type Application ¶
type Application struct { ID int64 `json:"id"` Name string `json:"name"` ProjectKey string `json:"project_key"` ApplicationGroups []GroupPermission `json:"groups,omitempty"` Variable []Variable `json:"variables,omitempty"` Pipelines []ApplicationPipeline `json:"pipelines,omitempty"` PipelinesBuild []PipelineBuild `json:"pipelines_build,omitempty"` Permission int `json:"permission"` Notifications []UserNotification `json:"notifications,omitempty"` LastModified int64 `json:"last_modified"` RepositoriesManager *RepositoriesManager `json:"repositories_manager,omitempty"` RepositoryFullname string `json:"repository_fullname,omitempty"` RepositoryPollers []RepositoryPoller `json:"pollers,omitempty"` Hooks []Hook `json:"hooks,omitempty"` Workflows []CDPipeline `json:"workflows,omitempty"` }
Application represent an application in a project
func ApplyApplicationTemplate ¶
func ApplyApplicationTemplate(projectKey string, name string, build Template) (*Application, error)
ApplyApplicationTemplate creates given application and apply build template
func GetApplication ¶
func GetApplication(pk, name string) (*Application, error)
GetApplication retrieve the given application from CDS
func ListApplications ¶
func ListApplications(key string) ([]Application, error)
ListApplications returns all available application for the given project
func NewApplication ¶
func NewApplication(name string) *Application
NewApplication instanciate a new NewApplication
type ApplicationGroup ¶
type ApplicationGroup struct { Application Application `json:"application"` Permission int `json:"permission"` }
ApplicationGroup represent a link with a pipeline
type ApplicationPipeline ¶
type ApplicationPipeline struct { Pipeline Pipeline `json:"pipeline"` Parameters []Parameter `json:"parameters"` LastModified int64 `json:"last_modified"` Triggers []PipelineTrigger `json:"triggers,omitempty"` }
ApplicationPipeline Represent the link between an application and a pipeline
type ApplyTemplatesOptions ¶
type ApplyTemplatesOptions struct { ApplicationName string `json:"name"` TemplateName string `json:"template"` TemplateParams []TemplateParam `json:"template_params"` }
ApplyTemplatesOptions represents arguments to create an application and all its components from templates
type Artifact ¶
type Artifact struct { ID int64 `json:"id"` Project string `json:"project"` Pipeline string `json:"pipeline"` Application string `json:"application"` Environment string `json:"environment"` BuildNumber int `json:"build_number"` Name string `json:"name"` Tag string `json:"tag"` DownloadHash string `json:"download_hash"` Size int64 `json:"size,omitempty"` Perm uint32 `json:"perm,omitempty"` MD5sum string `json:"md5sum,omitempty"` ObjectPath string `json:"object_path,omitempty"` }
Artifact define a file needed to be save for future use
func ListArtifacts ¶
func ListArtifacts(project string, application string, pipeline string, tag string, env string) ([]Artifact, error)
ListArtifacts retrieves the list of file stored as artifacts for given project-pipeline-tag
type Auth ¶
type Auth struct { HashedPassword string `json:"hashedPassword"` HashedTokenVerify string `json:"hashedTokenVerify"` EmailVerified bool `json:"emailVerified"` DateReset int64 `json:"dateReset"` Tokens []UserToken `json:"tokens,omitempty"` }
Auth Authentifaction Struct for user
type BuildState ¶
type BuildState struct { Stages []Stage `json:"stages"` Logs []Log `json:"logs"` Status Status `json:"status"` }
BuildState define struct returned when looking for build state informations
func GetBuildActionLog ¶
func GetBuildActionLog(projectKey, appName, pipelineName, buildID, pipelineActionID string) (BuildState, error)
GetBuildActionLog Get the log of the given action for the given build
type CDPipeline ¶
type CDPipeline struct { Project Project `json:"project"` Application Application `json:"application"` Environment Environment `json:"environment"` Pipeline Pipeline `json:"pipeline"` SubPipelines []CDPipeline `json:"subPipelines"` Trigger PipelineTrigger `json:"trigger"` }
CDPipeline Represent a pipeline in the CDTree
type Environment ¶
type Environment struct { ID int64 `json:"id" yaml:"-"` Name string `json:"name" yaml:"name"` EnvironmentGroups []GroupPermission `json:"groups,omitempty" yaml:"groups"` Variable []Variable `json:"variables,omitempty" yaml:"variables"` ProjectID int64 `json:"-" yaml:"-"` ProjectKey string `json:"-" yaml:"-"` Permission int `json:"permission"` LastModified int64 `json:"last_modified"` }
Environment represent a deployment environment
func CloneEnvironment ¶
func CloneEnvironment(pk, name, new string) (*Environment, error)
CloneEnvironment clone the given environment in CDS
func GetEnvironment ¶
func GetEnvironment(pk, name string) (*Environment, error)
GetEnvironment retrieve the given environment from CDS
func ListEnvironments ¶
func ListEnvironments(key string) ([]Environment, error)
ListEnvironments returns all available environments for the given project
func NewEnvironment ¶
func NewEnvironment(name string) *Environment
NewEnvironment instanciate a new Environment
type EnvironmentGroup ¶
type EnvironmentGroup struct { Environment Environment `json:"environment"` Permission int `json:"permission"` }
EnvironmentGroup represent a link with a pipeline
type Error ¶
type Error struct { ID int `json:"-"` Status int `json:"-"` Message string `json:"message"` Root error `json:"-"` }
Error type
type Event ¶ added in v0.4.0
type Event struct { Timestamp time.Time `json:"timestamp"` Hostname string `json:"hostname"` CDSName string `json:"cdsname"` EventType string `json:"type_event"` // go type of payload Payload map[string]interface{} `json:"payload"` }
Event represents a event from API Event is "create", "update", "delete" Status is "Waiting" "Building" "Success" "Fail" "Unknown", optional DateEvent is a date (timestamp format)
type EventEngine ¶ added in v0.4.0
type EventEngine struct {
Message string `json:"message"`
}
EventEngine contains event data for engine
type EventJob ¶ added in v0.4.0
type EventJob struct { Version int64 `json:"version,omitempty"` JobName string `json:"jobName,omitempty"` Status Status `json:"status,omitempty"` Queued int64 `json:"queued,omitempty"` Start int64 `json:"start,omitempty"` Done int64 `json:"done,omitempty"` ModelName string `json:"modelName,omitempty"` PipelineName string `json:"pipelineName,omitempty"` PipelineType PipelineType `json:"type,omitempty"` ProjectKey string `json:"projectKey,omitempty"` ApplicationName string `json:"applicationName,omitempty"` EnvironmentName string `json:"environmentName,omitempty"` BranchName string `json:"branchName,omitempty"` Hash string `json:"hash,omitempty"` }
EventJob contains event data for a job
type EventNotif ¶ added in v0.4.0
type EventNotif struct { Recipients []string `json:"recipients"` Subject string `json:"subject,omitempty"` Body string `json:"body,omitempty"` }
EventNotif contains event data for a job
type EventPipelineBuild ¶ added in v0.4.0
type EventPipelineBuild struct { Version int64 `json:"version,omitempty"` BuildNumber int64 `json:"buildNumber,omitempty"` Status Status `json:"status,omitempty"` Start int64 `json:"start,omitempty"` Done int64 `json:"done,omitempty"` PipelineName string `json:"pipelineName,omitempty"` PipelineType PipelineType `json:"type,omitempty"` ProjectKey string `json:"projectKey,omitempty"` ApplicationName string `json:"applicationName,omitempty"` EnvironmentName string `json:"environmentName,omitempty"` BranchName string `json:"branchName,omitempty"` Hash string `json:"hash,omitempty"` RepositoryManagerName string `json:"repositoryManagerName,omitempty"` RepositoryFullname string `json:"repositoryFullname,omitempty"` }
EventPipelineBuild contains event data for a pipeline build
type Expiration ¶
type Expiration int
Expiration defines how worker key should expire
const ( Session Expiration Daily Persistent )
Worker key expiry options
func ExpirationFromString ¶
func ExpirationFromString(s string) (Expiration, error)
ExpirationFromString returns a typed Expiration from a string
func (Expiration) String ¶
func (e Expiration) String() string
type Group ¶
type Group struct { ID int64 `json:"id" yaml:"-"` Name string `json:"name" yaml:"name"` Admins []User `json:"admins,omitempty" yaml:"admin,omitempty"` Users []User `json:"users,omitempty" yaml:"users,omitempty"` ProjectGroups []ProjectGroup `json:"projects,omitempty" yaml:"-"` PipelineGroups []PipelineGroup `json:"pipelines,omitempty" yaml:"-"` ApplicationGroups []ApplicationGroup `json:"applications,omitempty" yaml:"-"` EnvironmentGroups []EnvironmentGroup `json:"environments,omitempty" yaml:"-"` }
Group represent a group of user.
func ListGroups ¶
ListGroups returns all available group to caller
type GroupPermission ¶
type GroupPermission struct { Group Group `json:"group"` Permission int `json:"permission"` Recursive bool `json:"recursive,omitempty" yaml:"-"` }
GroupPermission represent a group and his role in the project
type HTTPClient ¶
HTTPClient is a interface for HTTPClient mock
type Hatchery ¶
type Hatchery struct { ID int64 `json:"id"` UID string `json:"uid"` Name string `json:"name"` Status string `json:"status"` GroupID int64 `json:"group_id"` LastBeat time.Time `json:"-"` Model Model `json:"model"` }
Hatchery registration model
type Hook ¶
type Hook struct { ID int64 `json:"id"` UID string `json:"uid"` Pipeline Pipeline `json:"pipeline"` ApplicationID int64 `json:"application_id"` Kind string `json:"kind"` Host string `json:"host"` Project string `json:"project"` Repository string `json:"repository"` Enabled bool `json:"enabled"` Link string `json:"link"` }
Hook used to link a git repository to a given pipeline
type JabberEmailUserNotificationSettings ¶
type JabberEmailUserNotificationSettings struct { OnSuccess UserNotificationEventType `json:"on_success"` OnFailure UserNotificationEventType `json:"on_failure"` OnStart bool `json:"on_start"` SendToGroups bool `json:"send_to_groups"` SendToAuthor bool `json:"send_to_author"` Recipients []string `json:"recipients"` Template UserNotificationTemplate `json:"template"` }
JabberEmailUserNotificationSettings are jabber or email settings
func (*JabberEmailUserNotificationSettings) Failure ¶
func (n *JabberEmailUserNotificationSettings) Failure() UserNotificationEventType
Failure returns always/never/change
func (*JabberEmailUserNotificationSettings) Start ¶
func (n *JabberEmailUserNotificationSettings) Start() bool
Start returns always/never/change
func (*JabberEmailUserNotificationSettings) Success ¶
func (n *JabberEmailUserNotificationSettings) Success() UserNotificationEventType
Success returns always/never/change
type Job ¶
type Job struct { PipelineActionID int64 `json:"pipeline_action_id"` PipelineStageID int64 `json:"pipeline_stage_id"` Enabled bool `json:"enabled"` LastModified int64 `json:"last_modified"` Action Action `json:"action"` }
Job is the element of a stage
type Log ¶
type Log struct { ID int64 `json:"id"` ActionBuildID int64 `json:"action_build_id"` Timestamp time.Time `json:"timestamp"` Step string `json:"step"` Value string `json:"value"` }
Log struct holds a single line of build log
func GetBuildLogs ¶
GetBuildLogs retrieve all output from given build
type Mod ¶
Mod is the functional parameter type of sdk function to alter their behavior
func WithApplicationHistory ¶
WithApplicationHistory is a functional parameter of GetProject
func WithApplicationStatus ¶
func WithApplicationStatus() Mod
WithApplicationStatus is a func parameter of ListProject
func WithEnvironments ¶
func WithEnvironments() Mod
WithEnvironments is a func parameter of ListProject
type Model ¶
type Model struct { ID int64 `json:"id" db:"id"` Name string `json:"name" db:"name"` Type string `json:"type" db:"type"` Image string `json:"image" db:"image"` Capabilities []Requirement `json:"capabilities" db:"-"` CreatedBy User `json:"created_by" db:"-"` OwnerID int64 `json:"owner_id" db:"owner_id"` //DEPRECATED GroupID int64 `json:"group_id" db:"group_id"` }
Model represents a worker model (ex: Go 1.5.1 Docker Images) with specified capabilities (ex: go, golint and go2xunit binaries)
func AddWorkerModel ¶
AddWorkerModel registers a new worker model available
func GetWorkerModel ¶
GetWorkerModel retrieves a specific worker model
func GetWorkerModels ¶
GetWorkerModels retrieves all worker models avaialbe to user
type ModelStatus ¶
type ModelStatus struct { ModelID int64 `json:"model_id" yaml:"-"` ModelName string `json:"model_name" yaml:"name"` ModelGroupID int64 `json:"model_group_id" yaml:"model_group_id"` CurrentCount int64 `json:"current_count" yaml:"current"` WantedCount int64 `json:"wanted_count" yaml:"wanted"` BuildingCount int64 `json:"building_count" yaml:"building"` Requirements []Requirement `json:"requirements"` }
ModelStatus sums up the number of worker deployed and wanted for a given model
func GetWorkerModelStatus ¶
func GetWorkerModelStatus() ([]ModelStatus, error)
GetWorkerModelStatus retrieves from engine all worker model and their status
type OpenstackModelData ¶
type OpenstackModelData struct { Image string `json:"os"` Flavor string `json:"flavor"` UserData string `json:"user_data"` }
OpenstackModelData type details the "Image" field of Openstack type model
type Parameter ¶
type Parameter struct { ID int64 `json:"id" yaml:"-"` Name string `json:"name"` Type ParameterType `json:"type"` Value string `json:"value"` Description string `json:"description" yaml:"desc,omitempty"` }
Parameter can be a String/Date/Script/URL...
func NewStringParameter ¶
NewStringParameter creates a Parameter from a string with <name>=<value> format
func ShowParameterInPipeline ¶
ShowParameterInPipeline show parameters for a pipeline
type ParameterType ¶
type ParameterType string
ParameterType defines the types of parameter of a pipeline or a action
const ( EnvironmentParameter ParameterType = "env" PipelineParameter ParameterType = "pipeline" ListParameter ParameterType = "list" NumberParameter ParameterType = "number" StringParameter ParameterType = "string" TextParameter ParameterType = "text" BooleanParameter ParameterType = "boolean" )
Different type of Parameter
func ParameterTypeFromString ¶
func ParameterTypeFromString(in string) ParameterType
ParameterTypeFromString returns a parameter Type from a given string
func (ParameterType) String ¶
func (t ParameterType) String() string
type Pipeline ¶
type Pipeline struct { ID int64 `json:"id" yaml:"-"` Name string `json:"name"` Type PipelineType `json:"type"` ProjectKey string `json:"projectKey"` ProjectID int64 `json:"-"` LastPipelineBuild *PipelineBuild `json:"last_pipeline_build"` Stages []Stage `json:"stages"` GroupPermission []GroupPermission `json:"groups,omitempty"` Parameter []Parameter `json:"parameters,omitempty"` AttachedApplication []Application `json:"attached_application,omitempty"` Permission int `json:"permission"` LastModified int64 `json:"last_modified"` }
Pipeline represents the complete behavior of CDS for each projects
func GetPipeline ¶
GetPipeline retrieves pipeline definition from CDS
func ListApplicationPipeline ¶
ListApplicationPipeline list all pipelines attached to the application
func ListPipelines ¶
ListPipelines retrieves all available pipelines to called
type PipelineAction ¶
type PipelineAction struct { ActionName string `json:"actionName"` Args []Parameter `json:"args"` PipelineStageID int64 `json:"pipeline_stage_id"` }
PipelineAction represents an action in a pipeline
type PipelineBuild ¶
type PipelineBuild struct { ID int64 `json:"id"` BuildNumber int64 `json:"build_number"` Version int64 `json:"version"` Parameters []Parameter `json:"parameters"` Status Status `json:"status"` Start time.Time `json:"start,omitempty"` Done time.Time `json:"done,omitempty"` Stages []Stage `json:"stages"` Pipeline Pipeline `json:"pipeline"` Application Application `json:"application"` Environment Environment `json:"environment"` Artifacts []Artifact `json:"artifacts,omitempty"` Tests *Tests `json:"tests,omitempty"` Commits []VCSCommit `json:"commits,omitempty"` Trigger PipelineBuildTrigger `json:"trigger"` PreviousPipelineBuild *PipelineBuild `json:"previous_pipeline_build"` }
PipelineBuild Struct for history table
func GetBuildState ¶
func GetBuildState(projectKey, appName, pipelineName, env, buildID string) (PipelineBuild, error)
GetBuildState Get the state of given build
func GetBuildingPipelineByHash ¶
func GetBuildingPipelineByHash(hash string) ([]PipelineBuild, error)
GetBuildingPipelineByHash retrieves pipeline building a specific commit hash
func GetBuildingPipelines ¶
func GetBuildingPipelines() ([]PipelineBuild, error)
GetBuildingPipelines retrieves all building pipelines
func GetPipelineBuildHistory ¶
func GetPipelineBuildHistory(key, appName, name, env string) ([]PipelineBuild, error)
GetPipelineBuildHistory retrieves recent build history for given pipeline
func GetPipelineBuildStatus ¶
func GetPipelineBuildStatus(proj, app, pip, env string, buildNumber int64) (PipelineBuild, error)
GetPipelineBuildStatus retrieves current build information. With buildNumber at 0, fetch last build
type PipelineBuildTrigger ¶
type PipelineBuildTrigger struct { ScheduledTrigger bool `json:"scheduled_trigger"` ManualTrigger bool `json:"manual_trigger"` TriggeredBy *User `json:"triggered_by"` ParentPipelineBuild *PipelineBuild `json:"parent_pipeline_build"` VCSChangesBranch string `json:"vcs_branch"` VCSChangesHash string `json:"vcs_hash"` VCSChangesAuthor string `json:"vcs_author"` }
PipelineBuildTrigger Struct for history table
type PipelineGroup ¶
type PipelineGroup struct { Pipeline Pipeline `json:"pipeline"` Permission int `json:"permission"` }
PipelineGroup represent a link with a pipeline
type PipelineScheduler ¶
type PipelineScheduler struct { ID int64 `json:"id" db:"id"` ApplicationID int64 `json:"-" db:"application_id"` PipelineID int64 `json:"-" db:"pipeline_id"` EnvironmentID int64 `json:"-" db:"environment_id"` EnvironmentName string `json:"environment_name" db:"-"` Args []Parameter `json:"args,omitempty" db:"-"` Crontab string `json:"crontab,omitempty" db:"crontab"` Disabled bool `json:"disable" db:"disable"` LastExecution *PipelineSchedulerExecution `json:"last_execution" db:"-"` NextExecution *PipelineSchedulerExecution `json:"next_execution" db:"-"` }
PipelineScheduler is a cron scheduler
func AddPipelineScheduler ¶
func AddPipelineScheduler(projectKey, appName, pipelineName, cronExpr, envName string, params []Parameter) (*PipelineScheduler, error)
AddPipelineScheduler add a pipeline scheduler
func GetPipelineScheduler ¶
func GetPipelineScheduler(projectKey, appName, pipelineName string) ([]PipelineScheduler, error)
GetPipelineScheduler returns all pipeline scheduler
func UpdatePipelineScheduler ¶
func UpdatePipelineScheduler(projectKey, appName, pipelineName string, s *PipelineScheduler) (*PipelineScheduler, error)
UpdatePipelineScheduler update a pipeline scheduler
type PipelineSchedulerExecution ¶
type PipelineSchedulerExecution struct { ID int64 `json:"id" db:"id"` PipelineSchedulerID int64 `json:"-" db:"pipeline_scheduler_id"` ExecutionPlannedDate time.Time `json:"execution_planned_date,omitempty" db:"execution_planned_date"` ExecutionDate *time.Time `json:"execution_date" db:"execution_date"` Executed bool `json:"executed" db:"executed"` PipelineBuildVersion int64 `json:"pipeline_build_version" db:"pipeline_build_version"` }
PipelineSchedulerExecution is a cron scheduler execution
type PipelineTrigger ¶
type PipelineTrigger struct { ID int64 `json:"id"` SrcProject Project `json:"src_project" yaml:"-"` SrcApplication Application `json:"src_application" yaml:"-"` SrcPipeline Pipeline `json:"src_pipeline" yaml:"-"` SrcEnvironment Environment `json:"src_environment" yaml:"-"` DestProject Project `json:"dest_project" yaml:"-"` DestApplication Application `json:"dest_application" yaml:"-"` DestPipeline Pipeline `json:"dest_pipeline" yaml:"-"` DestEnvironment Environment `json:"dest_environment" yaml:"-"` Manual bool `json:"manual"` Parameters []Parameter `json:"parameters"` Prerequisites []Prerequisite `json:"prerequisites"` LastModified int64 `json:"last_modified"` }
PipelineTrigger represent a pipeline trigger
func GetTrigger ¶
func GetTrigger(proj, app, pip string, id int64) (*PipelineTrigger, error)
GetTrigger gets an existing trigger
func GetTriggers ¶
func GetTriggers(project, app, pipeline, env string) ([]PipelineTrigger, error)
GetTriggers retrieves all ouput triggers of a pipeline
func GetTriggersAsSource ¶
func GetTriggersAsSource(project, app, pipeline, env string) ([]PipelineTrigger, error)
GetTriggersAsSource retrieves all ouput triggers of a pipeline
type PipelineType ¶
type PipelineType string
PipelineType defines the purpose of a given pipeline
const ( BuildPipeline PipelineType = "build" DeploymentPipeline PipelineType = "deployment" TestingPipeline PipelineType = "testing" )
Different types of Pipeline
func PipelineTypeFromString ¶
func PipelineTypeFromString(in string) PipelineType
PipelineTypeFromString returns the proper PipelineType
type Prerequisite ¶
type Prerequisite struct { Parameter string `json:"parameter"` ExpectedValue string `json:"expected_value"` }
Prerequisite defines a expected value to one triggering pipeline parameter
func NewPrerequisite ¶
func NewPrerequisite(s string) (Prerequisite, error)
NewPrerequisite creates a Prerequisite from a string with <name>=<expectedValue> format
type Project ¶
type Project struct { ID int64 `json:"-" yaml:"-"` Key string `json:"key" yaml:"key"` Name string `json:"name" yaml:"name"` Pipelines []Pipeline `json:"pipelines,omitempty" yaml:"pipelines,omitempty"` Applications []Application `json:"applications,omitempty" yaml:"applications,omitempty"` ProjectGroups []GroupPermission `json:"groups,omitempty" yaml:"permissions,omitempty"` Variable []Variable `json:"variables,omitempty" yaml:"variables,omitempty"` Environments []Environment `json:"environments,omitempty" yaml:"environments,omitempty"` Permission int `json:"permission" yaml:"-"` LastModified int64 `json:"last_modified" yaml:"-"` ReposManager []RepositoriesManager `json:"repositories_manager" yaml:"-"` }
Project represent a team with group of users and pipelines
func GetProject ¶
GetProject retrieves project informations from CDS
func ListProject ¶
ListProject returns all available project to caller
type ProjectGroup ¶
ProjectGroup represent a link with a project
type ProjectLastUpdates ¶
type ProjectLastUpdates struct { Key string `json:"key"` LastModified int64 `json:"last_modified"` Applications []struct { Name string `json:"name"` LastModified int64 `json:"last_modified"` } `json:"applications"` Pipelines []struct { Name string `json:"name"` LastModified int64 `json:"last_modified"` } `json:"pipelines"` }
ProjectLastUpdates update times of project, application and pipelines
type RepositoriesManager ¶
type RepositoriesManager struct { ID int64 `json:"id"` Consumer RepositoriesManagerDriver `json:"-"` Type RepositoriesManagerType `json:"type"` Name string `json:"name"` URL string `json:"url"` HooksSupported bool `json:"hooks_supported"` PollingSupported bool `json:"polling_supported"` }
RepositoriesManager is the struct for every repositories manager. It can be stored in CDS DB in repositories_manager table
func AddReposManager ¶
func AddReposManager(args map[string]string) (*RepositoriesManager, error)
AddReposManager add a new repositories manager in CDS
func GetProjectReposManager ¶
func GetProjectReposManager(k string) ([]RepositoriesManager, error)
GetProjectReposManager returns connected repository manager for a specific project
func GetReposManager ¶
func GetReposManager() ([]RepositoriesManager, error)
GetReposManager calls API to get list of repositories manager
type RepositoriesManagerClient ¶
type RepositoriesManagerClient interface { //Repos Repos() ([]VCSRepo, error) RepoByFullname(fullname string) (VCSRepo, error) //Branches Branches(string) ([]VCSBranch, error) Branch(string, string) (VCSBranch, error) //Commits Commits(repo, branch, since, until string) ([]VCSCommit, error) Commit(repo, hash string) (VCSCommit, error) //Hooks CreateHook(repo, url string) error DeleteHook(repo, url string) error //Events PushEvents(repo string, dateRef time.Time) ([]VCSPushEvent, time.Duration, error) // Set build status on repository SetStatus(event Event) error }
RepositoriesManagerClient is the client interface
type RepositoriesManagerDriver ¶
type RepositoriesManagerDriver interface { AuthorizeRedirect() (string, string, error) AuthorizeToken(string, string) (string, string, error) GetAuthorized(string, string) (RepositoriesManagerClient, error) Data() string HooksSupported() bool PollingSupported() bool }
RepositoriesManagerDriver is the consumer interface
type RepositoriesManagerType ¶
type RepositoriesManagerType string
RepositoriesManagerType lists the different repositories manager currently planned to be supported
const ( //Stash is valued to "STASH" Stash RepositoriesManagerType = "STASH" //Github is valued to "GITHUB" Github RepositoriesManagerType = "GITHUB" )
type Repository ¶
Repository structs contains all needed information about a single repository
type RepositoryPoller ¶
type RepositoryPoller struct { Name string `json:"name"` Application Application `json:"application"` Pipeline Pipeline `json:"pipeline"` Enabled bool `json:"enabled"` DateCreation time.Time `json:"date_creation"` }
RepositoryPoller is an alternative to hooks
type RequestModifier ¶
RequestModifier is used to modify behavior of Request and Steam functions
func SetHeader ¶
func SetHeader(key, value string) RequestModifier
SetHeader modify headers of http.Request
type Requirement ¶
type Requirement struct { Name string `json:"name"` Type string `json:"type" yaml:"-"` Value string `json:"value" yaml:"-"` }
Requirement can be : - a binary "which /usr/bin/docker" - a network access "telnet google.com 443"
func GetRequirements ¶
func GetRequirements() ([]Requirement, error)
GetRequirements returns the list of all used requirements
type Result ¶
type Result struct { ID int64 `json:"id" yaml:"-"` BuildID int64 `json:"build_id" yaml:"build"` Status Status `json:"status"` Version int64 `json:"version"` }
Result refers to an build result after completion
type RunRequest ¶
type RunRequest struct { Params []Parameter `json:"parameters,omitempty"` Env Environment `json:"env,omitempty"` ParentBuildNumber int64 `json:"parent_build_number,omitempty"` ParentPipelineID int64 `json:"parent_pipeline_id,omitempty"` ParentEnvironmentID int64 `json:"parent_environment_id,omitempty"` ParentApplicationID int64 `json:"parent_application_id,omitempty"` }
RunRequest Request to run a pipeline
type Stage ¶
type Stage struct { ID int64 `json:"id" yaml:"pipeline_stage_id"` Name string `json:"name"` PipelineID int64 `json:"-" yaml:"-"` BuildOrder int `json:"build_order"` Enabled bool `json:"enabled"` Actions []Action `json:"actions"` // WIP: refacto to delete Actions and use Jobs ActionBuilds []ActionBuild `json:"builds"` Prerequisites []Prerequisite `json:"prerequisites"` LastModified int64 `json:"last_modified"` Jobs []Job `json:"jobs"` }
Stage Pipeline step that parallelize actions by order
type Status ¶
type Status string
Status reprensents a Build Action or Build Pipeline Status
const ( StatusWaiting Status = "Waiting" StatusChecking Status = "Checking" StatusBuilding Status = "Building" StatusSuccess Status = "Success" StatusFail Status = "Fail" StatusDisabled Status = "Disabled" StatusNeverBuilt Status = "Never Built" StatusUnknown Status = "Unknown" StatusSkipped Status = "Skipped" )
Action status in queue
func StatusFromString ¶
StatusFromString returns a Status from a given string
type Template ¶
type Template struct { ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Params []TemplateParam `json:"params"` Hook bool `json:"hook"` }
Template definition to help users bootstrap their pipelines
func GetBuildTemplate ¶
GetBuildTemplate Get the build template corresponding to the given name
func GetBuildTemplates ¶
GetBuildTemplates retrieves all existing build template from API
func GetDeploymentTemplates ¶
GetDeploymentTemplates retrieves all existing deployment template from API
type TemplateExtension ¶
type TemplateExtension struct { ID int64 `json:"id" db:"id"` Name string `json:"name" db:"name"` Type string `json:"type" db:"type"` Author string `json:"author" db:"author"` Description string `json:"description" db:"description"` Identifier string `json:"identifier" db:"identifier"` Size int64 `json:"-" db:"size"` Perm uint32 `json:"-" db:"perm"` MD5Sum string `json:"md5sum" db:"md5sum"` ObjectPath string `json:"-" db:"object_path"` Filename string `json:"-" db:"-"` Path string `json:"-" db:"-"` Params []TemplateParam `json:"params" db:"-"` Actions []string `json:"actions" db:"-"` }
TemplateExtension represents a template store as a binary extension
func ListTemplates ¶
func ListTemplates() ([]TemplateExtension, error)
ListTemplates returns all templates
func (*TemplateExtension) GetName ¶
func (a *TemplateExtension) GetName() string
GetName returns the name of the template extension
func (*TemplateExtension) GetPath ¶
func (a *TemplateExtension) GetPath() string
GetPath returns the storage path of the template extension
type TemplateParam ¶
type TemplateParam struct { ID int64 `json:"id" yaml:"-"` Name string `json:"name"` Type VariableType `json:"type"` Value string `json:"value"` Description string `json:"description" yaml:"desc,omitempty"` }
TemplateParam can be a String/Date/Script/URL...
type Test ¶
type Test struct { Name string `xml:"name,attr" json:"name"` Time string `xml:"time,attr" json:"time"` Failure string `xml:"failure" json:"failure"` Error string `xml:"error" json:"error"` Skip *string `xml:"skipped" json:"skipped"` }
Test define a single test
type TestSuite ¶
type TestSuite struct { Name string `xml:"name,attr" json:"name"` Total int `xml:"tests,attr" json:"total"` Failures int `xml:"failures,attr" json:"failures"` Errors int `xml:"errors,attr" json:"errors"` Skip int `xml:"skip,attr" json:"skipped"` Tests []Test `xml:"testcase" json:"tests"` }
TestSuite defines the result of a group of tests
type Tests ¶
type Tests struct { PipelineBuildID int64 `json:"pipeline_build_id"` Total int `json:"total"` TotalOK int `json:"ok"` TotalKO int `json:"ko"` TotalSkipped int `json:"skipped"` TestSuites []TestSuite `xml:"testsuite" json:"test_suites"` }
Tests contains all informations about tests in a pipeline build
type User ¶
type User struct { ID int64 `json:"id" yaml:"-"` Username string `json:"username" yaml:"username"` Fullname string `json:"fullname" yaml:"fullname,omitempty"` Email string `json:"email" yaml:"email,omitempty"` Admin bool `json:"admin" yaml:"admin,omitempty"` Auth Auth `json:"-" yaml:"-"` Groups []Group `json:"groups" yaml:"-"` Origin string `json:"origin" yaml:"origin,omitempty"` }
User represent a CDS user.
type UserAPIRequest ¶
UserAPIRequest request for rest API
type UserAPIResponse ¶
type UserAPIResponse struct { User User `json:"user"` Password string `json:"password,omitempty"` Token string `json:"token,omitempty"` }
UserAPIResponse response from rest API
func LoginUser ¶
func LoginUser(username, password string) (bool, *UserAPIResponse, error)
LoginUser call the /login handler
func VerifyUser ¶
func VerifyUser(name, token string) (UserAPIResponse, error)
VerifyUser verify the token received by mail
type UserLoginRequest ¶
type UserLoginRequest struct { Username string `json:"username"` Password string `json:"password"` }
UserLoginRequest login request
type UserNotification ¶
type UserNotification struct { ApplicationPipelineID int64 `json:"application_pipeline_id"` Pipeline Pipeline `json:"pipeline"` Environment Environment `json:"environment"` Notifications map[UserNotificationSettingsType]UserNotificationSettings `json:"notifications"` }
UserNotification is a settings on application_pipeline/env to trigger notification on pipeline event
type UserNotificationEventType ¶
type UserNotificationEventType string
UserNotificationEventType always/never/change
const ( UserNotificationAlways UserNotificationEventType = "always" UserNotificationNever UserNotificationEventType = "never" UserNotificationChange UserNotificationEventType = "change" )
const
type UserNotificationSettings ¶
type UserNotificationSettings interface { Success() UserNotificationEventType Failure() UserNotificationEventType Start() bool }
UserNotificationSettings are common settings
type UserNotificationSettingsType ¶
type UserNotificationSettingsType string
UserNotificationSettingsType of notification
const ( EmailUserNotification UserNotificationSettingsType = "email" JabberUserNotification UserNotificationSettingsType = "jabber" )
const
type UserNotificationTemplate ¶
type UserNotificationTemplate struct { Subject string `json:"subject,omitempty"` Body string `json:"body,omitempty"` }
UserNotificationTemplate is the notification content
type UserToken ¶
type UserToken struct { Token string `json:"token"` Timestamp int64 `json:"timestamp"` Comment string `json:"comment"` }
UserToken for user persistent session
type VCSAuthor ¶
type VCSAuthor struct { Name string `json:"name"` DisplayName string `json:"displayName"` Email string `json:"emailAddress"` Avatar string `json:"avatar"` }
VCSAuthor represents the auhor for every commit
type VCSBranch ¶
type VCSBranch struct { ID string `json:"id"` DisplayID string `json:"display_id"` LatestCommit string `json:"latest_commit"` Default bool `json:"default"` }
VCSBranch reprensents branches known by the repositories manager
type VCSCommit ¶
type VCSCommit struct { Hash string `json:"id"` Author VCSAuthor `json:"author"` Timestamp int64 `json:"authorTimestamp"` Message string `json:"message"` URL string `json:"url"` }
VCSCommit represents the commit in the repository
type VCSPushEvent ¶
VCSPushEvent represents a push events for polling
type VCSRepo ¶
type VCSRepo struct { ID string `json:"id"` Name string `json:"name"` //On Github: Name = Slug Slug string `json:"slug"` //On Github: Slug = Name Fullname string `json:"fullname"` //On Stash : projectkey/slug, on Github : owner/slug URL string `json:"url"` //Web URL HTTPCloneURL string `json:"http_url"` //Git clone URL "https://<baseURL>/scm/PRJ/my-repo.git" SSHCloneURL string `json:"ssh_url"` //Git clone URL "ssh://git@<baseURL>/PRJ/my-repo.git" }
VCSRepo represents data about repository even on stash, or github, etc...
func GetProjectReposFromReposManager ¶
GetProjectReposFromReposManager returns the repositories
type Variable ¶
type Variable struct { ID int64 `json:"id"` Name string `json:"name"` Value string `json:"value"` Type VariableType `json:"type"` }
Variable represent a variable for a project or pipeline
func GetEnvironmentVariable ¶
GetEnvironmentVariable Get a specific variable from the given environment
func GetVariableInApplication ¶
GetVariableInApplication Get a variable in the given application
func GetVariableInProject ¶
GetVariableInProject Get a variable by her name in the given project
func ShowApplicationVariable ¶
ShowApplicationVariable show variables for an application
func ShowEnvironmentVariable ¶
ShowEnvironmentVariable show variables for an environment
func ShowVariableInProject ¶
ShowVariableInProject show variables for a project
type VariableAudit ¶
type VariableAudit struct { ID int `json:"id"` Variables []Variable `json:"variables"` Versionned time.Time `json:"versionned"` Author string `json:"author"` }
VariableAudit represent audit for a variable
type VariableType ¶
type VariableType string
VariableType defines the types of project, application and environment variable
const ( SecretVariable VariableType = "password" TextVariable VariableType = "text" StringVariable VariableType = "string" KeyVariable VariableType = "key" BooleanVariable VariableType = "boolean" NumberVariable VariableType = "number" RepositoryVariable VariableType = "repository" )
Different type of Variable
func VariableTypeFromString ¶
func VariableTypeFromString(in string) VariableType
VariableTypeFromString return a valid VariableType from a string Defaults to String
type Warning ¶
type Warning struct { ID int64 `json:"id"` Message string `json:"message"` MessageParam map[string]string `json:"message_param"` Action Action `json:"action"` StageID int64 `json:"stage_id"` Project Project `json:"project"` Application Application `json:"application"` Pipeline Pipeline `json:"pipeline"` Environment Environment `json:"environment"` }
Warning contains information about user action configuration
func GetWarnings ¶
GetWarnings retrieves warnings related to Action accessible to caller
type Week ¶
type Week struct { From time.Time `json:"from"` To time.Time `json:"to"` Builds int64 `json:"builds_completed"` UnitTests int64 `json:"unit_tests"` MaxBuildingWorkers int64 `json:"max_building_worker"` MaxBuildingPipelines int64 `json:"max_building_pipeline"` Users int64 `json:"period_total_users"` NewUsers int64 `json:"new_users"` Projects int64 `json:"period_total_projects"` NewProjects int64 `json:"new_projects"` Applications int64 `json:"period_total_applications"` NewApplications int64 `json:"new_applications"` Pipelines struct { Build int64 `json:"build"` Testing int64 `json:"testing"` Deploy int64 `json:"deploy"` } `json:"period_total_pipelines"` NewPipelines int64 `json:"new_pipelines"` RunnedPipelines struct { Build int64 `json:"build"` Testing int64 `json:"testing"` Deploy int64 `json:"deploy"` } `json:"runned_pipelines"` }
Week exposes what happened in a week timeframe
type Worker ¶
type Worker struct { ID string `json:"id"` Name string `json:"name"` LastBeat time.Time `json:"-"` GroupID int64 `json:"group_id"` Model int64 `json:"model"` HatcheryID int64 `json:"hatchery_id"` Status Status `json:"status"` // Waiting, Building, Disabled, Unknown }
Worker represents instances of CDS workers living to serve.
func GetWorkers ¶
GetWorkers retrieves from engine all worker the user has access to
Source Files ¶
- action.go
- action_script.go
- application.go
- artifact.go
- authentification.go
- build.go
- common.go
- environment.go
- error.go
- event.go
- expiration.go
- group.go
- hatchery.go
- hook.go
- job.go
- log.go
- notif.go
- parameter.go
- pipeline.go
- plugin.go
- project.go
- repositories_manager.go
- request.go
- result.go
- scheduler.go
- stage.go
- stats.go
- status.go
- template.go
- tests.go
- token.go
- trigger.go
- user.go
- util.go
- variable.go
- version.go
- warning.go
- worker.go