Documentation ¶
Overview ¶
Package compute contains wrappers around the GCE compute API.
Package compute contains wrappers around the GCE compute API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildInstanceMetadataItem ¶
func BuildInstanceMetadataItem(key, value string) *api.MetadataItems
BuildInstanceMetadataItem create an metadata item
Types ¶
type Image ¶
type Image struct { *api.Image Client computeApi.Client Project string }
Image is a compute image.
func CreateImageObject ¶
CreateImageObject creates an image object to be operated by API client
type Instance ¶
type Instance struct { *api.Instance Client daisyCompute.Client Project, Zone string IsWindows bool }
Instance is a compute instance.
func CreateInstanceObject ¶
func CreateInstanceObject(ctx context.Context, project string, zone string, name string, isWindows bool) (*Instance, error)
CreateInstanceObject creates an instance object to be operated by GA API client
func SetMetadata ¶
func SetMetadata(ctx context.Context, project, zone, name, key, value string, isWindows bool) (*Instance, error)
SetMetadata sets metadata for the given instance.
func (*Instance) RestartWithScriptCode ¶
RestartWithScriptCode restarts the instance with given startup script.
func (*Instance) StartWithScriptCode ¶
StartWithScriptCode starts the instance with given startup script and metadata
type InstanceBeta ¶
type InstanceBeta struct { *apiBeta.Instance Client daisyCompute.Client Project, Zone string IsWindows bool }
InstanceBeta is a compute instance using Beta API.
func CreateInstanceBeta ¶
func CreateInstanceBeta(ctx context.Context, project string, zone string, name string, isWindows bool, machineImageName string) (*InstanceBeta, error)
CreateInstanceBeta creates an image object to be operated by Beta API client
func (*InstanceBeta) Cleanup ¶
func (i *InstanceBeta) Cleanup() error
Cleanup deletes the InstanceBeta.
func (*InstanceBeta) StartWithScriptCode ¶
func (i *InstanceBeta) StartWithScriptCode(script string, instanceMetadata map[string]string) error
StartWithScriptCode starts the instance with given startup script and metadata.
func (*InstanceBeta) WaitForSerialOutput ¶
func (i *InstanceBeta) WaitForSerialOutput(match string, failureMatches []string, port int64, interval, timeout time.Duration) error
WaitForSerialOutput waits to a string match on a serial port.