gocd

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 25 Imported by: 6

README

GoCD Golang SDK

Go Report Card shields shields shields

Golang client library for GoCD API (Supports Most of the APIs).

Introduction

This Library could be helpful while building any tools around GoCD or while interacting with GoCD to perform certain daily activities.

This could include checking the health of all agents connected to GoCD or status of a job and many more.

Installation

Get the latest version of GoCD sdk using go get command. Example:

go get github.com/nikhilsbhat/gocd-sdk-go@latest

Get specific version of the same. Example:

go get github.com/nikhilsbhat/gocd-sdk-go@v0.0.2

Usage

package main

import (
	"fmt"
	"log"

	"github.com/nikhilsbhat/gocd-sdk-go"
)

func main() {
	client := gocd.NewClient("http://localhost:8153/go", "admin", "admin", "info", nil)
	env, err := client.GetEnvironments()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(env)
}

More examples can be found here.

Supported APIs

Below are the list of supported APIs:

  • Agents
    • Get All Agents
    • Get Specific Agent
    • Update Agent
    • Update Agents bulk
    • Delete Agent
    • Delete Agents bulk
    • Kill running tasks iin Agent
    • Agent job run history
  • ConfigRepo
    • Get All Config repo
    • Get Specific Config repo
    • Create Config repo
    • Update Config repo
    • Delete Config repo
    • Get Config repo status
    • Trigger config repo update
    • Preflight check of config repo configurations
    • Export pipeline config to config repo format
    • Definitions defined in config repo
  • Maintenance Mode
    • Enable Maintenance Mode
    • Disable Maintenance Mode
    • Get Maintenance Mode info
  • PipelineGroup
    • Get All pipeline groups
    • Get specific pipeline group
    • Update pipeline group
    • Create pipeline group
    • Delete pipeline group
  • Environment Config
    • Get All Environments
    • Get specific Environment
    • Create Environment
    • Update Environment
    • Patch Environment
    • Delete Environment
  • Backup-config
    • Get Backup Info
    • Create or Update Backup
    • Delete Backup Info
  • Backup
    • Schedule Backup
    • Get Backup
  • Pipeline
    • Get pipeline status
    • Pause Pipeline
    • UnPause Pipeline
    • UnLock Pipeline
    • Schedule Pipeline
    • Get Pipeline Schedules
    • Compare pipeline instances
  • Pipeline Instances
    • Get Pipeline Instance
    • Get Pipeline History
    • Comment on Pipeline
  • Pipeline Config
    • Get pipeline config
    • Edit pipeline config
    • Create a pipeline
    • Delete a pipeline
    • Extract template from pipeline
    • Validate pipeline config syntax
  • Stage Instances
    • Cancel stage
    • Get stage instance
    • Get stage history
    • Run failed jobs
    • Run selected jobs
  • Stages
    • Run stage
  • Jobs
    • Get job instance
    • Get job history
  • Feeds
    • Get All pipelines
    • Get Pipeline
    • Get Stage
    • Get Job
    • Get Material
    • Scheduled Jobs
  • Artifact Config
    • Get Artifact Config
    • Update Artifact Config
  • Artifact Store
    • Get Artifact Stores
    • Get Artifact Store
    • Create Artifact Stores
    • Update Artifact Stores
    • Delete Artifact Stores
  • Cluster Profiles
    • Get Cluster Profiles
    • Get Cluster Profile
    • Create Cluster Profile
    • Update Cluster Profile
    • Delete Cluster Profile
  • Elastic Agent Profiles
    • Get Elastic Agent Profiles
    • Get Elastic Agent Profile
    • Create Elastic Agent Profile
    • Update Elastic Agent Profile
    • Delete Elastic Agent Profile
    • Get Elastic Agent Profile Usage
  • Secret Configs
    • Get Secret Configs
    • Get Secret Config
    • Create Secret Config
    • Update Secret Config
    • Delete Secret Config
  • Package Repositories
    • Get Package repositories
    • Get Package Repository
    • Create Package Repository
    • Update Package Repository
    • Delete Package Repository
  • Package
    • Get Package Materials
    • Get Package Material
    • Create Package Material
    • Update Package Material
    • Delete Package Material
  • Materials
    • Get All Materials
    • Get Materials Usage
    • Get material modifications
  • Site URL
    • Get Site URL
    • Create or Update Site URL
  • Mail server config
    • Get Mail server config
    • Create or Update Mail server config
    • Update Mail server config
  • Default Job timeout
    • Get Default Job timeout
    • Update Default Job timeout
  • Plugin settings
    • Get Plugin settings
    • Create Plugin settings
    • Update Plugin settings
  • Plugin Info
    • Get all plugin info
    • Get plugin info
  • Auth Configs
    • Get All Auth configs
    • Get Specific Auth config
    • Create Auth config
    • Update Auth config
    • Delete Auth config
  • System Admin
    • Get All system admins
    • Update system Admin
    • Bulk update system admins
  • Role
    • Get all roles
    • Get all roles by type
    • Get Specific role
    • Create a GoCD role
    • Create a plugin role
    • Update a role
    • Delete a role
    • Bulk update roles
  • access-tokens
    • Get all tokens for current user
    • Get one token for current user
    • Create token for current user
    • Revoke token for current user
    • Get all tokens for all users
    • Get one token for any user
    • Revoke token for any user
  • current-user
    • Get current user
    • Update current user info
  • Local Users
    • Get all users
    • Get a user
    • Create a user
    • Update a user
    • Delete a user
    • Bulk delete users
    • Bulk enable/disable users
  • Notification Filter
    • Get all notification filters
    • Get a notification filter
    • Create a notification filter
    • Update a notification filter
    • Delete a notification filter
  • Server Health Messages
    • Get Server Health messages
  • Version
    • Get Version
  • Encryption
    • Encrypt plain text value
    • Decrypt encrypted text value
  • Permission
    • Show permissions one has

Enhancements

If any of the API's are missed, feel free to raise the PR or create issues for the same.

Documentation

Index

Constants

