utils

package
v1.2.20210816 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package utils defines utilities for the VM manager.

Index

Constants

View Source
const EmailScope = "https://www.googleapis.com/auth/userinfo.email"

Variables

This section is empty.

Functions

func CreateVM

func CreateVM(svc *compute.Service, project, zone, instanceName, description, machineType, network, serviceAccount string, bootDiskSizeGB int64, metadata map[string]*string, pollingInterval time.Duration) error

func GetGoogleHTTPClient

func GetGoogleHTTPClient(ctx context.Context) (*http.Client, error)

GetGoogleHTTPClient gets an HTTP client that is authenticated with Google OAuth credentials.

This first attempts to use the credentials of the signed-in `gcloud` user, and then falls back to using the application default credentials if that fails.

func GetMetadataEntry

func GetMetadataEntry(vm *compute.Instance, key string) (string, error)

func WaitForZoneOperation

func WaitForZoneOperation(svc *compute.Service, project, zone, operationName string, sleepDuration time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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