vmextension

package
v0.0.0-...-d1d2547 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

View Source
const HandlerEnvFileName = "HandlerEnvironment.json"

HandlerEnvFileName is the file name of the Handler Environment as placed by the Azure Linux Guest Agent.

Variables

This section is empty.

Functions

func FindSeqNum

func FindSeqNum(configFolder string) (int, error)

FindSeqnum finds the file with the highest number under configFolder named like 0.settings, 1.settings so on.

func ReadSettings

func ReadSettings(configFolder string) (public, protected map[string]interface{}, _ error)

ReadSettings locates the .settings file and returns public settings JSON, and protected settings JSON (by decrypting it with the keys in configFolder).

func UnmarshalHandlerSettings

func UnmarshalHandlerSettings(publicSettings, protectedSettings map[string]interface{}, publicV, protectedV interface{}) error

UnmarshalHandlerSettings unmarshals given publicSettings/protectedSettings types assumed underlying values are JSON into references publicV/protectedV respectively (of struct types that contain structured fields for settings).

Types

type HandlerEnvironment

type HandlerEnvironment struct {
	Version            float64 `json:"version"`
	Name               string  `json:"name"`
	HandlerEnvironment struct {
		HeartbeatFile string `json:"heartbeatFile"`
		StatusFolder  string `json:"statusFolder"`
		ConfigFolder  string `json:"configFolder"`
		LogFolder     string `json:"logFolder"`
	}
}

HandlerEnvironment describes the handler environment configuration presented to the extension handler by the Azure Linux Guest Agent.

func GetHandlerEnv

func GetHandlerEnv() (he HandlerEnvironment, _ error)

GetHandlerEnv locates the HandlerEnvironment.json file by assuming it lives next to or one level above the extension handler (read: this) executable, reads, parses and returns it.

func ParseHandlerEnv

func ParseHandlerEnv(b []byte) (he HandlerEnvironment, _ error)

ParseHandlerEnv parses the /var/lib/waagent/[extension]/HandlerEnvironment.json format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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