registration

package
v0.0.0-...-7638cb1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

package registration provides managed instance information

package registration provides managed instance information

Index

Examples

Constants

View Source
const (
	RegVaultKey = "RegistrationKey"
)

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint() (string, error)

Fingerprint of the managed instance.

func GenerateKeyPair

func GenerateKeyPair() (publicKey, privateKey, keyType string, err error)

GenerateKeyPair generate a new keypair

func HasManagedInstancesCredentials

func HasManagedInstancesCredentials() (bool, error)

HasManagedInstancesCredentials returns true when the valid registration information is present

func InstanceID

func InstanceID() string

InstanceID of the managed instance.

Example
file = fileStub{}
vault = vaultStub{rKey: sampleRegistrationKey, data: sampleJson}
loadServerInfo() // load info with mocked vault
instanceID := InstanceID()
fmt.Println(instanceID)
Output:

mi-e6c6f145e6c6f145

func PrivateKey

func PrivateKey() string

PrivateKey of the managed instance.

Example
file = fileStub{}
vault = vaultStub{rKey: sampleRegistrationKey, data: sampleJson}
loadServerInfo() // load info with mocked vault
privateKey := PrivateKey()
fmt.Println(privateKey)
Output:

KEYe6c6f145e6c6f145

func Region

func Region() string

Region of the managed instance.

Example
file = fileStub{}
vault = vaultStub{rKey: sampleRegistrationKey, data: sampleJson}
loadServerInfo() // load info with mocked vault
region := Region()
fmt.Println(region)
Output:

us-west-1

func UpdatePrivateKey

func UpdatePrivateKey(privateKey, privateKeyType string) (err error)

UpdatePrivateKey saves the private key into the registration persistance store

func UpdateServerInfo

func UpdateServerInfo(instanceID, region, privateKey, privateKeyType string) (err error)

UpdateServerInfo saves the instance info into the registration persistance store

Types

This section is empty.

Jump to

Keyboard shortcuts

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