mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
026e469bc6
- hostagent remove option enable host health, default enabled, its rely on etcd endpoint register. - add option auto migrate on host shutdown. - fix hostman check network is available. - use hostname instead hostId as etcd key - init health checker before host instace init. - refector host_health checker. Signed-off-by: wanyaoqi <wanyaoqi@yunion.cn>
Yunion OneCloud API go library
Sample code
:::golang
package main
import (
"context"
"fmt"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
)
func main() {
client := mcclient.NewClient("https://<onecloud_controller_ip>:30500/v3",
60,
true,
true,
"",
"")
token, err := client.Authenticate("sysadmin", "<password>", "Default", "system", "Default")
if err != nil {
panic(err)
}
s := client.NewSession(context.Background(),
"region0",
"",
"PublicURL",
token,
"")
result, err := modules.Servers.List(s, nil)
if err != nil {
panic(err)
}
fmt.Printf("%#v\n", result)
}