gce

package
v0.0.0-...-1aa1ecb Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

README

To test GCE

You will first need to create a GCE instance and then provide details of this instance as below.

export GOOGLE_APPLICATION_CREDENTIALS=<path-to-service-account-json-file>
export GCE_INSTANCE_NAME=<gce-instance-name>
export GCE_INSTANCE_ZONE=<gce-instance-zone>
export GCE_INSTANCE_PROJECT=<gce-project-name>

go test

To get path-to-service-account-json-file

  • Go to GCE console -> Compute Engine -> VM Instances -> <your-instance>
  • Find the service account used for this instance in the "Service Account" section
  • Go to GCE console -> IAM & admin -> Service Accounts -> <instance-service-account>
  • Select "Create key" and download the .json file
  • Set GOOGLE_APPLICATION_CREDENTIALS to the path of the .json file

Documentation

Index

Constants

View Source
const StatusReady = "ready"

StatusReady ready status

Variables

This section is empty.

Functions

func IsDevMode

func IsDevMode() bool

IsDevMode checks if the pkg is invoked in developer mode where GCE credentials are set as env variables

func NewClient

func NewClient() (cloudops.Ops, error)

NewClient creates a new GCE operations client

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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