boshdirector

package
v0.0.0-...-fb356ce Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

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

func NewBoshTaskOutputReporter() director.TaskReporter

Types

type AsyncTaskReporter

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

func NewAsyncTaskReporter

func NewAsyncTaskReporter() *AsyncTaskReporter

func (*AsyncTaskReporter) TaskFinished

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

func (*AsyncTaskReporter) TaskOutputChunk

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

func (*AsyncTaskReporter) TaskStarted

func (r *AsyncTaskReporter) TaskStarted(taskID int)

type AuthenticationOptions

type AuthenticationOptions struct {
	URL string
}

type BOSHDeployment

type BOSHDeployment interface {
	director.Deployment
}

type BoshConfig

type BoshConfig struct {
	Type    string
	Name    string
	Content string
}

type BoshEvent

type BoshEvent struct {
	TaskId int
}

type BoshHTTP

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

func (*BoshHTTP) RawDelete

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

func (*BoshHTTP) RawGet

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

func (*BoshHTTP) RawPost

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

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

func (*BoshTaskOutputReporter) TaskFinished

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

func (*BoshTaskOutputReporter) TaskOutputChunk

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

func (*BoshTaskOutputReporter) TaskStarted

func (r *BoshTaskOutputReporter) TaskStarted(taskID int)

type BoshTasks

type BoshTasks []BoshTask

func (BoshTasks) AllTasksAreDone

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

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

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

func (*Client) DeleteConfigs

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

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

func (*Client) GetConfigs

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

func (*Client) GetDNSAddresses

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

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

func (*Client) GetInfo

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

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

func (*Client) Recreate

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

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

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

func (*Client) VerifyAuth

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

type DNSRetriever

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

type DNSRetrieverFactory func(HTTP) DNSRetriever

type Deployment

type Deployment struct {
	Name string
}

type DeploymentNotFoundError

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

type Director

type Director interface {
	director.Director
}

type DirectorFactory

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

type HTTP

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

func NewBoshHTTP

func NewBoshHTTP(client *Client) HTTP

type HTTPFactory

type HTTPFactory func(*Client) HTTP

type Info

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

func (*Info) GetDirectorVersion

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

type Instance

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

type Task interface {
	director.Task
}

type TaskStateType

type TaskStateType int

type UAA

type UAA interface {
	boshuaa.UAA
}

type UAAFactory

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

type UserAuthentication

type UserAuthentication struct {
	Options AuthenticationOptions
}

type Variable

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