Documentation ¶
Overview ¶
Proof of Concepts for the Cloud-Barista Multi-Cloud Project.
- Cloud-Barista: https://github.com/cloud-barista
ETCD Hander (ETCD Version 3 API, Thanks ETCD.)
by powerkim@powerkim.co.kr, 2019.03.
Index ¶
- func AddServer(ctx context.Context, cli *clientv3.Client, provider *string, ...)
- func AddServerToService(ctx context.Context, cli *clientv3.Client, svcId *string, svcName *string, ...)
- func AddService(ctx context.Context, cli *clientv3.Client, svcId *string, svcName *string, ...)
- func Close(cli *clientv3.Client)
- func Connect(moniServerPort *string) (*clientv3.Client, error)
- func DelAllServers(ctx context.Context, cli *clientv3.Client)
- func DelAllSvcs(ctx context.Context, cli *clientv3.Client)
- func DelProviderAllServers(ctx context.Context, cli *clientv3.Client, provider *string)
- func DelProviderServer(ctx context.Context, cli *clientv3.Client, provider *string, delserver *string)
- func DelServer(ctx context.Context, cli *clientv3.Client, delserver *string)
- func GetServersInService(ctx context.Context, cli *clientv3.Client, serviceId *string) []*string
- func InstanceIDListAWS(ctx context.Context, cli *clientv3.Client) []*string
- func InstanceIDListAZURE(ctx context.Context, cli *clientv3.Client) []*string
- func InstanceIDListGCP(ctx context.Context, cli *clientv3.Client) []*string
- func ServerList(ctx context.Context, cli *clientv3.Client) []*string
- func ServerListAWS(ctx context.Context, cli *clientv3.Client) []*string
- func ServerListGCP(ctx context.Context, cli *clientv3.Client) []*string
- func ServiceList(ctx context.Context, cli *clientv3.Client) []*string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddServerToService ¶
func AddService ¶
func DelAllSvcs ¶
func AddServerToSvc(ctx context.Context, cli *clientv3.Client, provider *string, instanceId *string, addserver *string, fetchtype *string) { // /server/aws/i-1234567890abcdef0/129.254.175:2019 PULL cli.Put(ctx, "/server/"+ *provider + "/" + *instanceId + "/" + *addserver, *fetchtype) fmt.Println("added a " + *addserver + " into the Server List...\n") }
func DelSvc(ctx context.Context, cli *clientv3.Client, delserver *string) { // get with prefix, all list of /server's key resp, err := cli.Get(ctx, "/server", clientv3.WithPrefix(), clientv3.WithSort(clientv3.SortByKey, clientv3.SortDescend)) if err != nil { log.Fatal(err) } for _, ev := range resp.Kvs { //fmt.Printf("%s : %s\n", strings.Trim(string(ev.Key), "/server/"), ev.Value) // /server/aws/i-1234567890abcdef0/129.254.175:2019 if strings.Contains(string(ev.Key), *delserver) { cli.Delete(ctx, string(ev.Key)) fmt.Println("deleted a " + *delserver + " from the Server List...\n") } } }
func DelProviderAllServers ¶
func DelProviderServer ¶
func GetServersInService ¶
func InstanceIDListAWS ¶
func InstanceIDListAZURE ¶
func InstanceIDListGCP ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.