action

package
v0.0.0-...-b3c9d2d Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2016 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	IsAsynchronous() bool
	IsPersistent() bool

	Resume() (interface{}, error)
	Cancel() error
}

type AgentKiller

type AgentKiller struct {
}

func NewAgentKiller

func NewAgentKiller() AgentKiller

func (AgentKiller) KillAgent

func (a AgentKiller) KillAgent(waitToKillAgentInterval time.Duration)

type ApplyAction

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

func NewApply

func NewApply(
	applier boshappl.Applier,
	specService boshas.V1Service,
	settingsService boshsettings.Service,
) (action ApplyAction)

func (ApplyAction) Cancel

func (a ApplyAction) Cancel() error

func (ApplyAction) IsAsynchronous

func (a ApplyAction) IsAsynchronous() bool

func (ApplyAction) IsPersistent

func (a ApplyAction) IsPersistent() bool

func (ApplyAction) Resume

func (a ApplyAction) Resume() (interface{}, error)

func (ApplyAction) Run

func (a ApplyAction) Run(desiredSpec boshas.V1ApplySpec) (string, error)

type CancelTaskAction

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

func NewCancelTask

func NewCancelTask(taskService boshtask.Service) (getTask CancelTaskAction)

func (CancelTaskAction) Cancel

func (a CancelTaskAction) Cancel() error

func (CancelTaskAction) IsAsynchronous

func (a CancelTaskAction) IsAsynchronous() bool

func (CancelTaskAction) IsPersistent

func (a CancelTaskAction) IsPersistent() bool

func (CancelTaskAction) Resume

func (a CancelTaskAction) Resume() (interface{}, error)

func (CancelTaskAction) Run

func (a CancelTaskAction) Run(taskID string) (string, error)

type CompilePackageAction

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

func NewCompilePackage

func NewCompilePackage(compiler boshcomp.Compiler) (compilePackage CompilePackageAction)

func (CompilePackageAction) Cancel

func (a CompilePackageAction) Cancel() error

func (CompilePackageAction) IsAsynchronous

func (a CompilePackageAction) IsAsynchronous() bool

func (CompilePackageAction) IsPersistent

func (a CompilePackageAction) IsPersistent() bool

func (CompilePackageAction) Resume

func (a CompilePackageAction) Resume() (interface{}, error)

func (CompilePackageAction) Run

func (a CompilePackageAction) Run(blobID, sha1, name, version string, deps boshcomp.Dependencies) (val map[string]interface{}, err error)

type ConfigureNetworksAction

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

func NewConfigureNetworks

func NewConfigureNetworks(agentKiller Killer) (prepareAction ConfigureNetworksAction)

func (ConfigureNetworksAction) Cancel

func (a ConfigureNetworksAction) Cancel() error

func (ConfigureNetworksAction) IsAsynchronous

func (a ConfigureNetworksAction) IsAsynchronous() bool

func (ConfigureNetworksAction) IsPersistent

func (a ConfigureNetworksAction) IsPersistent() bool

func (ConfigureNetworksAction) Resume

func (a ConfigureNetworksAction) Resume() (interface{}, error)

func (ConfigureNetworksAction) Run

func (a ConfigureNetworksAction) Run() (interface{}, error)

type DrainAction

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

func NewDrain

func NewDrain(
	notifier boshnotif.Notifier,
	specService boshas.V1Service,
	jobScriptProvider boshscript.JobScriptProvider,
	jobSupervisor boshjobsuper.JobSupervisor,
	logger boshlog.Logger,
) DrainAction

func (DrainAction) Cancel

func (a DrainAction) Cancel() error

func (DrainAction) IsAsynchronous

func (a DrainAction) IsAsynchronous() bool

func (DrainAction) IsPersistent

func (a DrainAction) IsPersistent() bool

func (DrainAction) Resume

func (a DrainAction) Resume() (interface{}, error)

func (DrainAction) Run

func (a DrainAction) Run(drainType DrainType, newSpecs ...boshas.V1ApplySpec) (int, error)

type DrainType

type DrainType string
const (
	DrainTypeUpdate   DrainType = "update"
	DrainTypeStatus   DrainType = "status"
	DrainTypeShutdown DrainType = "shutdown"
)

type ErrandResult

type ErrandResult struct {
	Stdout     string `json:"stdout"`
	Stderr     string `json:"stderr"`
	ExitStatus int    `json:"exit_code"`
}

type Factory

type Factory interface {
	Create(method string) (action Action, err error)
}

func NewFactory

