Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var APIKey string
APIKey is the APIkey for the Enterprise Dashboard
var BillingBegin time.Time
BillingBegin is the Time/Date the billing cicle beginns
var Dryrun bool = false
Dryrun determans if accual changes to the hardware would be done if nessesary.
var OTCCreds huaweiotc.AKSKAuthOptions
var OTCUsingOTP bool
OTCUsingOTP prompts user for OTP on login
var TargetBudget float64
TargetBudget is the budget that ot3c has to manage the costs.
var TerminateASAPGracePeriod time.Duration
TerminateASAPGracePeriod is a grace period that a VR gets if it needs to be terminated ASAP.
var TfWorkspace string
TfWorkspace path to terraform workspace
Functions ¶
func CalcTimeLeftInBillPeriod ¶
CalcTimeLeftInBillPeriod calculates the time left in the current Billing period
func CurrentBillingEnd ¶
CurrentBillingEnd returns the End Date of the current Billing Mounth
func CurrentBillingStart ¶
CurrentBillingStart returns the start Date of current Billing Mounth
func GetTerminateASAPDate ¶
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 ¶
ApplyConfig applies the config from the file to OT3C