Documentation ¶
Index ¶
- Variables
- func CreateInstance(computeService *compute.Service) (*compute.Operation, error)
- func DeployInstance(w http.ResponseWriter, r *http.Request)
- func GetInstance(computeService *compute.Service) (*compute.Instance, error)
- func InitComputeService() (*compute.Service, error)
- func StartInstance(computeService *compute.Service) (*compute.Operation, error)
- func StopInstance(computeService *compute.Service) (*compute.Operation, error)
Constants ¶
This section is empty.
Variables ¶
var InstanceName = ""
var ProjectID = ""
var Region = ""
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.