func NewFactory(
	settingsService boshsettings.Service,
	platform boshplatform.Platform,
	blobstore boshblob.Blobstore,
	taskService boshtask.Service,
	notifier boshnotif.Notifier,
	applier boshappl.Applier,
	compiler boshcomp.Compiler,
	jobSupervisor boshjobsuper.JobSupervisor,
	specService boshas.V1Service,
	jobScriptProvider boshscript.JobScriptProvider,
	logger boshlog.Logger,
) (factory Factory)

type FetchLogsAction

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

func NewFetchLogs

func NewFetchLogs(
	compressor boshcmd.Compressor,
	copier boshcmd.Copier,
	blobstore boshblob.Blobstore,
	settingsDir boshdirs.Provider,
) (action FetchLogsAction)

func (FetchLogsAction) Cancel

func (a FetchLogsAction) Cancel() error

func (FetchLogsAction) IsAsynchronous

func (a FetchLogsAction) IsAsynchronous() bool

func (FetchLogsAction) IsPersistent

func (a FetchLogsAction) IsPersistent() bool

func (FetchLogsAction) Resume

func (a FetchLogsAction) Resume() (interface{}, error)

func (FetchLogsAction) Run

func (a FetchLogsAction) Run(logType string, filters []string) (value map[string]string, err error)

type GetStateAction

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

func NewGetState

func NewGetState(
	settingsService boshsettings.Service,
	specService boshas.V1Service,
	jobSupervisor boshjobsuper.JobSupervisor,
	vitalsService boshvitals.Service,
	ntpService boshntp.Service,
) (action GetStateAction)

func (GetStateAction) Cancel

func (a GetStateAction) Cancel() error

func (GetStateAction) IsAsynchronous

func (a GetStateAction) IsAsynchronous() bool

func (GetStateAction) IsPersistent

func (a GetStateAction) IsPersistent() bool

func (GetStateAction) Resume

func (a GetStateAction) Resume() (interface{}, error)

func (GetStateAction) Run

func (a GetStateAction) Run(filters ...string) (GetStateV1ApplySpec, error)

type GetStateV1ApplySpec

type GetStateV1ApplySpec struct {
	boshas.V1ApplySpec

	AgentID      string                 `json:"agent_id"`
	BoshProtocol string                 `json:"bosh_protocol"`
	JobState     string                 `json:"job_state"`
	Vitals       *boshvitals.Vitals     `json:"vitals,omitempty"`
	Processes    []boshjobsuper.Process `json:"processes,omitempty"`
	VM           boshsettings.VM        `json:"vm"`
	Ntp          boshntp.Info           `json:"ntp"`
}

type GetTaskAction

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

func NewGetTask

func NewGetTask(taskService boshtask.Service) (getTask GetTaskAction)

func (GetTaskAction) Cancel

func (a GetTaskAction) Cancel() error

func (GetTaskAction) IsAsynchronous

func (a GetTaskAction) IsAsynchronous() bool

func (GetTaskAction) IsPersistent

func (a GetTaskAction) IsPersistent() bool

func (GetTaskAction) Resume

func (a GetTaskAction) Resume() (interface{}, error)

func (GetTaskAction) Run

func (a GetTaskAction) Run(taskID string) (interface{}, error)

type Killer

type Killer interface {
	KillAgent(waitToKillAgentInterval time.Duration)
}

type ListDiskAction

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

func NewListDisk

func NewListDisk(
	settingsService boshsettings.Service,
	platform boshplatform.Platform,
	logger boshlog.Logger,
) (action ListDiskAction)

func (ListDiskAction) Cancel

func (a ListDiskAction) Cancel() error

func (ListDiskAction) IsAsynchronous

func (a ListDiskAction) IsAsynchronous() bool

func (ListDiskAction) IsPersistent

func (a ListDiskAction) IsPersistent() bool

func (ListDiskAction) Resume

func (a ListDiskAction) Resume() (interface{}, error)

func (ListDiskAction) Run

func (a ListDiskAction) Run() (interface{}, error)

type MigrateDiskAction

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

func NewMigrateDisk

func NewMigrateDisk(
	platform boshplatform.Platform,
	dirProvider boshdirs.Provider,
) (action MigrateDiskAction)

func (MigrateDiskAction) Cancel

func (a MigrateDiskAction) Cancel() error

func (MigrateDiskAction) IsAsynchronous

func (a MigrateDiskAction) IsAsynchronous() bool

func (MigrateDiskAction) IsPersistent

func (a MigrateDiskAction) IsPersistent() bool

func (MigrateDiskAction) Resume

func (a MigrateDiskAction) Resume() (interface{}, error)

func (MigrateDiskAction) Run

func (a MigrateDiskAction) Run() (value interface{}, err error)

type MountDiskAction

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

func NewMountDisk

func NewMountDisk(
	settingsService boshsettings.Service,
	diskMounter diskMounter,
	devicePathResolver boshdpresolv.DevicePathResolver,
	dirProvider boshdirs.Provider,
	logger boshlog.Logger,
) (mountDisk MountDiskAction)