View Source
const (
	AgentsEndpoint              = "/api/agents"
	VersionEndpoint             = "/api/version"
	ServerHealthEndpoint        = "/api/server_health_messages"
	ConfigReposEndpoint         = "/api/admin/config_repos"
	ConfigReposInternalEndpoint = "/api/internal/config_repos"
	SystemAdminEndpoint         = "/api/admin/security/system_admins"
	BackupConfigEndpoint        = "/api/config/backup"
	BackupStatsEndpoint         = "/api/backups"
	PipelineGroupEndpoint       = "/api/admin/pipeline_groups"
	EnvironmentEndpoint         = "/api/admin/environments"
	JobRunHistoryEndpoint       = "/api/agents/%s/job_run_history"
	LastXPipelineScheduledDates = "/pipelineHistory.json?pipelineName=%s"
	MaintenanceEndpoint         = "/api/admin/maintenance_mode"
	APIFeedPipelineEndpoint     = "/api/feed/pipelines.xml"
	APIJobFeedEndpoint          = "/api/feed/jobs/scheduled.xml"
	JobsAPIEndpoint             = "/api/jobs"
	StageEndpoint               = "/api/stages"
	PipelineStatus              = "/api/pipelines/%s/status"
	EncryptEndpoint             = "/api/admin/encrypt"
	ArtifactInfoEndpoint        = "/api/admin/config/server/artifact_config"
	PipelinesEndpoint           = "/api/pipelines"
	PipelineConfigEndpoint      = "/api/admin/pipelines"
	PipelineExportEndpoint      = "/api/admin/export/pipelines"
	HealthEndpoint              = "/api/v1/health"
	DefaultTimeoutEndpoint      = "/api/admin/config/server/default_job_timeout"
	MailServerConfigEndpoint    = "/api/config/mailserver"
	PluginSettingsEndpoint      = "/api/admin/plugin_settings"
	AuthConfigEndpoint          = "/api/admin/security/auth_configs"
	ClusterProfileEndpoint      = "/api/admin/elastic/cluster_profiles"
	AgentProfileEndpoint        = "/api/elastic/profiles"
	ArtifactStoreEndpoint       = "/api/admin/artifact_stores"
	SiteURLEndpoint             = "/api/admin/config/server/site_urls"
	SecretsConfigEndpoint       = "/api/admin/secret_configs" //nolint:gosec
	PackageRepositoriesEndpoint = "/api/admin/repositories"
	PackagesEndpoint            = "/api/admin/packages"
	MaterialEndpoint            = "/api/internal/materials"
	MaterialUsageEndpoint       = "/api/internal/materials/%s/usages"
	MaterialNotifyEndpoint      = "/api/admin/materials/%s/notify"
	MaterialTriggerUpdate       = "/api/internal/materials/%s/trigger_update"
	RolesEndpoint               = "/api/admin/security/roles"
	PluginInfoEndpoint          = "/api/admin/plugin_info"
	UsersEndpoint               = "/api/users"
	AdminOperationStateEndpoint = "/api/admin/operations/state"
	ElasticProfileUsageEndpoint = "/api/internal/elastic/profiles/%s/usages"
	PreflightCheckEndpoint      = "/api/admin/config_repo_ops/preflight"
	CurrentUserEndpoint         = "/api/current_user"
	PermissionsEndpoint         = "/api/auth/permissions"
	VSMEndpoint                 = "/pipelines/value_stream_map"
	HeaderVersionZero           = "application/vnd.go.cd+json"
	HeaderVersionOne            = "application/vnd.go.cd.v1+json"
	HeaderVersionTwo            = "application/vnd.go.cd.v2+json"
	HeaderVersionThree          = "application/vnd.go.cd.v3+json"
	HeaderVersionFour           = "application/vnd.go.cd.v4+json"
	HeaderVersionSeven          = "application/vnd.go.cd.v7+json"
	HeaderVersionEleven         = "application/vnd.go.cd.v11+json"
)
View Source
const (
	ContentJSON    = "application/json"
	HeaderConfirm  = "X-GoCD-Confirm"
	PipelinePrefix = "/go/api/feed/pipelines/"
	PipelineSuffix = "/stages.xml"
	LocationHeader = "Location"
)

Variables

This section is empty.

Functions

func APIErrorWithBody

func APIErrorWithBody(body string, code int) error

func APIWithCodeError

func APIWithCodeError(code int) error

func GetGoCDMethodNames added in v0.0.5

func GetGoCDMethodNames() []string

func GetPipelineName

func GetPipelineName(link string) (string, error)

GetPipelineName parses pipeline url to fetch the pipeline name.

func GetSLice added in v0.1.0

func GetSLice(values interface{}) []string

func ResponseReadError

func ResponseReadError(msg string) error

Types

type AddRemoves

type AddRemoves struct {
	Add    []string `json:"add,omitempty" yaml:"add,omitempty"`
	Remove []string `json:"remove,omitempty" yaml:"remove,omitempty"`
}

type Agent

