Files
cloudpods/pkg/mcclient
wanyaoqi 026e469bc6 fix(region, host): misc fix host health checker (#14583)
- 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>
2022-07-07 10:35:39 +08:00
..
2019-10-28 06:22:17 +00:00
2019-10-28 06:22:17 +00:00
2020-07-21 16:13:18 +08:00
2019-03-29 14:47:48 +08:00
2020-07-21 16:13:18 +08:00
2018-08-01 14:13:23 +08:00
2021-04-01 17:26:24 +08:00
2020-07-21 16:13:18 +08:00
2020-07-21 16:13:18 +08:00
2020-09-29 14:24:23 +08:00
2020-07-21 16:13:18 +08:00
2020-10-24 22:46:46 +08:00
2020-10-24 22:46:46 +08:00

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)
}