ecser

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEcsListNotSupported = errors.New("cloud not supported ecs list")
	ErrEcserPanic          = errors.New("ecs init panic")
)
View Source
var (
	// ManagementResourceTypes lists the types we use the management client for
	ManagementResourceTypes = []string{"cluster", "node", "project"}
	// ProjectResourceTypes lists the types we use the cluster client for
	ProjectResourceTypes = []string{"secret", "namespacedSecret", "workload"}
	// ClusterResourceTypes lists the types we use the project client for
	ClusterResourceTypes = []string{"persistentVolume", "storageClass", "namespace"}
)

Functions

func GetClient

func GetClient(ctx *cli.Context) (*cliclient.MasterClient, error)

func GetHarvesterClient

func GetHarvesterClient(host string, token string) (*harvclient.Clientset, error)

GetHarvesterClient creates a Client for Harvester from Config input

func GetKubernetesClient

func GetKubernetesClient(host string, token string) (*k8s.Clientset, error)

GetKubernetesClient creates a Client for Kubernetes from Config input

func GetResourceType

func GetResourceType(c *cliclient.MasterClient, resource string) (string, error)

GetResourceType maps an incoming resource type to a valid one from the schema

func Lookup

func Lookup(c *cliclient.MasterClient, name string, types ...string) (*ntypes.Resource, error)

func MustPVCTemplatesToString

func MustPVCTemplatesToString(pvcs []k8sv1.PersistentVolumeClaim) string

func NewTrue

func NewTrue() *bool

NewTrue returns a pointer to true

func PVCTemplatesToString

func PVCTemplatesToString(pvcs []k8sv1.PersistentVolumeClaim) (string, error)

func PointerToUint

func PointerToUint(i uint) *uint

func RandomID

func RandomID() string

RandomID returns a random string used as an ID internally in Harvester.

func RandomLetters

func RandomLetters(n int) string

RandomLetters returns a string with random letters of length n

func RandomName

func RandomName() string

func SimpleFormat

func SimpleFormat(values [][]string) (string, string)

func SplitOnColon

func SplitOnColon(s string) []string

Types

type AliEcs

type AliEcs struct {
	// contains filtered or unexported fields
}

func (*AliEcs) ActionEcs

func (ecs *AliEcs) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error)

func (*AliEcs) CreateEcs

func (ecs *AliEcs) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error)

func (*AliEcs) DeleteEcs

func (ecs *AliEcs) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error)

func (*AliEcs) ListDetail

func (ecs *AliEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error)

func (*AliEcs) UpdateEcs

func (ecs *AliEcs) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error)

type Config

type Config struct {
	Host  string
	Token string
	Port  int
}

type Ecser

type Ecser interface {
	CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (resp *pbecs.CreateEcsResp, err error)    //创建ecs
	DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (resp *pbecs.DeleteEcsResp, err error)    //批量删除ecs
	UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (resp *pbecs.UpdateEcsResp, err error)    //修改ecs
	ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (resp *pbecs.ListDetailResp, err error) //查询ecs详情
	ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error)          //操作ecs
}

func NewEcsClient

func NewEcsClient(provider pbtenant.CloudProvider, region tenanter.Region, tenant tenanter.Tenanter) (ecser Ecser, err error)

type HarVMer

type HarVMer struct {
	// contains filtered or unexported fields
}

func (*HarVMer) ActionEcs

func (h *HarVMer) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error)

func (*HarVMer) CreateEcs

func (h *HarVMer) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (resp *pbecs.CreateEcsResp, err error)

func (*HarVMer) DeleteEcs

func (h *HarVMer) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (resp *pbecs.DeleteEcsResp, err error)

func (*HarVMer) ListDetail

func (h *HarVMer) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (resp *pbecs.ListDetailResp, err error)

func (*HarVMer) UpdateEcs

func (h *HarVMer) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (resp *pbecs.UpdateEcsResp, err error)

type HuaweiEcs

type HuaweiEcs struct {
	// contains filtered or unexported fields
}

func (*HuaweiEcs) ActionEcs

func (ecs *HuaweiEcs) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error)

func (*HuaweiEcs) CreateEcs

func (ecs *HuaweiEcs) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error)

func (*HuaweiEcs) DeleteEcs

func (ecs *HuaweiEcs) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error)

func (*HuaweiEcs) ListDetail

func (ecs *HuaweiEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error)

func (*HuaweiEcs) UpdateEcs

func (ecs *HuaweiEcs) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error)

type MemberData

type MemberData struct {
	Name       string
	MemberType string
	AccessType string
}

type RoleTemplate

type RoleTemplate struct {
	ID          string
	Name        string
	Description string
}

type RoleTemplateBinding

type RoleTemplateBinding struct {
	ID      string
	User    string
	Role    string
	Created string
}

type TencentCvm

type TencentCvm struct {
	// contains filtered or unexported fields
}

func (*TencentCvm) ActionEcs

func (ecs *TencentCvm) ActionEcs(ctx context.Context, req *pbecs.ActionReq) (resp *pbecs.ActionResp, err error)

func (*TencentCvm) CreateEcs

func (ecs *TencentCvm) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error)

func (*TencentCvm) DeleteEcs

func (ecs *TencentCvm) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error)

func (*TencentCvm) ListDetail

func (ecs *TencentCvm) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error)

func (*TencentCvm) UpdateEcs

func (ecs *TencentCvm) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error)

Jump to

Keyboard shortcuts

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