Documentation ¶
Overview ¶
Package daisy describes a daisy workflow.
Index ¶
- Variables
- func CombineGuestOSFeatures(features1 []*compute.GuestOsFeature, features2 ...string) []*compute.GuestOsFeature
- func CombineGuestOSFeaturesBeta(features1 []*computeBeta.GuestOsFeature, features2 ...string) []*computeBeta.GuestOsFeature
- func JSONError(file string, data []byte, err error) error
- func NamedSubexp(re *regexp.Regexp, s string) map[string]string
- func UpdateInstanceNoExternalIP(step *Step)
- type AttachDisk
- type AttachDisks
- type CopyGCSObject
- type CopyGCSObjects
- type CreateDisks
- type CreateFirewallRules
- type CreateForwardingRules
- type CreateImages
- type CreateInstances
- type CreateMachineImages
- type CreateNetworks
- type CreateSnapshots
- type CreateSubnetworks
- type CreateTargetInstances
- type DError
- type DeleteResources
- type DeprecateImage
- type DeprecateImages
- type DetachDisk
- type DetachDisks
- type Disk
- type FailureMatches
- type FirewallRule
- type ForwardingRule
- type GCSLogger
- type GuestAttribute
- type Image
- type ImageAlpha
- type ImageBase
- type ImageBeta
- type ImageInterface
- type IncludeWorkflow
- type Instance
- type InstanceBase
- type InstanceBeta
- type InstanceInterface
- type InstanceSignal
- type LogEntry
- type Logger
- type MachineImage
- type Network
- type QuotaAvailable
- type ResizeDisk
- type ResizeDisks
- type Resource
- type Resume
- type SerialOutput
- type Snapshot
- type StartInstances
- type Step
- type StopInstances
- type SubWorkflow
- type Subnetwork
- type Suspend
- type TargetInstance
- type TimeRecord
- type UpdateInstanceMetadata
- type UpdateInstancesMetadata
- type Var
- type WaitForAnyInstancesSignal
- type WaitForAvailableQuotas
- type WaitForInstancesSignal
- type Workflow
- func (w *Workflow) AddDependency(dependent *Step, dependencies ...*Step) error
- func (w *Workflow) AddSerialConsoleOutputValue(k, v string)
- func (w *Workflow) AddVar(k, v string)
- func (w *Workflow) CancelWithReason(reason string)
- func (w *Workflow) CancelWorkflow()
- func (w *Workflow) DisableCloudLogging()
- func (w *Workflow) DisableGCSLogging()
- func (w *Workflow) DisableStdoutLogging()
- func (w *Workflow) GetSerialConsoleOutputValue(k string) string
- func (w *Workflow) GetStepTimeRecords() []TimeRecord
- func (w *Workflow) ID() string
- func (w *Workflow) IterateWorkflowSteps(cb func(step *Step))deprecated
- func (w *Workflow) LogStepInfo(stepName, stepType, format string, a ...interface{})
- func (w *Workflow) LogWorkflowInfo(format string, a ...interface{})
- func (w *Workflow) NewIncludedWorkflowFromFile(file string) (*Workflow, DError)
- func (w *Workflow) NewStep(name string) (*Step, error)
- func (w *Workflow) NewSubWorkflow() *Workflow
- func (w *Workflow) NewSubWorkflowFromFile(file string) (*Workflow, DError)
- func (w *Workflow) PopulateClients(ctx context.Context, options ...option.ClientOption) error
- func (w *Workflow) Print(ctx context.Context)
- func (w *Workflow) Run(ctx context.Context) (err DError)
- func (w *Workflow) SetLogProcessHook(hook func(string) string)
- func (w *Workflow) Validate(ctx context.Context) DError
- type WorkflowModifierdeprecated
Constants ¶
This section is empty.
Variables ¶
var SleepFn = time.Sleep
SleepFn function is mocked on testing.
Functions ¶
func CombineGuestOSFeatures ¶
func CombineGuestOSFeatures(features1 []*compute.GuestOsFeature, features2 ...string) []*compute.GuestOsFeature
CombineGuestOSFeatures merges two slices of Guest OS features and returns a new slice instance. Duplicates are removed.
func CombineGuestOSFeaturesBeta ¶
func CombineGuestOSFeaturesBeta(features1 []*computeBeta.GuestOsFeature, features2 ...string) []*computeBeta.GuestOsFeature
CombineGuestOSFeaturesBeta merges two slices of Beta Guest OS features and returns a new slice instance. Duplicates are removed.
func JSONError ¶
JSONError turns an error from json.Unmarshal and returns a more user friendly error.
func NamedSubexp ¶
NamedSubexp extracts sub matches in the exp
func UpdateInstanceNoExternalIP ¶
func UpdateInstanceNoExternalIP(step *Step)
UpdateInstanceNoExternalIP updates Create Instance step to operate when no external IP access is allowed by the VPC Daisy workflow is running in.
Types ¶
type AttachDisk ¶
type AttachDisk struct { compute.AttachedDisk // Instance to attach to. Instance string // contains filtered or unexported fields }
AttachDisk is used to attach a GCE disk into an instance.
type CopyGCSObject ¶
type CopyGCSObject struct {
Source, Destination string
ACLRules []*storage.ACLRule `json:",omitempty"`
}
CopyGCSObject copies a GCS object from Source to Destination.
type CopyGCSObjects ¶
type CopyGCSObjects []CopyGCSObject
CopyGCSObjects is a Daisy CopyGCSObject workflow step.
type CreateFirewallRules ¶
type CreateFirewallRules []*FirewallRule
CreateFirewallRules is a Daisy CreateFirewallRules workflow step.
type CreateForwardingRules ¶
type CreateForwardingRules []*ForwardingRule
CreateForwardingRules is a Daisy CreateForwardingRules workflow step.
type CreateImages ¶
type CreateImages struct { Images []*Image ImagesAlpha []*ImageAlpha ImagesBeta []*ImageBeta }
CreateImages is a Daisy CreateImages workflow step.
func (*CreateImages) UnmarshalJSON ¶
func (ci *CreateImages) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals Image.
type CreateInstances ¶
type CreateInstances struct { Instances []*Instance InstancesBeta []*InstanceBeta }
CreateInstances is a Daisy CreateInstances workflow step.
func (*CreateInstances) UnmarshalJSON ¶
func (ci *CreateInstances) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals Instance.
type CreateMachineImages ¶
type CreateMachineImages []*MachineImage
CreateMachineImages is a Daisy workflow step for creating machine images.
type CreateNetworks ¶
type CreateNetworks []*Network
CreateNetworks is a Daisy CreateNetwork workflow step.
type CreateSnapshots ¶
type CreateSnapshots []*Snapshot
CreateSnapshots is a Daisy CreateSnapshots workflow step.
type CreateSubnetworks ¶
type CreateSubnetworks []*Subnetwork
CreateSubnetworks is a Daisy CreateSubnetwork workflow step.
type CreateTargetInstances ¶
type CreateTargetInstances []*TargetInstance
CreateTargetInstances is a Daisy CreateTargetInstances workflow step.
type DError ¶
type DError interface { error AnonymizedErrs() []string CausedByErrType(t string) bool // contains filtered or unexported methods }
DError is a Daisy external error type. It has: - optional error typing - multiple error aggregation - safe error messages in which privacy information is removed
Default implementation: The default DError implementation is flat, DError.add(anotherDErr) will merge the two dErrs into a single, flat DError instead of making anotherDErr a child to DError.
type DeleteResources ¶
type DeleteResources struct { Disks []string `json:",omitempty"` Images []string `json:",omitempty"` MachineImages []string `json:",omitempty"` Instances []string `json:",omitempty"` Networks []string `json:",omitempty"` Subnetworks []string `json:",omitempty"` GCSPaths []string `json:",omitempty"` Firewalls []string `json:",omitempty"` }
DeleteResources deletes GCE/GCS resources.
type DeprecateImage ¶
type DeprecateImage struct { // Image to set deprecation status on. Image string // DeprecationStatus to set for image. DeprecationStatus compute.DeprecationStatus // DeprecationStatus to set for image. DeprecationStatusAlpha computeAlpha.DeprecationStatus // Project image is in, overrides workflow Project. Project string `json:",omitempty"` }
DeprecateImage sets the deprecation status on a GCE image.
type DeprecateImages ¶
type DeprecateImages []*DeprecateImage
DeprecateImages is a Daisy DeprecateImage workflow step.
type DetachDisk ¶
type DetachDisk struct { // Instance to detach diskName. Instance string DeviceName string // contains filtered or unexported fields }
DetachDisk is used to detach a GCE disk from an instance.
type Disk ¶
type Disk struct { compute.Disk Resource // Size of this disk. SizeGb string `json:"sizeGb,omitempty"` }
Disk is used to create a GCE disk in a project.
func (*Disk) MarshalJSON ¶
MarshalJSON is a hacky workaround to prevent Disk from using compute.Disk's implementation.
type FailureMatches ¶
type FailureMatches []string
FailureMatches is a list of matching failure strings.
func (*FailureMatches) UnmarshalJSON ¶
func (fms *FailureMatches) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals FailureMatches.
type FirewallRule ¶
type FirewallRule struct { compute.Firewall Resource }
FirewallRule is used to create a GCE firewallRule.
func (*FirewallRule) MarshalJSON ¶
func (fir *FirewallRule) MarshalJSON() ([]byte, error)
MarshalJSON is a hacky workaround to compute.Firewall's implementation.
type ForwardingRule ¶
type ForwardingRule struct { compute.ForwardingRule Resource }
ForwardingRule is used to create a GCE forwardingRule.
func (*ForwardingRule) MarshalJSON ¶
func (fr *ForwardingRule) MarshalJSON() ([]byte, error)
MarshalJSON is a hacky workaround to compute.ForwardingRule's implementation.
type GCSLogger ¶
type GCSLogger struct {
// contains filtered or unexported fields
}
GCSLogger is a logger that writes to a GCS object.
func NewGCSLogger ¶
NewGCSLogger creates a new GCSLogger.
type GuestAttribute ¶
type GuestAttribute struct { Namespace string `json:",omitempty"` KeyName string `json:",omitempty"` SuccessValue string `json:",omitempty"` }
GuestAttribute describes text signal strings that will be written to guest attributes. This step will not complete until the key exists and matches the value in SuccessValue (if specified and non empty). If SuccessValue is set, any other value in the key will cause the step to fail.
type Image ¶
type Image struct { ImageBase compute.Image // GuestOsFeatures to set for the image. GuestOsFeatures guestOsFeatures `json:"guestOsFeatures,omitempty"` }
Image is used to create a GCE image using GA API. Supported sources are a GCE disk or a RAW image listed in Workflow.Sources.
func (*Image) MarshalJSON ¶
MarshalJSON is a hacky workaround to prevent Image from using compute.Image's implementation.
type ImageAlpha ¶
type ImageAlpha struct { ImageBase computeAlpha.Image // GuestOsFeatures to set for the image. GuestOsFeatures guestOsFeatures `json:"guestOsFeatures,omitempty"` }
ImageAlpha is used to create a GCE image using Alpha API. Supported sources are a GCE disk or a RAW image listed in Workflow.Sources.
type ImageBase ¶
type ImageBase struct { Resource // Should an existing image of the same name be deleted, defaults to false // which will fail validation. OverWrite bool `json:",omitempty"` //Ignores license validation if 403/forbidden returned IgnoreLicenseValidationIfForbidden bool `json:",omitempty"` }
ImageBase is a base struct for GA/Beta/Alpha images. It holds the shared properties between them.
type ImageBeta ¶
type ImageBeta struct { ImageBase computeBeta.Image // GuestOsFeatures to set for the image. GuestOsFeatures guestOsFeatures `json:"guestOsFeatures,omitempty"` }
ImageBeta is used to create a GCE image using Beta API. Supported sources are a GCE disk or a RAW image listed in Workflow.Sources.
type ImageInterface ¶
type ImageInterface interface {
// contains filtered or unexported methods
}
ImageInterface represent abstract Image across different API stages (Alpha, Beta, API)
type IncludeWorkflow ¶
type IncludeWorkflow struct { Path string Vars map[string]string `json:",omitempty"` Workflow *Workflow `json:",omitempty"` }
IncludeWorkflow defines a Daisy workflow injection step. This step will 'include' the workflow found the path given into the parent workflow. Unlike a Subworkflow the included workflow will exist in the same namespace as the parent and have access to all its resources.
type Instance ¶
type Instance struct { InstanceBase compute.Instance // Additional metadata to set for the instance. Metadata map[string]string `json:"metadata,omitempty"` }
Instance is used to create a GCE instance using GA API. By default, output of serial port 1 will be streamed to the daisy logs directory.
func (*Instance) MarshalJSON ¶
MarshalJSON is a workaround to prevent Instance from using compute.Instance's implementation.
type InstanceBase ¶
type InstanceBase struct { Resource // OAuth2 scopes to give the instance. If left unset // https://www.googleapis.com/auth/devstorage.read_only will be added. Scopes []string `json:",omitempty"` // StartupScript is the Sources path to a startup script to use in this step. // This will be automatically mapped to the appropriate metadata key. StartupScript string `json:",omitempty"` // RetryWhenExternalIPDenied indicates whether to retry CreateInstances when // it fails due to external IP denied by organization IP. RetryWhenExternalIPDenied bool `json:",omitempty"` // Should an existing instance of the same name be deleted, defaults to false // which will fail validation. OverWrite bool `json:",omitempty"` // Serial port to log to GCS bucket, defaults to 1 SerialPortsToLog []int64 `json:",omitempty"` }
InstanceBase is a base struct for GA/Beta instances. It holds the shared properties between the two.
type InstanceBeta ¶
type InstanceBeta struct { InstanceBase computeBeta.Instance // Additional metadata to set for the instance. Metadata map[string]string `json:"metadata,omitempty"` }
InstanceBeta is used to create a GCE instance using Beta API. By default, output of serial port 1 will be streamed to the daisy logs directory.
type InstanceInterface ¶
type InstanceInterface interface {
// contains filtered or unexported methods
}
InstanceInterface represent abstract Instance across different API stages (Alpha, Beta, API)
type InstanceSignal ¶
type InstanceSignal struct { // Instance name to wait for. Name string // Interval to check for signal (default is 5s). // Must be parsable by https://golang.org/pkg/time/#ParseDuration. Interval string `json:",omitempty"` // DEPRECATED use Status signal instead // Wait for the instance to stop. Stopped bool `json:",omitempty"` // Wait for a string match in the serial output. SerialOutput *SerialOutput `json:",omitempty"` // Wait for a key or value match in guest attributes. GuestAttribute *GuestAttribute `json:",omitempty"` // Wait for the instance to have one of the given statuses // Cannot be set at the same time as Stopped Status []string `json:",omitempty"` // contains filtered or unexported fields }
InstanceSignal waits for a signal from an instance.
type LogEntry ¶
type LogEntry struct { LocalTimestamp time.Time `json:"localTimestamp"` WorkflowName string `json:"workflow"` StepName string `json:"stepName,omitempty"` StepType string `json:"stepType,omitempty"` SerialPort1 string `json:"serialPort1,omitempty"` Message string `json:"message"` Type string `json:"type"` }
LogEntry encapsulates a single log entry.
type Logger ¶
type Logger interface { WriteLogEntry(e *LogEntry) // AppendSerialPortLogs appends a portion of serial port logs for a GCE instance. AppendSerialPortLogs(w *Workflow, instance string, logs string) // WriteSerialPortLogsToCloudLogging writes all of the collected logs for instance to cloud logging. WriteSerialPortLogsToCloudLogging(w *Workflow, instance string) // ReadSerialPortLogs returns all collected serial port logs, with one entry per instance. ReadSerialPortLogs() []string Flush() }
Logger is a helper that encapsulates the logging logic for Daisy.
type MachineImage ¶
type MachineImage struct { compute.MachineImage Resource // Should an existing machine image of the same name be deleted. // Defaults to false which will fail validation if a machine image with the // same name exists in the project. OverWrite bool `json:",omitempty"` }
MachineImage is used to create a GCE machine image.
func (*MachineImage) MarshalJSON ¶
func (mi *MachineImage) MarshalJSON() ([]byte, error)
MarshalJSON is a workaround to prevent MachineImage from using computeBeta.MachineImage's implementation.
type Network ¶
type Network struct { compute.Network AutoCreateSubnetworks *bool `json:"autoCreateSubnetworks,omitempty"` Resource }
Network is used to create a GCE network.
func (*Network) MarshalJSON ¶
MarshalJSON is a hacky workaround to compute.Network's implementation.
type QuotaAvailable ¶
type QuotaAvailable struct { // Metric name to wait for. Metric string // Region to check for quota in. Region string // Units of quota which must be available. Units float64 }
QuotaAvailable waits for some units of quota to be available in a given region. The individual items to wait for in the workflow step.
type ResizeDisk ¶
type ResizeDisk struct { compute.DisksResizeRequest // Name of the disk to be resized Name string SizeGb string "json:\"sizeGb,omitempty\"" }
ResizeDisk is used to resize a GCE disk.
type Resource ¶
type Resource struct { // If this is unset Workflow.Project is used. Project string `json:",omitempty"` // Should this resource be cleaned up after the workflow? NoCleanup bool `json:",omitempty"` // If set Daisy will use this as the resource name instead of generating a name. Mutually exclusive with ExactName. RealName string `json:",omitempty"` // If set, Daisy will use the exact name as specified by the user instead of generating a name. Mutually exclusive with RealName. ExactName bool `json:",omitempty"` // contains filtered or unexported fields }
Resource is the base struct for Daisy representation structs for GCE resources. This base struct defines some common user-definable fields, as well as some Daisy bookkeeping fields.
type SerialOutput ¶
type SerialOutput struct { Port int64 `json:",omitempty"` SuccessMatch string `json:",omitempty"` FailureMatch FailureMatches `json:"failureMatch,omitempty"` StatusMatch string `json:",omitempty"` }
SerialOutput describes text signal strings that will be written to the serial port. A StatusMatch will print out the matching line from the StatusMatch onward. This step will not complete until a line in the serial output matches SuccessMatch or FailureMatch. A match with FailureMatch will cause the step to fail.
type Snapshot ¶
type Snapshot struct { compute.Snapshot Resource }
Snapshot is used to create a GCE disk in a project.
func (*Snapshot) MarshalJSON ¶
MarshalJSON is a hacky workaround to prevent Snapshot from using compute.Snapshot's implementation.
type StartInstances ¶
type StartInstances struct {
Instances []string `json:",omitempty"`
}
StartInstances start GCE instances.
type Step ¶
type Step struct { //Timeout description TimeoutDescription string `json:",omitempty"` // Time to wait for this step to complete (default 10m). // Must be parsable by https://golang.org/pkg/time/#ParseDuration. Timeout string `json:",omitempty"` // Only one of the below fields should exist for each instance of Step. AttachDisks *AttachDisks `json:",omitempty"` DetachDisks *DetachDisks `json:",omitempty"` CreateDisks *CreateDisks `json:",omitempty"` CreateForwardingRules *CreateForwardingRules `json:",omitempty"` CreateFirewallRules *CreateFirewallRules `json:",omitempty"` CreateImages *CreateImages `json:",omitempty"` CreateMachineImages *CreateMachineImages `json:",omitempty"` CreateInstances *CreateInstances `json:",omitempty"` CreateNetworks *CreateNetworks `json:",omitempty"` CreateSnapshots *CreateSnapshots `json:",omitempty"` CreateSubnetworks *CreateSubnetworks `json:",omitempty"` CreateTargetInstances *CreateTargetInstances `json:",omitempty"` CopyGCSObjects *CopyGCSObjects `json:",omitempty"` ResizeDisks *ResizeDisks `json:",omitempty"` StartInstances *StartInstances `json:",omitempty"` StopInstances *StopInstances `json:",omitempty"` DeleteResources *DeleteResources `json:",omitempty"` DeprecateImages *DeprecateImages `json:",omitempty"` IncludeWorkflow *IncludeWorkflow `json:",omitempty"` SubWorkflow *SubWorkflow `json:",omitempty"` Suspend *Suspend `json:",omitempty"` Resume *Resume `json:",omitempty"` WaitForInstancesSignal *WaitForInstancesSignal `json:",omitempty"` WaitForAnyInstancesSignal *WaitForAnyInstancesSignal `json:",omitempty"` WaitForAvailableQuotas *WaitForAvailableQuotas `json:",omitempty"` UpdateInstancesMetadata *UpdateInstancesMetadata `json:",omitempty"` // contains filtered or unexported fields }
Step is a single daisy workflow step.
func NewStep ¶
NewStep creates a Step with given name and timeout with the specified workflow. If timeout is less or equal to zero, defaultTimeout from the workflow will be used
func NewStepDefaultTimeout ¶
NewStepDefaultTimeout creates a Step with given name using default timeout from the workflow
type StopInstances ¶
type StopInstances struct {
Instances []string `json:",omitempty"`
}
StopInstances stop GCE instances.
type SubWorkflow ¶
type SubWorkflow struct { Path string Vars map[string]string `json:",omitempty"` Workflow *Workflow `json:",omitempty"` }
SubWorkflow defines a Daisy sub workflow.
type Subnetwork ¶
type Subnetwork struct { compute.Subnetwork Resource }
Subnetwork is used to create a GCE subnetwork.
func (*Subnetwork) MarshalJSON ¶
func (sn *Subnetwork) MarshalJSON() ([]byte, error)
MarshalJSON is a hacky workaround to compute.Subnetwork's implementation.
type TargetInstance ¶
type TargetInstance struct { compute.TargetInstance Resource }
TargetInstance is used to create a GCE targetInstance.
func (*TargetInstance) MarshalJSON ¶
func (ti *TargetInstance) MarshalJSON() ([]byte, error)
MarshalJSON is a hacky workaround to compute.TargetInstance's implementation.
type TimeRecord ¶
TimeRecord is a type with info of a step execution time
type UpdateInstanceMetadata ¶
type UpdateInstanceMetadata struct { // Metadata Metadata map[string]string `json:"metadata,omitempty"` // Instance to attach to. Instance string // contains filtered or unexported fields }
UpdateInstanceMetadata is used to update an instance metadata.
type UpdateInstancesMetadata ¶
type UpdateInstancesMetadata []*UpdateInstanceMetadata
UpdateInstancesMetadata is a Daisy UpdateInstancesMetadata workflow step.
type Var ¶
type Var struct { Value string Required bool `json:",omitempty"` Description string `json:",omitempty"` }
Var is a type with a flexible JSON representation. A Var can be represented by either a string, or by this struct definition. A Var that is represented by a string will unmarshal into the struct: {Value: <string>, Required: false, Description: ""}.
func (*Var) UnmarshalJSON ¶
UnmarshalJSON unmarshals a Var.
type WaitForAnyInstancesSignal ¶
type WaitForAnyInstancesSignal []*InstanceSignal
WaitForAnyInstancesSignal is a Daisy WaitForAnyInstancesSignal workflow step.
type WaitForAvailableQuotas ¶
type WaitForAvailableQuotas struct { // Interval to check for signal. // Must be parsable by https://golang.org/pkg/time/#ParseDuration. Interval string `json:",omitempty"` Quotas []*QuotaAvailable // contains filtered or unexported fields }
WaitForAvailableQuotas is a daisy workflow step to wait for a list of quotas to be available at the same time.
type WaitForInstancesSignal ¶
type WaitForInstancesSignal []*InstanceSignal
WaitForInstancesSignal is a Daisy WaitForInstancesSignal workflow step.
type Workflow ¶
type Workflow struct { // Populated on New() construction. Cancel chan struct{} `json:"-"` // Workflow template fields. // Workflow name. Name string `json:",omitempty"` // Project to run in. Project string `json:",omitempty"` // Zone to run in. Zone string `json:",omitempty"` // GCS Path to use for scratch data and write logs/results to. GCSPath string `json:",omitempty"` // Path to OAuth credentials file. OAuthPath string `json:",omitempty"` // Sources used by this workflow, map of destination to source. Sources map[string]string `json:",omitempty"` // Vars defines workflow variables, substitution is done at Workflow run time. Vars map[string]Var `json:",omitempty"` Steps map[string]*Step `json:",omitempty"` // Map of steps to their dependencies. Dependencies map[string][]string `json:",omitempty"` // Default timout for each step, defaults to 10m. // Must be parsable by https://golang.org/pkg/time/#ParseDuration. DefaultTimeout string `json:",omitempty"` Logger Logger `json:"-"` // Optional compute endpoint override.stepWait ComputeEndpoint string `json:",omitempty"` ComputeClient compute.Client `json:"-"` StorageClient *storage.Client `json:"-"` CloudLoggingClient *logging.Client `json:"-"` //Forces cleanup on error of all resources, including those marked with NoCleanup ForceCleanupOnError bool // contains filtered or unexported fields }
Workflow is a single Daisy workflow workflow.
func NewFromFile ¶
NewFromFile reads and unmarshals a workflow file. Recursively reads sub and included steps as well, when the filenames for those workflows do not contain a variable. If they contain a variable, they will be read during their populate step.
func (*Workflow) AddDependency ¶
AddDependency creates a dependency of dependent on each dependency. Returns an error if dependent or dependency are not steps in this workflow.
func (*Workflow) AddSerialConsoleOutputValue ¶
AddSerialConsoleOutputValue adds an serial-output key-value pair to the Workflow.
func (*Workflow) CancelWithReason ¶
CancelWithReason cancels workflow with a specific reason. The specific reason replaces "is canceled" in the default error message. Multiple invocations will not cause an error, but only the first reason will be retained.
func (*Workflow) CancelWorkflow ¶
func (w *Workflow) CancelWorkflow()
CancelWorkflow cancels the workflow. Safe to call multiple times. Prefer this to closing the w.Cancel channel, which will panic if it has already been closed.
func (*Workflow) DisableCloudLogging ¶
func (w *Workflow) DisableCloudLogging()
DisableCloudLogging disables logging to Cloud Logging for this workflow.
func (*Workflow) DisableGCSLogging ¶
func (w *Workflow) DisableGCSLogging()
DisableGCSLogging disables logging to GCS for this workflow.
func (*Workflow) DisableStdoutLogging ¶
func (w *Workflow) DisableStdoutLogging()
DisableStdoutLogging disables logging to stdout for this workflow.
func (*Workflow) GetSerialConsoleOutputValue ¶
GetSerialConsoleOutputValue gets an serial-output value by key.
func (*Workflow) GetStepTimeRecords ¶
func (w *Workflow) GetStepTimeRecords() []TimeRecord
GetStepTimeRecords returns time records of each steps
func (*Workflow) IterateWorkflowSteps
deprecated
func (*Workflow) LogStepInfo ¶
LogStepInfo logs information for the workflow step.
func (*Workflow) LogWorkflowInfo ¶
LogWorkflowInfo logs information for the workflow.
func (*Workflow) NewIncludedWorkflowFromFile ¶
NewIncludedWorkflowFromFile reads and unmarshals a workflow with the same resources as the parent.
func (*Workflow) NewStep ¶
NewStep instantiates a new, typeless step for this workflow. The step type must be specified before running this workflow.
func (*Workflow) NewSubWorkflow ¶
NewSubWorkflow instantiates a new workflow as a child to this workflow.
func (*Workflow) NewSubWorkflowFromFile ¶
NewSubWorkflowFromFile reads and unmarshals a workflow as a child to this workflow.
func (*Workflow) PopulateClients ¶
PopulateClients populates the compute and storage clients for the workflow.
func (*Workflow) SetLogProcessHook ¶
SetLogProcessHook sets a hook function to process log string
type WorkflowModifier
deprecated
type WorkflowModifier func(*Workflow)
WorkflowModifier is a function type for functions that can modify a Workflow object.
Deprecated: This will be removed in a future release.
Source Files ¶
- common.go
- disk.go
- disktype.go
- error.go
- firewall_rule.go
- forwarding_rule.go
- image.go
- instance.go
- license.go
- logger.go
- machineimage.go
- machinetype.go
- network.go
- project.go
- region.go
- resource.go
- resource_registry.go
- snapshot.go
- sources.go
- step.go
- step_attach_disks.go
- step_copy_gcs_objects.go
- step_create_disks.go
- step_create_firewall_rule.go
- step_create_forwarding_rule.go
- step_create_images.go
- step_create_instances.go
- step_create_machine_images.go
- step_create_networks.go
- step_create_snapshots.go
- step_create_subnetworks.go
- step_create_target_instance.go
- step_delete_resources.go
- step_deprecate_images.go
- step_detach_disks.go
- step_includeworkflow.go
- step_resize_disks.go
- step_resume.go
- step_start_instances.go
- step_stop_instances.go
- step_sub_workflow.go
- step_suspend.go
- step_update_instances_metadata.go
- step_wait_for_instances_signal.go
- step_wait_for_quota.go
- storage.go
- subnetwork.go
- target_instance.go
- validate.go
- workflow.go
- zone.go
Directories ¶
Path | Synopsis |
---|---|
Daisy is a GCE workflow tool.
|
Daisy is a GCE workflow tool. |
Package compute provides access to the Google Compute API.
|
Package compute provides access to the Google Compute API. |
daisy_test_runner is a tool for testing using Daisy workflows.
|
daisy_test_runner is a tool for testing using Daisy workflows. |