Documentation ¶
Overview ¶
Package gce contains high-level functionality for manipulating GCE resources.
Package gce contains high-level functionality for manipulating GCE resources.
Index ¶
- Variables
- func CreateImage(svc *compute.Service, sourceURL, imageName, imageProject string) error
- func DeleteOldVMWithLabel(gceService *compute.Service, project, zone, labelKey, labelValue string, ...) error
- func DeprecateInFamily(ctx context.Context, svc *compute.Service, newImage *config.Image, ttl int) error
- func ImageExists(svc *compute.Service, project, name string) (bool, error)
- func ResolveMilestone(ctx context.Context, svc *compute.Service, milestone int) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTimeout indicates that an operation timed out. ErrTimeout = errors.New("operation timed out") // ErrImageNotFound indicates that a GCE image could not be found ErrImageNotFound = errors.New("image not found") )
Functions ¶
func CreateImage ¶
CreateImage creates an image with imageName with the source-url from gcs storage
func DeleteOldVMWithLabel ¶
func DeleteOldVMWithLabel(gceService *compute.Service, project, zone, labelKey, labelValue string, ttl time.Duration) error
DeleteOldVmWithLabel deletes all old VMs in the target project in the target zone with the given label. If the value of the label is empty, all VMs with the provided key of the label will be deleted. ttl must be at least 1 hour.
func DeprecateInFamily ¶
func DeprecateInFamily(ctx context.Context, svc *compute.Service, newImage *config.Image, ttl int) error
DeprecateInFamily deprecates all of the old images in an image family. Allows for assigning TTLs (in seconds) to deprecated images.
func ImageExists ¶
ImageExists checks to see if the given image exists in the given project.
Types ¶
This section is empty.