boshdirector

package
v0.45.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 9

Documentation

Index

Constants

View Source
const (
	StemcellDirectorVersionType = VersionType("stemcell")
	SemverDirectorVersionType   = VersionType("semver")
)
View Source
const (
	TaskQueued     = "queued"
	TaskProcessing = "processing"
	TaskDone       = "done"
	TaskError      = "error"
	TaskCancelled  = "cancelled"
	TaskCancelling = "cancelling"
	TaskTimeout    = "timeout"

	TaskComplete TaskStateType = iota
	TaskIncomplete
	TaskFailed
	TaskUnknown
)

Variables

This section is empty.

Functions

func NewBoshTaskOutputReporter added in v0.20.0

func NewBoshTaskOutputReporter() director.TaskReporter

Types

type AsyncTaskReporter added in v0.20.0

type AsyncTaskReporter struct {
	Task     chan int
	Err      chan error
	Finished chan bool
	State    string
}

func NewAsyncTaskReporter added in v0.20.0

func NewAsyncTaskReporter() *AsyncTaskReporter

func (*AsyncTaskReporter) TaskFinished added in v0.20.0

func (r *AsyncTaskReporter) TaskFinished(taskID int, state string)

func (*AsyncTaskReporter) TaskOutputChunk added in v0.20.0

func (r *AsyncTaskReporter) TaskOutputChunk(taskID int, chunk []byte)

func (*AsyncTaskReporter) TaskStarted added in v0.20.0

func (r *AsyncTaskReporter) TaskStarted(taskID int)

type AuthenticationOptions added in v0.17.2

type AuthenticationOptions struct {
	URL string
}

type BOSHDeployment added in v0.20.0

type BOSHDeployment interface {
	director.Deployment
}

type BoshConfig added in v0.26.0

type BoshConfig struct {
	Type    string
	Name    string
	Content string
}

type BoshEvent added in v0.32.0

type BoshEvent struct {
	TaskId int
}

type BoshHTTP added in v0.22.0

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

func (*BoshHTTP) RawDelete added in v0.22.0

func (b *BoshHTTP) RawDelete(path string) (string, error)

func (*BoshHTTP) RawGet added in v0.22.0

func (b *BoshHTTP) RawGet(path string) (string, error)

func (*BoshHTTP) RawPost added in v0.22.0

func (b *BoshHTTP) RawPost(path, data, contentType string) (string, error)

type BoshTask

type BoshTask struct {
	ID          int
	State       string
	Description string
	Result      string
	ContextID   string `json:"context_id,omitempty"`
}

func (BoshTask) StateType

func (t BoshTask) StateType() TaskStateType

func (BoshTask) ToLog

func (t BoshTask) ToLog() string

type BoshTaskOutput

type BoshTaskOutput struct {
	ExitCode int    `json:"exit_code"`
	StdOut   string `json:"stdout"`
	StdErr   string `json:"stderr"`
}

type BoshTaskOutputReporter added in v0.20.0

type BoshTaskOutputReporter struct {
	Output BoshTaskOutput
	Logger *log.Logger
	// contains filtered or unexported fields
}

func (*BoshTaskOutputReporter) TaskFinished added in v0.20.0

func (r *BoshTaskOutputReporter) TaskFinished(taskID int, state string)

func (*BoshTaskOutputReporter) TaskOutputChunk added in v0.20.0

func (r *BoshTaskOutputReporter) TaskOutputChunk(taskID int, chunk []byte)

func (*BoshTaskOutputReporter) TaskStarted added in v0.20.0

func (r *BoshTaskOutputReporter) TaskStarted(taskID int)

type BoshTasks

type BoshTasks []BoshTask

func (BoshTasks) AllTasksAreDone added in v0.32.0

func (t BoshTasks) AllTasksAreDone() bool

func (BoshTasks) DoneTasks

func (t BoshTasks) DoneTasks() BoshTasks

func (BoshTasks) FailedTasks

func (t BoshTasks) FailedTasks() BoshTasks

func (BoshTasks) IncompleteTasks

func (t BoshTasks) IncompleteTasks() BoshTasks

func (BoshTasks) ToLog

func (t BoshTasks) ToLog() string

type CertAppender added in v0.18.0

type CertAppender interface {
	AppendCertsFromPEM(pemCerts []byte) (ok bool)
}

type Client

type Client struct {
	PollingInterval time.Duration
	BoshInfo        Info
	// contains filtered or unexported fields
}

func New

func New(url string,
	trustedCertPEM []byte,
	certAppender CertAppender,
	directorFactory DirectorFactory,
	uaaFactory UAAFactory,
	boshAuth config.Authentication,
	dnsRetrieverFactory DNSRetrieverFactory,
	boshHTTPFactory HTTPFactory,
	logger *log.Logger) (*Client, error)

func (*Client) DeleteConfig added in v0.26.0

func (c *Client) DeleteConfig(configType, configName string, logger *log.Logger) (bool, error)

func (*Client) DeleteConfigs added in v0.26.0

func (c *Client) DeleteConfigs(configName string, logger *log.Logger) error

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(name, contextID string, force bool, taskReporter *AsyncTaskReporter, logger *log.Logger) (int, error)