func (MountDiskAction) Cancel

func (a MountDiskAction) Cancel() error

func (MountDiskAction) IsAsynchronous

func (a MountDiskAction) IsAsynchronous() bool

func (MountDiskAction) IsPersistent

func (a MountDiskAction) IsPersistent() bool

func (MountDiskAction) Resume

func (a MountDiskAction) Resume() (interface{}, error)

func (MountDiskAction) Run

func (a MountDiskAction) Run(diskCid string) (interface{}, error)

type PingAction

type PingAction struct{}

func NewPing

func NewPing() PingAction

func (PingAction) Cancel

func (a PingAction) Cancel() error

func (PingAction) IsAsynchronous

func (a PingAction) IsAsynchronous() bool

func (PingAction) IsPersistent

func (a PingAction) IsPersistent() bool

func (PingAction) Resume

func (a PingAction) Resume() (interface{}, error)

func (PingAction) Run

func (a PingAction) Run() (string, error)

type PrepareAction

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

func NewPrepare

func NewPrepare(applier boshappl.Applier) (action PrepareAction)

func (PrepareAction) Cancel

func (a PrepareAction) Cancel() error

func (PrepareAction) IsAsynchronous

func (a PrepareAction) IsAsynchronous() bool

func (PrepareAction) IsPersistent

func (a PrepareAction) IsPersistent() bool

func (PrepareAction) Resume

func (a PrepareAction) Resume() (interface{}, error)

func (PrepareAction) Run

func (a PrepareAction) Run(desiredSpec boshas.V1ApplySpec) (string, error)

type PrepareConfigureNetworksAction

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

func NewPrepareConfigureNetworks

func NewPrepareConfigureNetworks(
	platform boshplatform.Platform,
	settingsService boshsettings.Service,
) PrepareConfigureNetworksAction

func (PrepareConfigureNetworksAction) Cancel

func (PrepareConfigureNetworksAction) IsAsynchronous

func (a PrepareConfigureNetworksAction) IsAsynchronous() bool

func (PrepareConfigureNetworksAction) IsPersistent

func (a PrepareConfigureNetworksAction) IsPersistent() bool

func (PrepareConfigureNetworksAction) Resume

func (a PrepareConfigureNetworksAction) Resume() (interface{}, error)

func (PrepareConfigureNetworksAction) Run

type PrepareNetworkChangeAction

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

func NewPrepareNetworkChange

func NewPrepareNetworkChange(
	fs boshsys.FileSystem,
	settingsService boshsettings.Service,
	agentKiller Killer,
) (prepareAction PrepareNetworkChangeAction)

func (PrepareNetworkChangeAction) Cancel

func (a PrepareNetworkChangeAction) Cancel() error

func (PrepareNetworkChangeAction) IsAsynchronous

func (a PrepareNetworkChangeAction) IsAsynchronous() bool

func (PrepareNetworkChangeAction) IsPersistent

func (a PrepareNetworkChangeAction) IsPersistent() bool

func (PrepareNetworkChangeAction) Resume

func (a PrepareNetworkChangeAction) Resume() (interface{}, error)

func (PrepareNetworkChangeAction) Run

func (a PrepareNetworkChangeAction) Run() (interface{}, error)

type ReleaseApplySpecAction

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

func NewReleaseApplySpec

func NewReleaseApplySpec(platform boshplatform.Platform) (action ReleaseApplySpecAction)

func (ReleaseApplySpecAction) Cancel

func (a ReleaseApplySpecAction) Cancel() error

func (ReleaseApplySpecAction) IsAsynchronous

func (a ReleaseApplySpecAction) IsAsynchronous() bool

func (ReleaseApplySpecAction) IsPersistent

func (a ReleaseApplySpecAction) IsPersistent() bool

func (ReleaseApplySpecAction) Resume

func (a ReleaseApplySpecAction) Resume() (interface{}, error)

func (ReleaseApplySpecAction) Run

func (a ReleaseApplySpecAction) Run() (value interface{}, err error)

type RunErrandAction

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

func NewRunErrand

func NewRunErrand(
	specService boshas.V1Service,
	jobsDir string,
	cmdRunner boshsys.CmdRunner,
	logger boshlog.Logger,
) RunErrandAction

func (RunErrandAction) Cancel

func (a RunErrandAction) Cancel() error

Cancel satisfies above rules though it never returns any error

func (RunErrandAction) IsAsynchronous

func (a RunErrandAction) IsAsynchronous() bool

func (RunErrandAction) IsPersistent

func (a RunErrandAction) IsPersistent() bool

func (RunErrandAction) Resume

func (a RunErrandAction) Resume() (interface{}, error)