type Agent struct {
	ID                 string      `json:"uuid,omitempty" yaml:"uuid,omitempty"`
	Name               string      `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	ElasticAgentID     string      `json:"elastic_agent_id,omitempty" yaml:"elastic_agent_id,omitempty"`
	ElasticPluginID    string      `json:"elastic_plugin_id,omitempty" yaml:"elastic_plugin_id,omitempty"`
	IPAddress          string      `json:"ip_address,omitempty" yaml:"ip_address,omitempty"`
	Sandbox            string      `json:"sandbox,omitempty" yaml:"sandbox,omitempty"`
	OS                 string      `json:"operating_system,omitempty" yaml:"operating_system,omitempty"`
	DiskSpaceAvailable interface{} `json:"free_space,omitempty" yaml:"free_space,omitempty"`
	ConfigState        string      `json:"agent_config_state,omitempty" yaml:"agent_config_state,omitempty"`
	CurrentState       string      `json:"agent_state,omitempty" yaml:"agent_state,omitempty"`
	Version            string      `json:"agent_version,omitempty" yaml:"agent_version,omitempty"`
	Resources          []string    `json:"resources,omitempty" yaml:"resources,omitempty"`
	Environments       any         `json:"environments,omitempty" yaml:"environments,omitempty"`
	BuildState         string      `json:"build_state,omitempty" yaml:"build_state,omitempty"`
	BuildDetails       BuildInfo   `json:"build_details,omitempty" yaml:"build_details,omitempty"`
	Operations         Operations  `json:"operations,omitempty" yaml:"operations,omitempty"`
	UUIDS              []string    `json:"uuids,omitempty" yaml:"uuids,omitempty"`
}

Agent holds information of a particular agent.

type AgentJobHistory

type AgentJobHistory struct {
	Jobs       []JobRunHistory `json:"jobs,omitempty" yaml:"jobs,omitempty"`
	Pagination Pagination      `json:"pagination" yaml:"pagination"`
}

AgentJobHistory holds information of pipeline run history of all GoCD agents.

type Agents

type Agents struct {
	Config []Agent `json:"agents,omitempty" yaml:"agents,omitempty"`
}

Agents holds information of all agent of GoCD.

type AgentsConfig

type AgentsConfig struct {
	Config Agents `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

AgentsConfig holds information of all agent of GoCD.

type ArtifactInfo

type ArtifactInfo struct {
	ArtifactsDir  string        `json:"artifacts_dir,omitempty" yaml:"artifacts_dir,omitempty"`
	PurgeSettings PurgeSettings `json:"purge_settings,omitempty" yaml:"purge_settings,omitempty"`
	ETAG          string        `json:"etag,omitempty" yaml:"etag,omitempty"`
}

ArtifactInfo holds the latest information of the artifacts.

type ArtifactStoresConfig added in v0.0.3

type ArtifactStoresConfig struct {
	CommonConfigs []CommonConfig `json:"artifact_stores,omitempty" yaml:"artifact_stores,omitempty"`
	ETAG          string         `json:"etag,omitempty" yaml:"etag,omitempty"`
}

ArtifactStoresConfig holds information of all config-repos present in GoCD.

type ArtifactStoresConfigs added in v0.0.3

type ArtifactStoresConfigs struct {
	ArtifactStoresConfigs ArtifactStoresConfig `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

ArtifactStoresConfigs holds information of the specified artifact-stores/cluster-profiles/agent-profiles.

type Attribute added in v0.0.4

type Attribute struct {
	URL                 string            `json:"url,omitempty" yaml:"url,omitempty"`
	Username            string            `json:"username,omitempty" yaml:"username,omitempty"`
	Password            string            `json:"password,omitempty" yaml:"password,omitempty"`
	EncryptedPassword   string            `json:"encrypted_password,omitempty" yaml:"encrypted_password,omitempty"`
	Branch              string            `json:"branch,omitempty" yaml:"branch,omitempty"`
	AutoUpdate          bool              `json:"auto_update,omitempty" yaml:"auto_update,omitempty"`
	CheckExternals      bool              `json:"check_externals,omitempty" yaml:"check_externals,omitempty"`
	UseTickets          bool              `json:"use_tickets,omitempty" yaml:"use_tickets,omitempty"`
	View                string            `json:"view,omitempty" yaml:"view,omitempty"`
	Port                string            `json:"port,omitempty" yaml:"port,omitempty"`
	ProjectPath         string            `json:"project_path,omitempty" yaml:"project_path,omitempty"`
	Domain              string            `json:"domain,omitempty" yaml:"domain,omitempty"`
	Ref                 string            `json:"ref,omitempty" yaml:"ref,omitempty"`
	Name                string            `json:"name,omitempty" yaml:"name,omitempty"`
	Stage               string            `json:"stage,omitempty" yaml:"stage,omitempty"`
	Pipeline            string            `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
	IgnoreForScheduling bool              `json:"ignore_for_scheduling,omitempty" yaml:"ignore_for_scheduling,omitempty"`
	Destination         string            `json:"destination,omitempty" yaml:"destination,omitempty"`
	InvertFilter        bool              `json:"invert_filter,omitempty" yaml:"invert_filter,omitempty"`
	SubmoduleFolder     string            `json:"submodule_folder,omitempty" yaml:"submodule_folder,omitempty"`
	ShallowClone        bool              `json:"shallow_clone,omitempty" yaml:"shallow_clone,omitempty"`
	Origin              map[string]string `json:"origin,omitempty" yaml:"origin,omitempty"`
	Filter              struct {
		Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"`
	} `json:"filter,omitempty" yaml:"filter,omitempty"`
}

Attribute holds information of material type present in GoCD.

type Auth added in v0.0.8

type Auth struct {
	UserName    string `json:"user_name,omitempty" yaml:"user_name,omitempty"`
	Password    string `json:"password,omitempty" yaml:"password,omitempty"`
	BearerToken string `json:"bearer_token,omitempty" yaml:"bearer_token,omitempty"`
}

Auth holds information of authorisations configurations used for GoCd.

type AuthConfigs

type AuthConfigs struct {
	Config struct {
		AuthConfigs []CommonConfig `json:"auth_configs" yaml:"auth_configs"`
	} `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

AuthConfigs holds information of multiple authorization configurations.

type AuthorizationConfig added in v0.1.9

type AuthorizationConfig struct {
	Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"`
	Users []string `json:"users,omitempty" yaml:"users,omitempty"`
}

AuthorizationConfig of a pipeline group.

type BackupConfig

type BackupConfig struct {
	EmailOnSuccess   bool   `json:"email_on_success,omitempty" yaml:"email_on_success,omitempty"`
	EmailOnFailure   bool   `json:"email_on_failure,omitempty" yaml:"email_on_failure,omitempty"`
	Schedule         string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
	PostBackupScript string `json:"post_backup_script,omitempty" yaml:"post_backup_script,omitempty"`
}

BackupConfig holds information of the backup configured.

type BackupStats added in v0.1.0

type BackupStats struct {
	Time           string `json:"time,omitempty" yaml:"time,omitempty"`
	Path           string `json:"path,omitempty" yaml:"path,omitempty"`
	Status         string `json:"status,omitempty" yaml:"status,omitempty"`
	ProgressStatus string `json:"progress_status,omitempty" yaml:"progress_status,omitempty"`
	Message        string `json:"message,omitempty" yaml:"message,omitempty"`
}

BackupStats holds information about the backup that was taken.

type BuildInfo added in v0.1.1

type BuildInfo struct {
	Pipeline string `json:"pipeline_name,omitempty" yaml:"pipeline_name,omitempty"`
	Stage    string `json:"stage_name,omitempty" yaml:"stage_name,omitempty"`
	Job      string `json:"job_name,omitempty" yaml:"job_name,omitempty"`
}

type CommonConfig added in v0.0.3

type CommonConfig struct {
	ID                  string                `json:"id,omitempty" yaml:"id,omitempty"`
	Name                string                `json:"name,omitempty" yaml:"name,omitempty"`
	PluginID            string                `json:"plugin_id,omitempty" yaml:"plugin_id,omitempty"`
	Description         string                `json:"description,omitempty" yaml:"description,omitempty"`
	ClusterProfileID    string                `json:"cluster_profile_id,omitempty" yaml:"cluster_profile_id,omitempty"`
	AllowOnlyKnownUsers bool                  `json:"allow_only_known_users_to_login,omitempty" yaml:"allow_only_known_users_to_login,omitempty"`
	Properties          []PluginConfiguration `json:"properties,omitempty" yaml:"properties,omitempty"`
	Rules               []map[string]string   `json:"rules,omitempty" yaml:"rules,omitempty"`
	ETAG                string                `json:"etag,omitempty" yaml:"etag,omitempty"`
}

CommonConfig holds information of the specified artifact store.

type ConfigRepo

type ConfigRepo struct {
	PluginID            string                `json:"plugin_id,omitempty" yaml:"plugin_id,omitempty"`
	ID                  string                `json:"id,omitempty" yaml:"id,omitempty"`
	Material            Material              `json:"material,omitempty" yaml:"material,omitempty"`
	Configuration       []PluginConfiguration `json:"configuration,omitempty" yaml:"configuration,omitempty"`
	Rules               []map[string]string   `json:"rules,omitempty" yaml:"rules,omitempty"`
	ETAG                string                `json:"etag,omitempty" yaml:"etag,omitempty"`
	Environments        []Environment         `json:"environments,omitempty" yaml:"environments,omitempty"`
	Groups              []PipelineGroup       `json:"groups,omitempty" yaml:"groups,omitempty"`
	ConfigRepoParseInfo ConfigRepoParseInfo   `json:"parse_info,omitempty" yaml:"parse_info,omitempty"`
}

ConfigRepo holds information of the specified config-repo.

type ConfigRepoConfig

type ConfigRepoConfig struct {
	ConfigRepos ConfigRepos `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

ConfigRepoConfig holds information of all config-repos present in GoCD.

type ConfigRepoParseInfo added in v0.1.5

type ConfigRepoParseInfo struct {
	LatestParsedModification map[string]interface{} `json:"latest_parsed_modification,omitempty" yaml:"latest_parsed_modification,omitempty"`
	Error                    string                 `json:"error,omitempty" yaml:"error,omitempty"`
	GoodModification         map[string]interface{} `json:"good_modification,omitempty" yaml:"good_modification,omitempty"`
}

type ConfigRepos

type ConfigRepos struct {
	ConfigRepos []ConfigRepo `json:"config_repos,omitempty" yaml:"config_repos,omitempty"`
}

ConfigRepos holds information of all config-repos present in GoCD.

type ElasticProfileUsage added in v0.1.3

type ElasticProfileUsage struct {
	PipelineName         string `json:"pipeline_name,omitempty" yaml:"pipeline_name,omitempty"`
	StageName            string `json:"stage_name,omitempty" yaml:"stage_name,omitempty"`
	JobName              string `json:"job_name,omitempty" yaml:"job_name,omitempty"`
	PipelineConfigOrigin string `json:"pipeline_config_origin,omitempty" yaml:"pipeline_config_origin,omitempty"`
}

ElasticProfileUsage holds information on elastic agent profile being used by a pipeline/stage/job. This is golang implementation of GoCD's internal API 'api/internal/elastic/profiles/<elastic-profile-name>/usages'.

type Encrypted

type Encrypted struct {
	EncryptedValue string `json:"encrypted_value,omitempty" yaml:"encrypted_value,omitempty"`
}

Encrypted holds the encrypted value of the passed plain text.

type EntityPermissions added in v0.1.9

type EntityPermissions struct {
	View       []string `json:"view,omitempty" yaml:"view,omitempty"`
	Administer []string `json:"administer,omitempty" yaml:"administer,omitempty"`
}

EntityPermissions is the list of the permission level one has over various entities in GoCD.

type EnvVars added in v0.0.5

type EnvVars struct {
	Name           string `json:"name,omitempty" yaml:"name,omitempty"`
	Value          string `json:"value,omitempty" yaml:"value,omitempty"`
	EncryptedValue string `json:"encrypted_value,omitempty" yaml:"encrypted_value,omitempty"`
	Secure         bool   `json:"secure,omitempty" yaml:"secure,omitempty"`
}

EnvVars holds information of environment variables present in GoCD.

type Environment

type Environment struct {
	Name      string     `json:"name,omitempty" yaml:"name,omitempty"`
	Pipelines []Pipeline `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
	EnvVars   []EnvVars  `json:"environment_variables,omitempty" yaml:"environment_variables,omitempty"`
	ETAG      string     `json:"etag,omitempty" yaml:"etag,omitempty"`
}

Environment holds information of a specific environment present in GoCD.

type EnvironmentInfo

type EnvironmentInfo struct {
	Environments Environments `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

EnvironmentInfo holds information of all environments present in GoCD.

type Environments

type Environments struct {
	Environments []Environment `json:"environments,omitempty" yaml:"environments,omitempty"`
}

Environments holds information of all environments present in GoCD.

type GoCd

type GoCd interface {
	GetAgents() ([]Agent, error)
	GetAgent(agentID string) (Agent, error)
	GetAgentJobRunHistory(agent string) (AgentJobHistory, error)
	UpdateAgent(agent Agent) error
	UpdateAgentBulk(agent Agent) error
	DeleteAgent(id string) (string, error)
	DeleteAgentBulk(agent Agent) (string, error)
	AgentKillTask(agent Agent) error
	GetServerHealthMessages() ([]ServerHealth, error)
	GetServerHealth() (map[string]string, error)
	GetConfigRepos() ([]ConfigRepo, error)
	GetConfigReposInternal() ([]ConfigRepo, error)
	GetConfigRepo(repo string) (ConfigRepo, error)
	GetConfigRepoDefinitions(repo string) (ConfigRepo, error)
	CreateConfigRepo(repoObj ConfigRepo) error
	UpdateConfigRepo(repo ConfigRepo) (string, error)
	DeleteConfigRepo(repo string) error
	ConfigRepoStatus(repo string) (map[string]bool, error)
	ConfigRepoTriggerUpdate(name string) (map[string]string, error)
	ConfigRepoPreflightCheck(pipelines map[string]string, pluginID string, repoID string) (bool, error)
	SetPipelineFiles(pipelines []PipelineFiles) map[string]string
	GetPipelineFiles(pathAndPattern ...string) ([]PipelineFiles, error)
	EnableMaintenanceMode() error
	DisableMaintenanceMode() error
	GetMaintenanceModeInfo() (Maintenance, error)
	GetSystemAdmins() (SystemAdmins, error)
	UpdateSystemAdmins(data SystemAdmins) (SystemAdmins, error)
	CreatePipelineGroup(group PipelineGroup) error
	GetPipelineGroups() ([]PipelineGroup, error)
	GetPipelineGroup(name string) (PipelineGroup, error)
	DeletePipelineGroup(name string) error
	UpdatePipelineGroup(group PipelineGroup) (PipelineGroup, error)
	GetPipelineRunHistory(pipeline, pageSize string, delay time.Duration) ([]PipelineRunHistory, error)
	GetLimitedPipelineRunHistory(pipeline, pageSize, after string) ([]PipelineRunHistory, error)
	GetPipelineSchedules(pipeline, start, perPage string) (PipelineSchedules, error)
	ValidatePipelineSyntax(pluginCfg plugin.Plugin, pipelines []string, fetchVersionFromServer bool) (bool, error)
	GetEnvironments() ([]Environment, error)
	GetEnvironment(name string) (Environment, error)
	CreateEnvironment(environment Environment) error
	UpdateEnvironment(environment Environment) (Environment, error)
	PatchEnvironment(environment any) (Environment, error)
	DeleteEnvironment(name string) error
	GetVersionInfo() (VersionInfo, error)
	GetBackupConfig() (BackupConfig, error)
	CreateOrUpdateBackupConfig(backup BackupConfig) error
	DeleteBackupConfig() error
	GetBackup(ID string) (BackupStats, error)
	ScheduleBackup() (map[string]string, error)
	GetPipelines() (PipelinesInfo, error)
	GetPipelineState(pipeline string) (PipelineState, error)
	PipelinePause(name string, message any) error
	PipelineUnPause(name string) error
	PipelineUnlock(name string) error
	SchedulePipeline(name string, schedule Schedule) error
	GetPipelineInstance(pipeline PipelineObject) (map[string]interface{}, error)
	CommentOnPipeline(comment PipelineObject) error
	GetPipelineConfig(name string) (PipelineConfig, error)
	UpdatePipelineConfig(config PipelineConfig) (PipelineConfig, error)
	CreatePipeline(config PipelineConfig) (PipelineConfig, error)
	DeletePipeline(name string) error
	ExportPipelineToConfigRepoFormat(pipelineName, pluginID string) (PipelineExport, error)
	GetScheduledJobs() (ScheduledJobs, error)
	RunFailedJobs(stage Stage) (string, error)
	RunJobs(stage Stage) (string, error)
	RunStage(stage Stage) (string, error)
	CancelStage(stage Stage) (string, error)
	ExtractTemplatePipeline(pipeline, template string) (PipelineConfig, error)
	EncryptText(value string) (Encrypted, error)
	DecryptText(value, cipherKey string) (string, error)
	GetArtifactConfig() (ArtifactInfo, error)
	UpdateArtifactConfig(ArtifactInfo) (ArtifactInfo, error)
	GetAuthConfigs() ([]CommonConfig, error)
	GetAuthConfig(name string) (CommonConfig, error)
	CreateAuthConfig(config CommonConfig) (CommonConfig, error)
	UpdateAuthConfig(config CommonConfig) (CommonConfig, error)
	DeleteAuthConfig(name string) error
	GetSiteURL() (SiteURLConfig, error)
	CreateOrUpdateSiteURL(SiteURLConfig) (SiteURLConfig, error)
	GetMailServerConfig() (MailServerConfig, error)
	CreateOrUpdateMailServerConfig(mailConfig MailServerConfig) (MailServerConfig, error)
	DeleteMailServerConfig() error
	GetDefaultJobTimeout() (map[string]string, error)
	UpdateDefaultJobTimeout(timeoutMinutes int) error
	GetPluginSettings(name string) (PluginSettings, error)
	CreatePluginSettings(settings PluginSettings) (PluginSettings, error)
	UpdatePluginSettings(settings PluginSettings) (PluginSettings, error)
	GetClusterProfiles() (ProfilesConfig, error)
	GetClusterProfile(name string) (CommonConfig, error)
	CreateClusterProfile(config CommonConfig) (CommonConfig, error)
	UpdateClusterProfile(config CommonConfig) (CommonConfig, error)
	DeleteClusterProfile(name string) error
	GetElasticAgentProfiles() (ProfilesConfig, error)
	GetElasticAgentProfile(name string) (CommonConfig, error)
	CreateElasticAgentProfile(config CommonConfig) (CommonConfig, error)
	UpdateElasticAgentProfile(config CommonConfig) (CommonConfig, error)
	DeleteElasticAgentProfile(name string) error
	GetElasticAgentProfileUsage(profileID string) ([]ElasticProfileUsage, error)
	GetArtifactStores() (ArtifactStoresConfig, error)
	GetArtifactStore(name string) (CommonConfig, error)
	CreateArtifactStore(config CommonConfig) (CommonConfig, error)
	UpdateArtifactStore(config CommonConfig) (CommonConfig, error)
	DeleteArtifactStore(name string) error
	GetSecretConfigs() (SecretsConfig, error)
	GetSecretConfig(id string) (CommonConfig, error)
	CreateSecretConfig(config CommonConfig) (CommonConfig, error)
	UpdateSecretConfig(config CommonConfig) (CommonConfig, error)
	DeleteSecretConfig(id string) error
	GetPackageRepositories() ([]PackageRepository, error)
	GetPackageRepository(id string) (PackageRepository, error)
	CreatePackageRepository(config PackageRepository) (PackageRepository, error)
	UpdatePackageRepository(config PackageRepository) (PackageRepository, error)
	DeletePackageRepository(id string) error
	GetPackages() ([]Package, error)
	GetPackage(id string) (Package, error)
	CreatePackage(config Package) (Package, error)
	UpdatePackage(config Package) (Package, error)
	DeletePackage(id string) error
	GetMaterials() ([]Material, error)
	GetMaterialUsage(materialID string) ([]string, error)
	NotifyMaterial(material Material) (string, error)
	MaterialTriggerUpdate(id string) (map[string]string, error)
	GetRoles() (RolesConfig, error)
	GetRole(name string) (Role, error)
	GetRolesByType(roleType string) (RolesConfig, error)
	CreateRole(config Role) (Role, error)
	UpdateRole(config Role) (Role, error)
	DeleteRole(name string) error
	GetPluginsInfo() (PluginsInfo, error)
	GetPluginInfo(name string) (Plugin, error)
	GetUsers() ([]User, error)
	GetUser(user string) (User, error)
	GetCurrentUser() (User, error)
	CreateUser(user User) (User, error)
	UpdateUser(user User) (User, error)
	UpdateCurrentUser(user User) (User, error)
	DeleteUser(user string) error
	BulkDeleteUsers(users map[string]interface{}) error
	BulkEnableDisableUsers(users map[string]interface{}) error
	GetPipelineVSM(pipeline, instance string) (VSM, error)
	GetPermissions(query map[string]string) (Permission, error)
	SetRetryCount(count int)
	SetRetryWaitTime(count int)
}

GoCd implements methods to get various information from GoCD.

func NewClient

func NewClient(baseURL string, auth Auth, logLevel string, caContent []byte) GoCd

NewClient returns new instance of httpClient when invoked.

type Groups

type Groups []PipelineGroup

Groups implements methods that help in fetching several other information from PipelineGroup.

func (Groups) Count

func (conf Groups) Count() int

Count return the total number of pipelines present.

type Job added in v0.1.1

type Job struct {
	Name         string `xml:"name,attr"`
	ID           string `xml:"id,attr"`
	BuildLocator string `xml:"buildLocator"`
	Environment  string `xml:"environment"`
}

Job holds information of Scheduled Job.

type JobRunHistory

type JobRunHistory struct {
	Name            string `json:"pipeline_name,omitempty" yaml:"pipeline_name,omitempty"`
	JobName         string `json:"job_name,omitempty" yaml:"job_name,omitempty"`
	StageName       string `json:"stage_name,omitempty" yaml:"stage_name,omitempty"`
	StageCounter    int64  `json:"stage_counter,string,omitempty" yaml:"stage_counter,string,omitempty"`
	PipelineCounter int64  `json:"pipeline_counter,omitempty" yaml:"pipeline_counter,omitempty"`
	Result          string `json:"result,omitempty" yaml:"result,omitempty"`
}

JobRunHistory holds information of pipeline run history of a specific GoCD agent.

type MailServerConfig

type MailServerConfig struct {
	Hostname          string `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	Port              int64  `json:"port,omitempty" yaml:"port,omitempty"`
	UserName          string `json:"username,omitempty" yaml:"username,omitempty"`
	EncryptedPassword string `json:"encrypted_password,omitempty" yaml:"encrypted_password,omitempty"`
	TLS               bool   `json:"tls,omitempty" yaml:"tls,omitempty"`
	SenderEmail       string `json:"sender_email,omitempty" yaml:"sender_email,omitempty"`
	AdminEmail        string `json:"admin_email,omitempty" yaml:"admin_email,omitempty"`
}

MailServerConfig holds information required for GoCD mail-server configuration.

type Maintenance

type Maintenance struct {
	MaintenanceInfo struct {
		Enabled  bool `json:"is_maintenance_mode,omitempty" yaml:"is_maintenance_mode,omitempty"`
		Metadata struct {
			UpdatedBy string `json:"updated_by,omitempty" yaml:"updated_by,omitempty"`
			UpdatedOn string `json:"updated_on,omitempty" yaml:"updated_on,omitempty"`
		} `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	} `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

Maintenance holds latest information available in server about maintenance mode.

type Material added in v0.0.4

type Material struct {
	Type                     string              `json:"type,omitempty" yaml:"type,omitempty"`
	Fingerprint              string              `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"`
	Attributes               Attribute           `json:"attributes,omitempty" yaml:"attributes,omitempty"`
	RepoURL                  string              `json:"repository_url,omitempty" yaml:"repository_url,omitempty"`
	Config                   MaterialConfig      `json:"config,omitempty" yaml:"config,omitempty"`
	CanTriggerUpdate         bool                `json:"can_trigger_update,omitempty" yaml:"can_trigger_update,omitempty"`
	MaterialUpdateInProgress bool                `json:"material_update_in_progress,omitempty" yaml:"material_update_in_progress,omitempty"`
	Messages                 []map[string]string `json:"messages,omitempty" yaml:"messages,omitempty"`
}

Material holds information of a particular material type present in GoCD.

type MaterialConfig added in v0.1.8

type MaterialConfig struct {
	Type        string    `json:"type,omitempty" yaml:"type,omitempty"`
	Fingerprint string    `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"`
	Attributes  Attribute `json:"attributes,omitempty" yaml:"attributes,omitempty"`
}

type MaterialUsage added in v0.1.3

type MaterialUsage struct {
	Usages []string `json:"usages,omitempty" yaml:"usages,omitempty"`
}

MaterialUsage holds information of pipelines using a specific material.

type Materials added in v0.0.4

type Materials struct {
	Materials []Material `json:"materials,omitempty" yaml:"materials,omitempty"`
}

Materials holds information of all material type present in GoCD.

type Operations added in v0.0.5

type Operations struct {
	Resources    AddRemoves `json:"resources,omitempty" yaml:"resources,omitempty"`
	Environments AddRemoves `json:"environments,omitempty" yaml:"environments,omitempty"`
}

Operations holds information of the operations to be performed on GoCD agent.

type Package added in v0.0.3

type Package struct {
	CommonConfig
	AutoUpdate    bool                  `json:"auto_update,omitempty" yaml:"auto_update,omitempty"`
	PackageRepos  CommonConfig          `json:"package_repo,omitempty" yaml:"package_repo,omitempty"`
	Configuration []PluginConfiguration `json:"configuration,omitempty" yaml:"configuration,omitempty"`
	ETAG          string                `json:"etag,omitempty" yaml:"etag,omitempty"`
}

Package holds information of the specified packages of the package repository.

type PackageRepositories added in v0.0.3

type PackageRepositories struct {
	Repositories struct {
		PackageRepositories []PackageRepository `json:"package_repositories,omitempty" yaml:"package_repositories,omitempty"`
	} `json:"_embedded" yaml:"_embedded"`
}

PackageRepositories holds information of all package repositories present in GoCD.

type PackageRepository added in v0.0.3

type PackageRepository struct {
	ID             string                `json:"repo_id,omitempty" yaml:"repo_id,omitempty"`
	Name           string                `json:"name,omitempty" yaml:"name,omitempty"`
	PluginMetaData map[string]string     `json:"plugin_metadata,omitempty" yaml:"plugin_metadata,omitempty"`
	Configuration  []PluginConfiguration `json:"configuration,omitempty" yaml:"configuration,omitempty"`
	Packages       struct {
		Packages []CommonConfig `json:"packages,omitempty" yaml:"packages,omitempty"`
	} `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
	ETAG string `json:"etag,omitempty" yaml:"etag,omitempty"`
}

PackageRepository holds information of the specified package repository.

type Packages added in v0.0.3

type Packages struct {
	Packages struct {
		Packages []Package `json:"packages,omitempty" yaml:"packages,omitempty"`
	} `json:"_embedded" yaml:"_embedded"`
}

Packages holds information of all packages present in GoCD.

type Pagination

type Pagination struct {
	PageSize int64 `json:"page_size,omitempty" yaml:"page_size,omitempty"`
	Offset   int64 `json:"offset,omitempty" yaml:"offset,omitempty"`
	Total    int64 `json:"total,omitempty" yaml:"total,omitempty"`
}

Pagination holds information which is helpful in paginating the results of job run history.

type PatchEnvironment

type PatchEnvironment struct {
	Name      string `json:"name" yaml:"name"`
	Pipelines struct {
		Add    []string `json:"add,omitempty" yaml:"add,omitempty"`
		Remove []string `json:"remove,omitempty" yaml:"remove,omitempty"`
	} `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
	EnvVars struct {
		Add []struct {
			Name  string `json:"name,omitempty" yaml:"name,omitempty"`
			Value string `json:"value,omitempty" yaml:"value,omitempty"`
		} `json:"add,omitempty" yaml:"add,omitempty"`
		Remove []string `json:"remove,omitempty" yaml:"remove,omitempty"`
	} `json:"environment_variables,omitempty" yaml:"environment_variables,omitempty"`
}

PatchEnvironment holds information that is handy while patching GoCD environment.

type Permission added in v0.1.9

type Permission struct {
	Environment         EntityPermissions `json:"environment,omitempty" yaml:"environment,omitempty"`
	ConfigRepo          EntityPermissions `json:"config_repo,omitempty" yaml:"config_repo,omitempty"`
	ClusterProfile      EntityPermissions `json:"cluster_profile,omitempty" yaml:"cluster_profile,omitempty"`
	ElasticAgentProfile EntityPermissions `json:"elastic_agent_profile,omitempty" yaml:"elastic_agent_profile,omitempty"`
}

Permission holds information of permissions that the invoked user has in GoCD.

type Pipeline

type Pipeline struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

Pipeline holds information of a specific pipeline instance.

type PipelineBuildCause added in v0.1.4

type PipelineBuildCause struct {
	Message       string `json:"trigger_message,omitempty" yaml:"message,omitempty"`
	Approver      string `json:"approver,omitempty" yaml:"approver,omitempty"`
	TriggerForced bool   `json:"trigger_forced,omitempty" yaml:"trigger_forced,omitempty"`
}

type PipelineConfig added in v0.1.1

type PipelineConfig struct {
	Name          string                 `json:"name,omitempty" yaml:"name,omitempty"`
	Config        map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
	Origin        PipelineOrigin         `json:"origin,omitempty" yaml:"origin,omitempty"`
	PausePipeline bool                   `json:"pause_pipeline,omitempty" yaml:"pause_pipeline,omitempty"`
	PauseReason   string                 `json:"pause_reason,omitempty" yaml:"pause_reason,omitempty"`
	Group         string                 `json:"group,omitempty" yaml:"group,omitempty"`
	ETAG          string                 `json:"etag,omitempty" yaml:"etag,omitempty"`
}

PipelineConfig holds configuration information of a specific pipeline.

type PipelineExport added in v0.1.5

type PipelineExport struct {
	PluginID         string `json:"plugin_id,omitempty" yaml:"plugin_id,omitempty"`
	PipelineFileName string `json:"pipeline_file_name,omitempty" yaml:"pipeline_file_name,omitempty"`
	PipelineContent  string `json:"pipeline_content,omitempty" yaml:"pipeline_content,omitempty"`
	ETAG             string `json:"etag,omitempty" yaml:"etag,omitempty"`
}

PipelineExport holds information of the pipeline that is exported to a specific config repo format.

type PipelineFiles added in v0.1.0

type PipelineFiles struct {
	Name string
	Path string
}

type PipelineGroup

type PipelineGroup struct {
	Name          string                           `json:"name,omitempty" yaml:"name,omitempty"`
	PipelineCount int                              `json:"pipeline_count,omitempty" yaml:"pipeline_count,omitempty"`
	Pipelines     []Pipeline                       `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
	Authorization PipelineGroupAuthorizationConfig `json:"authorization,omitempty" yaml:"authorization,omitempty"`
	ETAG          string                           `json:"etag,omitempty" yaml:"etag,omitempty"`
}

PipelineGroup holds information of a specific pipeline group instance.

type PipelineGroupAuthorizationConfig added in v0.1.9

type PipelineGroupAuthorizationConfig struct {
	View    AuthorizationConfig `json:"view,omitempty" yaml:"view,omitempty"`
	Admins  AuthorizationConfig `json:"admins,omitempty" yaml:"admins,omitempty"`
	Operate AuthorizationConfig `json:"operate,omitempty" yaml:"operate,omitempty"`
}

type PipelineGroups

type PipelineGroups struct {
	PipelineGroups []PipelineGroup `json:"groups,omitempty" yaml:"groups,omitempty"`
}

PipelineGroups holds information on the various pipeline groups present in GoCD.

type PipelineGroupsConfig

type PipelineGroupsConfig struct {
	PipelineGroups PipelineGroups `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

PipelineGroupsConfig holds information on the various pipeline groups present in GoCD.

type PipelineHistory

type PipelineHistory struct {
	Links     map[string]interface{}   `json:"_links,omitempty" yaml:"_links,omitempty"`
	Pipelines []map[string]interface{} `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
}

PipelineHistory holds information of the pipeline history that also helps in paginating the responses.

type PipelineLevels added in v0.1.9

type PipelineLevels struct {
	Nodes []PipelineNode `json:"nodes,omitempty" yaml:"nodes,omitempty"`
}

type PipelineNode added in v0.1.9

type PipelineNode struct {
	Parents    []string `json:"parents,omitempty" yaml:"parents,omitempty"`
	Dependents []string `json:"dependents,omitempty" yaml:"dependents,omitempty"`
	Name       string   `json:"name,omitempty" yaml:"name,omitempty"`
	ID         string   `json:"ID,omitempty" yaml:"ID,omitempty"`
}

type PipelineObject

type PipelineObject struct {
	Name    string
	Counter int
	Message string
}

PipelineObject holds information required to comment/get/history of pipeline or instance of the same.

type PipelineOrigin added in v0.1.9

type PipelineOrigin struct {
	Type string `json:"type,omitempty" yaml:"type,omitempty"`
	ID   string `json:"id,omitempty" yaml:"id,omitempty"`
}

PipelineOrigin holds the information on the source of pipeline present on GoCD.

type PipelineRunHistory added in v0.1.4

type PipelineRunHistory struct {
	Name          string             `json:"name,omitempty" yaml:"name,omitempty"`
	Counter       int                `json:"counter,omitempty" yaml:"counter,omitempty"`
	ScheduledDate float64            `json:"scheduled_date,omitempty" yaml:"scheduled_date,omitempty"`
	BuildCause    PipelineBuildCause `json:"build_cause,omitempty" yaml:"build_cause,omitempty"`
}

PipelineRunHistory holds information of pipeline run history.

type PipelineSchedules added in v0.1.4

type PipelineSchedules struct {
	Name   string                    `json:"pipelineName,omitempty" yaml:"pipelineName,omitempty"`
	Count  int                       `json:"count,omitempty" yaml:"count,omitempty"`
	Groups []PipelineSchedulesGroups `json:"groups,omitempty" yaml:"groups,omitempty"`
}

PipelineSchedules holds information of pipeline schedules.

type PipelineSchedulesGroups added in v0.1.4

type PipelineSchedulesGroups struct {
	History []PipelineSchedulesHistory `json:"history,omitempty" yaml:"history,omitempty"`
}

PipelineSchedulesGroups holds information of pipeline schedules group.

type PipelineSchedulesHistory added in v0.1.4

type PipelineSchedulesHistory struct {
	Label              string `json:"label,omitempty" yaml:"label,omitempty"`
	ScheduledDate      string `json:"scheduled_date,omitempty" yaml:"scheduled_date,omitempty"`
	ScheduledTimestamp int64  `json:"scheduled_timestamp,omitempty" yaml:"scheduled_timestamp,omitempty"`
	ModificationDate   string `json:"modification_date,omitempty" yaml:"modification_date,omitempty"`
	BuildCause         string `json:"buildCauseBy,omitempty" yaml:"buildCauseBy,omitempty"`
}

PipelineSchedulesHistory holds information of pipeline schedule history.

type PipelineSize

type PipelineSize struct {
	Size float64
	Type string
}

PipelineSize holds information of the pipeline size.

type PipelineState

type PipelineState struct {
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Paused      bool   `json:"paused,omitempty" yaml:"paused,omitempty"`
	Locked      bool   `json:"locked,omitempty" yaml:"locked,omitempty"`
	Schedulable bool   `json:"schedulable,omitempty" yaml:"schedulable,omitempty"`
	PausedBy    string `json:"paused_by,omitempty" yaml:"paused_by,omitempty"`
	PausedCause string `json:"paused_cause,omitempty" yaml:"paused_cause,omitempty"`
}

PipelineState holds information of the latest state of pipeline.

type Pipelines

type Pipelines struct {
	Pipelines []Pipeline `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
}

Pipelines holds information of the pipelines present in GoCD.

type PipelinesInfo

type PipelinesInfo struct {
	XMLName xml.Name `xml:"pipelines"`
	Link    struct {
		Href string `xml:"href,attr"`
	} `xml:"link"`
	Pipeline []struct {
		Href string `xml:"href,attr"`
	} `xml:"pipeline"`
}

PipelinesInfo holds information of list of pipelines.

type Plugin added in v0.0.7

type Plugin struct {
	ID     string `json:"id,omitempty" yaml:"id,omitempty"`
	Status struct {
		State string `json:"state,omitempty" yaml:"state,omitempty"`
	} `json:"status,omitempty" yaml:"status,omitempty"`
	PluginFileLocation string                 `json:"plugin_file_location,omitempty" yaml:"plugin_file_location,omitempty"`
	BundledPlugin      bool                   `json:"bundled_plugin,omitempty" yaml:"bundled_plugin,omitempty"`
	About              map[string]interface{} `json:"about,omitempty" yaml:"about,omitempty"`
	ETAG               string                 `json:"etag,omitempty" yaml:"etag,omitempty"`
}

Plugin holds information of a specific plugins present in GoCd.

type PluginConfiguration

type PluginConfiguration struct {
	Key            string `json:"key,omitempty" yaml:"key,omitempty"`
	Value          string `json:"value,omitempty" yaml:"value,omitempty"`
	EncryptedValue string `json:"encrypted_value,omitempty" yaml:"encrypted_value,omitempty"`
	IsSecure       bool   `json:"is_secure,omitempty" yaml:"is_secure,omitempty"`
}

PluginConfiguration holds information of the various plugin properties.

type PluginSettings

type PluginSettings struct {
	ID            string                `json:"plugin_id,omitempty" yaml:"plugin_id,omitempty"`
	Configuration []PluginConfiguration `json:"configuration,omitempty" yaml:"configuration,omitempty"`
	ETAG          string                `json:"etag,omitempty" yaml:"etag,omitempty"`
}

PluginSettings holds information of plugin settings of GoCD.

type PluginsInfo added in v0.0.7

type PluginsInfo struct {
	Plugins []Plugin `json:"plugin_info,omitempty" yaml:"plugin_info,omitempty"`
	ETAG    string   `json:"etag,omitempty" yaml:"etag,omitempty"`
}

PluginsInfo holds information of all plugins present in GoCd.

type PluginsInfos added in v0.0.7

type PluginsInfos struct {
	PluginsInfos PluginsInfo `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

PluginsInfos holds information of all plugins present in GoCd.

type ProfilesConfig added in v0.0.3

type ProfilesConfig struct {
	CommonConfigs         []CommonConfig `json:"profiles,omitempty" yaml:"profiles,omitempty"`
	ClusterProfilesConfig []CommonConfig `json:"cluster_profiles,omitempty" yaml:"cluster_profiles,omitempty"`
	ETAG                  string         `json:"etag,omitempty" yaml:"etag,omitempty"`
}

ProfilesConfig holds information of all config-repos present in GoCD.

type ProfilesConfigs added in v0.0.3

type ProfilesConfigs struct {
	ProfilesConfigs ProfilesConfig `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

ProfilesConfigs holds information of the specified artifact-stores/cluster-profiles/agent-profiles.

type PurgeSettings added in v0.1.8

type PurgeSettings struct {
	PurgeStartDiskSpace float64 `json:"purge_start_disk_space,omitempty" yaml:"purge_start_disk_space,omitempty"`
	PurgeUptoDiskSpace  float64 `json:"purge_upto_disk_space,omitempty" yaml:"purge_upto_disk_space,omitempty"`
}

PurgeSettings holds the latest information on the purge setting configuration of GoCD.

type Role added in v0.0.6

type Role struct {
	Name         string                `json:"name,omitempty" yaml:"name,omitempty"`
	Type         string                `json:"type,omitempty" yaml:"type,omitempty"`
	Attributes   RoleAttribute         `json:"attributes,omitempty" yaml:"attributes,omitempty"`
	Policy       []map[string]string   `json:"policy,omitempty" yaml:"policy,omitempty"`
	AuthConfigID string                `json:"auth_config_id,omitempty" yaml:"auth_config_id,omitempty"`
	Properties   []PluginConfiguration `json:"properties,omitempty" yaml:"properties,omitempty"`
	ETAG         string                `json:"etag,omitempty" yaml:"etag,omitempty"`
}

Role holds information of a specific role in GoCd.

type RoleAttribute added in v0.0.6

type RoleAttribute struct {
	Users        []string              `json:"users,omitempty" yaml:"users,omitempty"`
	AuthConfigID string                `json:"auth_config_id,omitempty" yaml:"auth_config_id,omitempty"`
	Properties   []PluginConfiguration `json:"properties,omitempty" yaml:"properties,omitempty"`
}

RoleAttribute holds information of a specific attribute of a role in GoCd.

type RolesConfig added in v0.0.6

type RolesConfig struct {
	Role []Role `json:"roles,omitempty" yaml:"roles,omitempty"`
	ETAG string `json:"etag,omitempty" yaml:"etag,omitempty"`
}

RolesConfig holds information of all role configs present in GoCd.

type RolesConfigs added in v0.0.6

type RolesConfigs struct {
	RolesConfigs RolesConfig `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

RolesConfigs holds information of all role configs present in GoCd.

type Schedule

type Schedule struct {
	EnvVars        []map[string]interface{} `json:"environment_variables,omitempty" yaml:"environment_variables,omitempty"`
	Materials      []map[string]interface{} `json:"materials,omitempty" yaml:"materials,omitempty"`
	UpdateMaterial bool                     `json:"update_materials_before_scheduling,omitempty" yaml:"update_materials_before_scheduling,omitempty"`
}

Schedule holds config of the pipeline that needs to be scheduled.

type ScheduledJobs added in v0.1.1

type ScheduledJobs struct {
	Job []Job `xml:"job"`
}

ScheduledJobs holds information of Scheduled Jobs.

type SecretsConfig added in v0.0.3

type SecretsConfig struct {
	CommonConfigs []CommonConfig `json:"secret_configs,omitempty" yaml:"secret_configs,omitempty"`
	ETAG          string         `json:"etag,omitempty" yaml:"etag,omitempty"`
}

SecretsConfig holds information of a specified secret config present in GoCD.

type SecretsConfigs added in v0.0.3

type SecretsConfigs struct {
	SecretsConfigs SecretsConfig `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

SecretsConfigs holds information of all secret configs present in GoCD.

type ServerHealth

type ServerHealth struct {
	Level   string `json:"level,omitempty" yaml:"level,omitempty"`
	Message string `json:"message,omitempty" yaml:"message,omitempty"`
	Time    string `json:"time,omitempty" yaml:"time,omitempty"`
	Detail  string `json:"detail,omitempty" yaml:"detail,omitempty"`
}

ServerHealth holds information of GoCD server health.

type ServerVersion

type ServerVersion struct {
	Version     string `json:"version,omitempty" yaml:"version,omitempty"`
	GitSha      string `json:"git_sha,omitempty" yaml:"git_sha,omitempty"`
	FullVersion string `json:"full_version,omitempty" yaml:"full_version,omitempty"`
	CommitURL   string `json:"commit_url,omitempty" yaml:"commit_url,omitempty"`
}

ServerVersion holds version information GoCd server.

type SiteURLConfig

type SiteURLConfig struct {
	SiteURL       string `json:"site_url,omitempty" yaml:"site_url,omitempty"`
	SecureSiteURL string `json:"secure_site_url,omitempty" yaml:"secure_site_url,omitempty"`
}

SiteURLConfig holds information of the site url of GoCD.

type Stage added in v0.1.7

type Stage struct {
	Pipeline         string   `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
	PipelineInstance string   `json:"pipeline_instance,omitempty" yaml:"pipeline_instance,omitempty"`
	StageCounter     string   `json:"stage_counter,omitempty" yaml:"stage_counter,omitempty"`
	Name             string   `json:"name,omitempty" yaml:"name,omitempty"`
	Jobs             []string `json:"jobs,omitempty" yaml:"jobs,omitempty"`
}

Stage holds information of GoCd stage.

type SystemAdmins

type SystemAdmins struct {
	Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"`
	Users []string `json:"users,omitempty" yaml:"users,omitempty"`
	ETAG  string   `json:"etag,omitempty" yaml:"etag,omitempty"`
}

SystemAdmins holds information of the system admins present.

type User added in v0.1.0

type User struct {
	Name         string     `json:"display_name,omitempty" yaml:"display_name,omitempty"`
	LoginName    string     `json:"login_name,omitempty" yaml:"login_name,omitempty"`
	Enabled      bool       `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	EmailID      string     `json:"email,omitempty" yaml:"email,omitempty"`
	EmailMe      bool       `json:"email_me,omitempty" yaml:"email_me,omitempty"`
	Admin        bool       `json:"admin,omitempty" yaml:"admin,omitempty"`
	CheckInAlias []string   `json:"checkin_aliases,omitempty" yaml:"checkin_aliases,omitempty"`
	Roles        []UserRole `json:"roles,omitempty" yaml:"roles,omitempty"`
}

User holds information of the users present in GoCD. This is golang implementation of GoCD's user API https://api.gocd.org/current/#the-user-object.

type UserRole added in v0.1.0

type UserRole struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Type string `json:"type,omitempty" yaml:"type,omitempty"`
}

UserRole holds information of the user role present in GoCD. This is golang implementation of GoCD's role API https://api.gocd.org/current/#the-user-role-object

type Users added in v0.1.0

type Users struct {
	GoCDUsers struct {
		Users []User `json:"users,omitempty" yaml:"users,omitempty"`
	} `json:"_embedded,omitempty" yaml:"_embedded,omitempty"`
}

Users holds information of all users present in GoCD.

type VSM added in v0.1.9

type VSM struct {
	Pipeline string           `json:"current_pipeline,omitempty" yaml:"current_pipeline,omitempty"`
	Level    []PipelineLevels `json:"levels,omitempty" yaml:"levels,omitempty"`
}

type VersionInfo

type VersionInfo struct {
	Version     string `json:"version,omitempty" yaml:"version,omitempty"`
	FullVersion string `json:"full_version,omitempty" yaml:"full_version,omitempty"`
	GitSHA      string `json:"git_sha,omitempty" yaml:"git_sha,omitempty"`
}

VersionInfo holds version information of GoCD server.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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