boshdirector

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 12 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 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) 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, logger *log.Logger) (*Client, error)

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(name, contextID string, logger *log.Logger, taskReporter *AsyncTaskReporter) (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) 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) 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) GetTasks

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

func (*Client) RunErrand

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

func (*Client) VMs

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

func (*Client) VerifyAuth added in v0.17.2

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

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 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 Version

type Version struct {
	MajorVersion int
	VersionType  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