vm

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

gcputil/vm

This utility exposes a simple function to shut down host VM. It looks up the current project ID as well as host VM name and zone in which that VM executes and calls the compute API to shut it down.

This is helpful when container finished running in VM and you want to shutdown the host VM to avoid paying for idle time.

Import

import "github.com/mchmarny/gcputil/vm"

Usage

ctx := context.Background()
vm.ShutdownHostVM(ctx, "my-long-running-job")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShutdownHostVM

func ShutdownHostVM(ctx context.Context, agent string)

ShutdownHostVM looks up the current project ID as well as host VM name and zone in which it executes and calls the compute API to shut it down. Helpful when container finished running in VM and wants to shutdown the host VM to avoid paying for idle time. Since there isn't probably anyone waiting for response to this, any critical errors in this method will be fatal

Types

This section is empty.

Jump to

Keyboard shortcuts

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