qcclient

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TunnelTypeVlan = "vlan"
)

Variables

This section is empty.

Functions

func IPRangeCount

func IPRangeCount(from, to string) int

func SetupQingCloudClient

func SetupQingCloudClient(opts Options)

NewQingCloudClient create a qingcloud client to manipulate cloud resources

Types

type Options

type Options struct {
	Tag string
}

type QingCloudAPI

type QingCloudAPI interface {
	//node info
	GetInstanceID() string

	//bootstrap
	GetCreatedNicsByName(name string) ([]*rpc.HostNic, error)

	//vxnet info
	GetVxNets([]string) (map[string]*rpc.VxNet, error)

	//job info
	DescribeNicJobs(ids []string) ([]string, map[string]bool, error)

	//nic operations
	CreateNicsAndAttach(vxnet *rpc.VxNet, num int, ips []string, disableIP int) ([]*rpc.HostNic, string, error)
	GetNics(nics []string) (map[string]*rpc.HostNic, error)
	DeleteNics(nicIDs []string) error
	DeattachNics(nicIDs []string, sync bool) (string, error)
	AttachNics(nicIDs []string) (string, error)
	GetAttachedNics() ([]*rpc.HostNic, error)
	GetCreatedNicsByVxNet(vxnet string) ([]*rpc.HostNic, error)

	CreateVIPs(vxnet *rpc.VxNet) (string, error)
	DescribeVIPs(vxnet *rpc.VxNet) ([]*rpc.VIP, error)
	DeleteVIPs(vips []string) (string, error)

	CreateSecurityGroupRuleForVxNet(sg string, vxnet *rpc.VxNet) (string, error)
	GetSecurityGroupRuleForVxNet(sg string, vxnet *rpc.VxNet) (*rpc.SecurityGroupRule, error)
	DeleteSecurityGroupRuleForVxNet(sgr string) error

	DescribeClusterSecurityGroup(clusterID string) (string, error)
	DescribeClusterNodes(clusterID string) ([]*rpc.Node, error)
}

QingCloudAPI is a wrapper interface of qingcloud api

var (
	QClient QingCloudAPI
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL