config

package
v0.0.0-...-a17d9bd Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKey string

APIKey is the APIkey for the Enterprise Dashboard

View Source
var BillingBegin time.Time

BillingBegin is the Time/Date the billing cicle beginns

View Source
var Dryrun bool = false

Dryrun determans if accual changes to the hardware would be done if nessesary.

View Source
var OTCUsingOTP bool

OTCUsingOTP prompts user for OTP on login

View Source
var TargetBudget float64

TargetBudget is the budget that ot3c has to manage the costs.

View Source
var TerminateASAPGracePeriod time.Duration

TerminateASAPGracePeriod is a grace period that a VR gets if it needs to be terminated ASAP.

View Source
var TfWorkspace string

TfWorkspace path to terraform workspace

Functions

func CalcTimeLeftInBillPeriod

func CalcTimeLeftInBillPeriod() time.Duration

CalcTimeLeftInBillPeriod calculates the time left in the current Billing period

func CurrentBillingEnd

func CurrentBillingEnd() time.Time

CurrentBillingEnd returns the End Date of the current Billing Mounth

func CurrentBillingStart

func CurrentBillingStart() time.Time

CurrentBillingStart returns the start Date of current Billing Mounth

func GetTerminateASAPDate

func GetTerminateASAPDate() time.Time

GetTerminateASAPDate calculates the time for the Termination Date

Types

type File

type File struct {
	EnterpriseDashboardAPISecret string `yaml:"dashboard-secret"`
	OTCCreds                     huaweiotc.AKSKAuthOptions
	BillingBegin                 string        `yaml:"billing-begin"`
	TargetBudget                 float64       `yaml:"target-budget"`
	TerminationGrace             time.Duration `yaml:"termination-grace"`
}

File is a struct that represents the config file for OT3C. When loaded it can be transphered into the different static Vars in this package to be accessed by other packages.

var SampleConfig File = File{
	EnterpriseDashboardAPISecret: "<very-long-api-secret>",
	OTCCreds: huaweiotc.AKSKAuthOptions{
		IdentityEndpoint: "https://iam.eu-de.otc.t-systems.com/v3",
		AccessKey:        "<very-pretty-access-key>",
		SecretKey:        "<very-pretty-secret-key>",
		ProjectId:        "<very-long-project-id>",
	},
	BillingBegin:     "2016-01-05",
	TargetBudget:     100.0,
	TerminationGrace: time.Hour * 24,
}

SampleConfig is just a sample config

func (*File) ApplyConfig

func (file *File) ApplyConfig() error

ApplyConfig applies the config from the file to OT3C

Jump to

Keyboard shortcuts

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