azureprovider.go 644 B

123456789101112131415161718192021222324252627
  1. package cloud
  2. // Azure simply falls back to the CustomProvider for most calls. TODO: Implement this provider
  3. type Azure struct {
  4. *CustomProvider
  5. }
  6. // DownloadPricingData uses provided azure "best guesses" for pricing
  7. func (a *Azure) DownloadPricingData() error {
  8. if a.CustomProvider.Pricing == nil {
  9. m := make(map[string]*NodePrice)
  10. a.CustomProvider.Pricing = m
  11. }
  12. p, err := GetDefaultPricingData("azure.json")
  13. if err != nil {
  14. return err
  15. }
  16. a.CustomProvider.Pricing["default"] = &NodePrice{
  17. CPU: p.CPU,
  18. RAM: p.RAM,
  19. }
  20. a.CustomProvider.Pricing["default,spot"] = &NodePrice{
  21. CPU: p.SpotCPU,
  22. RAM: p.SpotRAM,
  23. }
  24. return nil
  25. }