func (RunErrandAction) Run

func (a RunErrandAction) Run() (ErrandResult, error)

type RunScriptAction

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

func NewRunScript

func NewRunScript(
	scriptProvider boshscript.JobScriptProvider,
	specService boshas.V1Service,
	logger boshlog.Logger,
) RunScriptAction

func (RunScriptAction) Cancel

func (a RunScriptAction) Cancel() error

func (RunScriptAction) IsAsynchronous

func (a RunScriptAction) IsAsynchronous() bool

func (RunScriptAction) IsPersistent

func (a RunScriptAction) IsPersistent() bool

func (RunScriptAction) Resume

func (a RunScriptAction) Resume() (interface{}, error)

func (RunScriptAction) Run

func (a RunScriptAction) Run(scriptName string, options map[string]interface{}) (map[string]string, error)

type Runner

type Runner interface {
	Run(action Action, payload []byte) (value interface{}, err error)
	Resume(action Action, payload []byte) (value interface{}, err error)
}

func NewRunner

func NewRunner() Runner

type SSHAction

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

func NewSSH

func NewSSH(
	settingsService boshsettings.Service,
	platform boshplatform.Platform,
	dirProvider boshdirs.Provider,
	logger boshlog.Logger,
) (action SSHAction)

func (SSHAction) Cancel

func (a SSHAction) Cancel() error

func (SSHAction) IsAsynchronous

func (a SSHAction) IsAsynchronous() bool

func (SSHAction) IsPersistent

func (a SSHAction) IsPersistent() bool

func (SSHAction) Resume

func (a SSHAction) Resume() (interface{}, error)

func (SSHAction) Run

func (a SSHAction) Run(cmd string, params SSHParams) (SSHResult, error)

type SSHParams

type SSHParams struct {
	UserRegex string `json:"user_regex"`
	User      string
	Password  string
	PublicKey string `json:"public_key"`
}

type SSHResult

type SSHResult struct {
	Command       string `json:"command"`
	Status        string `json:"status"`
	IP            string `json:"ip,omitempty"`
	HostPublicKey string `json:"host_public_key,omitempty"`
}

type StartAction

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

func NewStart

func NewStart(jobSupervisor boshjobsuper.JobSupervisor, applier boshappl.Applier, specService boshas.V1Service) (start StartAction)

func (StartAction) Cancel

func (a StartAction) Cancel() error

func (StartAction) IsAsynchronous

func (a StartAction) IsAsynchronous() bool

func (StartAction) IsPersistent

func (a StartAction) IsPersistent() bool

func (StartAction) Resume

func (a StartAction) Resume() (interface{}, error)

func (StartAction) Run

func (a StartAction) Run() (value string, err error)

type StopAction

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

func NewStop

func NewStop(jobSupervisor boshjobsuper.JobSupervisor) (stop StopAction)

func (StopAction) Cancel

func (a StopAction) Cancel() error

func (StopAction) IsAsynchronous

func (a StopAction) IsAsynchronous() bool

func (StopAction) IsPersistent

func (a StopAction) IsPersistent() bool

func (StopAction) Resume

func (a StopAction) Resume() (interface{}, error)

func (StopAction) Run

func (a StopAction) Run() (value string, err error)

type UnmountDiskAction

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

func NewUnmountDisk

func NewUnmountDisk(
	settingsService boshsettings.Service,
	platform boshplatform.Platform,
) (unmountDisk UnmountDiskAction)

func (UnmountDiskAction) Cancel

func (a UnmountDiskAction) Cancel() error

func (UnmountDiskAction) IsAsynchronous

func (a UnmountDiskAction) IsAsynchronous() bool

func (UnmountDiskAction) IsPersistent

func (a UnmountDiskAction) IsPersistent() bool

func (UnmountDiskAction) Resume

func (a UnmountDiskAction) Resume() (interface{}, error)

func (UnmountDiskAction) Run

func (a UnmountDiskAction) Run(diskID string) (value interface{}, err error)

type UpdateSettingsAction

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

func NewUpdateSettings

func NewUpdateSettings(trustedCertManager cert.Manager, logger logger.Logger) UpdateSettingsAction

func (UpdateSettingsAction) Cancel

func (a UpdateSettingsAction) Cancel() error

func (UpdateSettingsAction) IsAsynchronous

func (a UpdateSettingsAction) IsAsynchronous() bool

func (UpdateSettingsAction) IsPersistent

func (a UpdateSettingsAction) IsPersistent() bool

func (UpdateSettingsAction) Resume

func (a UpdateSettingsAction) Resume() (interface{}, error)

func (UpdateSettingsAction) Run

func (a UpdateSettingsAction) Run(newSettings boshsettings.Settings) (string, error)

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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