Full featured OVH SDK
This project heavily rely on auto-generated OVH API models source code repository.
go get -u github.com/miton18/ovh
To contact OVH API, we need 3 keys, applicationKey
, applicationSecret
, consumerKey
You can craft them on the official page: CreateToken
Make our first call, let's try to list all our cloud projects
package main
import (
"context"
"fmt"
"github.com/miton18/ovh"
)
func main() {
client, err := ovh.New(ovh.OVH_EU, "<APPLICATION_KEY>", "<APPLICATION_SECRET>", "<CONSUMER_KEY>")
if err != nil {
panic(err.Error())
}
cloudProjectList, err := client.Cloud().Project().List(context.Background())
if err != nil {
panic(err.Error())
}
fmt.Printf("Projects %#v", cloudProjectList)
}
You can request a new method by creating a new method issue
See CONTRIBUTING
Each SDK action is observed, so you can find a list of metrics in the metrics package. This is up to you to register them.
TODO: Tracing
package main
import (
"context"
"fmt"
"github.com/miton18/ovh"
)
func main() {
client := ovh.MustNewFromEnv()
loadbalancer, err := client.
Cloud().
Project().
Loadbalancer("<PROJECT_ID>").
Get(context.Background(), "<LOADBALANCER_ID>")
if err != nil {
panic(err.Error())
}
fmt.Printf("RES %#v", test)
}