cloudfunctions

package
v0.0.0-...-e29ad75 Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstanceName = ""
View Source
var ProjectID = ""
View Source
var Region = ""
View Source
var Zone = ""

Functions

func CreateInstance

func CreateInstance(computeService *compute.Service) (*compute.Operation, error)

CreateInstance creates a given instance with metadata that logs its information.

func DeployInstance

func DeployInstance(w http.ResponseWriter, r *http.Request)

DeployInstance will use the Golang GCP API to deploy a GCE instance with given startup-script that creates a text file and logs the time. If the instance is there. It will shut it down, and the shutdown script will be invoked.

func GetInstance

func GetInstance(computeService *compute.Service) (*compute.Instance, error)

GetInstance passes in the instance name supplied and retrieves it. An error indicates an instance that was never created. A non-nil error indicates an instance is present whether in the RUNNING or TERMINATED state.

func InitComputeService

func InitComputeService() (*compute.Service, error)

InitComputeService obtains the compute service that allows us to use the compute API

func StartInstance

func StartInstance(computeService *compute.Service) (*compute.Operation, error)

StartInstance begins an instance with the given name

func StopInstance

func StopInstance(computeService *compute.Service) (*compute.Operation, error)

StopInstance will delete an instance with the name specified in the InstanceName variable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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