func (*Client) Deploy

func (c *Client) Deploy(manifest []byte, contextID string, logger *log.Logger, taskReporter *AsyncTaskReporter) (int, error)

func (*Client) Director added in v0.20.0

func (c *Client) Director(taskReporter director.TaskReporter) (director.Director, error)

func (*Client) GetConfigs added in v0.26.0

func (c *Client) GetConfigs(configName string, logger *log.Logger) ([]BoshConfig, error)

func (*Client) GetDNSAddresses added in v0.22.0

func (c *Client) GetDNSAddresses(deploymentName string, dnsRequest []config.BindingDNS) (map[string]string, error)

func (*Client) GetDeployment

func (c *Client) GetDeployment(name string, logger *log.Logger) ([]byte, bool, error)

func (*Client) GetDeployments

func (c *Client) GetDeployments(logger *log.Logger) ([]Deployment, error)

func (*Client) GetEvents added in v0.32.0

func (c *Client) GetEvents(deploymentName string, action string, logger *log.Logger) ([]BoshEvent, error)

func (*Client) GetInfo added in v0.17.2

func (c *Client) GetInfo(logger *log.Logger) (Info, error)

func (*Client) GetNormalisedTasksByContext

func (c *Client) GetNormalisedTasksByContext(deploymentName, contextID string, logger *log.Logger) (BoshTasks, error)

func (*Client) GetTask

func (c *Client) GetTask(taskID int, logger *log.Logger) (BoshTask, error)

func (*Client) GetTaskOutput

func (c *Client) GetTaskOutput(taskID int, logger *log.Logger) (BoshTaskOutput, error)

func (*Client) GetTasksInProgress added in v0.38.0

func (c *Client) GetTasksInProgress(deploymentName string, logger *log.Logger) (BoshTasks, error)

func (*Client) Recreate added in v0.25.0

func (c *Client) Recreate(deploymentName, contextID string, logger *log.Logger, taskReporter *AsyncTaskReporter) (int, error)

func (*Client) RunErrand

func (c *Client) RunErrand(deploymentName, errandName string, errandInstances []string, contextID string, logger *log.Logger, taskReporter *AsyncTaskReporter) (int, error)

func (*Client) UpdateConfig added in v0.26.0

func (c *Client) UpdateConfig(configType, configName string, configContent []byte, logger *log.Logger) error

func (*Client) VMs

func (c *Client) VMs(deploymentName string, logger *log.Logger) (bosh.BoshVMs, error)

func (*Client) Variables added in v0.22.0

func (c *Client) Variables(deploymentName string, logger *log.Logger) ([]Variable, error)

func (*Client) VerifyAuth added in v0.17.2

func (c *Client) VerifyAuth(logger *log.Logger) error

type DNSRetriever added in v0.22.0

type DNSRetriever interface {
	LinkProviderID(deploymentName, instanceGroupName, providerName string) (string, error)
	CreateLinkConsumer(providerID string) (string, error)
	GetLinkAddress(consumerLinkID string, azs []string, status string) (string, error)
	DeleteLinkConsumer(consumerID string) error
}

type DNSRetrieverFactory added in v0.22.0

type DNSRetrieverFactory func(HTTP) DNSRetriever

type Deployment

type Deployment struct {
	Name string
}

type DeploymentNotFoundError

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

type Director added in v0.19.0

type Director interface {
	director.Director
}

type DirectorFactory added in v0.19.0

type DirectorFactory interface {
	New(config director.FactoryConfig, taskReporter director.TaskReporter, fileReporter director.FileReporter) (director.Director, error)
}

type HTTP added in v0.22.0

type HTTP interface {
	RawGet(path string) (string, error)
	RawPost(path, data, contentType string) (string, error)
	RawDelete(path string) (string, error)
}

func NewBoshHTTP added in v0.22.0

func NewBoshHTTP(client *Client) HTTP

type HTTPFactory added in v0.22.0

type HTTPFactory func(*Client) HTTP

type Info

type Info struct {
	Version            string
	UserAuthentication UserAuthentication `json:"user_authentication"`
}

func (*Info) GetDirectorVersion added in v0.17.2

func (boshInfo *Info) GetDirectorVersion() (Version, error)

type Instance added in v0.18.0

type Instance struct {
	Group string `json:"group"`
	ID    string `json:"id,omitempty"`
}

type RequestError

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

func NewRequestError

func NewRequestError(e error) RequestError

type Task added in v0.20.0

type Task interface {
	director.Task
}

type TaskStateType

type TaskStateType int

type UAA added in v0.19.0

type UAA interface {
	boshuaa.UAA
}

type UAAFactory added in v0.19.0

type UAAFactory interface {
	New(config boshuaa.Config) (boshuaa.UAA, error)
}

type UserAuthentication added in v0.17.2

type UserAuthentication struct {
	Options AuthenticationOptions
}

type Variable added in v0.22.0

type Variable struct {
	Path string `json:"name"`
	ID   string `json:"id"`
}

type Version

type Version struct {
	Version semver.Version
	Type    VersionType
}

type VersionType

type VersionType string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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