ovh.go 601 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package provisioning
  2. import (
  3. "github.com/ovh/go-ovh/ovh"
  4. )
  5. type Ovh struct {
  6. ovhClient *ovh.Client
  7. }
  8. func NewOvhClient(endpoint, appKey, appSecret string) *Ovh {
  9. ovhClient, _ := ovh.NewClient(
  10. endpoint,
  11. appKey,
  12. appSecret,
  13. "",
  14. )
  15. // if err != nil {
  16. // panic(err)
  17. // }
  18. return &Ovh{
  19. ovhClient: ovhClient,
  20. }
  21. }
  22. func (o *Ovh) ConfigureZone(zoneName string) error {
  23. err := o.ovhClient.Post("/domain/zone", map[string]interface{}{
  24. "zone": zoneName,
  25. }, nil)
  26. if err != nil {
  27. return err
  28. }
  29. return nil
  30. }
  31. func (o *Ovh) GetVPSStatus(id string) (string, error) {
  32. return "", nil
  33. }