gce

package
v8.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

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 STATUS_READY = "READY"

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() (storageops.Ops, error)

NewClient creates a new GCE operations client

Types

This section is empty.

Jump to

Keyboard shortcuts

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