Documentation ¶
Index ¶
- Constants
- Variables
- func CreateInstanceTemplate(templateName, imageName, instanceType, project string, ...) (err error)
- func DeleteImage(imageName, project, zone string, service *compute.Service) error
- func DeleteInstanceTemplate(templateName, project string, service *compute.Service) (err error)
- func DoAllFirewallRule(project string, service *compute.Service) (err error)
- func DoDeleteDisk(instanceName, project, zone string, service *compute.Service) (err error)
- func DoGetInstanceIP(instanceName, imageName, instanceType, project, zone string, ...) (err error)
- func DoInitialSetup(instanceName, instanceType, project, zone string, service *compute.Service) (err error)
- func DoLaunchInstance(instanceName, imageName, instanceType, project, zone string, ...) (err error)
- func DoRebootRegions(singleZone bool, instanceGroupName, project string, regions []string, ...) (errs []error)
- func DoRemoveFirewallRule(project string, service *compute.Service) (err error)
- func DoShutdownInstance(instanceName, project, zone string, service *compute.Service) (err error)
- func GetIPFromInstance(inst *compute.Instance) string
- func GetInstance(name, imageName, instanceType, project, zone string, service *compute.Service) (*compute.Instance, error)
- func GetInstanceGroupsIPs(singleZone, onlyExternalIps bool, instanceGroupName, project string, ...) (ips []string, err error)
- func LaunchCreateNode(name, imageName, instanceType, project, zone string, service *compute.Service) (*compute.Instance, error)
- func LaunchInstanceGroups(singleZone bool, numNodes int, ...) (err error)
- func MakeImageFromInstance(imageName, instanceName, project, zone string, service *compute.Service) error
- func ShutdownInstance(instanceName, project, zone string, service *compute.Service) error
- func ShutdownInstanceGroups(singleZone bool, instanceGroupName, project string, regions []string, ...) (ret []error)
- func UndoInitialSetup(project, zone string, service *compute.Service) (err error)
- func UpdateInstanceTemplateInstanceType(newInstanceType, templateName, project string, service *compute.Service) error
- func WaitRegionInstanceGroupDeleted(singleZone bool, instanceGroupName, region, project string, ...) error
- func WaitRegionInstanceGroupStable(singleZone bool, instanceGroupName, region, project string, ...) error
Constants ¶
View Source
const ( AllowPreemption = false DefaultInstanceType = "n1-standard-2" TemplateName = "base-cons-template" DefaultRegion = "us-central1" // "us-east1" BaseInstanceName = "cons-instance" InstanceGroupName = "cons-instance-group" DefaultZone = "us-central1-a" InitInstance = "initial-instance" Port = config.RPCNodePort FirewallName = "cons-firewall" )
View Source
const ( GlobalImageName = "projects/debian-cloud/global/images/family/debian-10" // GlobalImageName = "projects/centos-cloud/global/images/family/centos-8" // initScriptName = "./scripts/imagesetuplocal.sh" ConsImageName = "cons-image" )
Variables ¶
View Source
var JsonPath = os.Getenv("OAUTHPATH")
View Source
var ProjectID = os.Getenv("PROJECTID")
Functions ¶
func CreateInstanceTemplate ¶
func DeleteImage ¶
func DeleteInstanceTemplate ¶
func DoAllFirewallRule ¶
DoAddFirewallRule adds the cons firewall rule.
func DoDeleteDisk ¶
DoDeleteDisk deletes the given disk.
func DoGetInstanceIP ¶
func DoGetInstanceIP(instanceName, imageName, instanceType, project, zone string, service *compute.Service) (err error)
DoGetInstanceIP gets the IP on an instance launched with DoLaunchInstance.
func DoInitialSetup ¶
func DoInitialSetup(instanceName, instanceType, project, zone string, service *compute.Service) (err error)
DoInitialSetup creates an image and image template from the values.
func DoLaunchInstance ¶
func DoLaunchInstance(instanceName, imageName, instanceType, project, zone string, service *compute.Service) (err error)
DoLaunchInstance launches an instance.
func DoRebootRegions ¶
func DoRebootRegions(singleZone bool, instanceGroupName, project string, regions []string, service *compute.Service) (errs []error)
DoRebootRegions reboots the nodes from the instance groups.
func DoRemoveFirewallRule ¶
DoRemoveFirewallRule removes the cons firewall rule.
func DoShutdownInstance ¶
DoLaunchInstance launches an instance.
func GetIPFromInstance ¶
func GetIPFromInstance(inst *compute.Instance) string
func GetInstance ¶
func GetInstanceGroupsIPs ¶
func GetInstanceGroupsIPs(singleZone, onlyExternalIps bool, instanceGroupName, project string, regions []string, service *compute.Service) (ips []string, err error)
GetInstanceGroupIPs returns the list of ips for the regions, where each line rotates through the regions.
func LaunchCreateNode ¶
func LaunchInstanceGroups ¶
func MakeImageFromInstance ¶
func ShutdownInstance ¶
func ShutdownInstanceGroups ¶
func UndoInitialSetup ¶
UndoInitialSetup removes the items created in the initial setup
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.