Documentation
¶
Index ¶
- Constants
- func AddSecurityGroupRule(ctx context.Context, req AddSecurityGroupRuleRequest) (string, error)
- func BatchCreateInstanceType(ctx context.Context, inss []model.InstanceType) error
- func CheckAccountValid(ak, sk string) error
- func CleanClusterUnusedInstances(clusterInfo *types.ClusterInfo) (int, error)
- func ConvertToClusterInfo(m *model.Cluster, tags []model.ClusterTag) (*types.ClusterInfo, error)
- func CountUser(ctx context.Context, orgId int64) (int64, error)
- func CreateCloudAccount(ctx context.Context, accountName, provider, ak, sk string, orgId int64, ...) error
- func CreateCluster(cluster *model.Cluster, username string) error
- func CreateCluster4Test(clusterName string) error
- func CreateClusterTags(tags *[]model.ClusterTag) error
- func CreateExpandTask(ctx context.Context, clusterName string, count int, taskName string, uid int64) (int64, error)
- func CreateOrg(ctx context.Context, orgName, username, password, createBy string) error
- func CreateSecurityGroup(ctx context.Context, req CreateSecurityGroupRequest) (securityGroupId string, err error)
- func CreateShrinkTask(ctx context.Context, clusterName string, count int, ips string, ...) (int64, error)
- func CreateSwitch(ctx context.Context, req CreateSwitchRequest) (switchId string, err error)
- func CreateUser(ctx context.Context, orgId int64, username, password, createBy string) error
- func CreateVPC(ctx context.Context, req CreateVPCRequest) (vpcId string, err error)
- func DeleteCloudAccount(ctx context.Context, ids []int64, orgId int64) error
- func DeleteClusters(ctx context.Context, ids []int64, orgId int64) error
- func EditCloudAccount(ctx context.Context, id int64, accountName, provider, username string) error
- func EditCluster(cluster *model.Cluster, username string) error
- func EditOrg(ctx context.Context, orgId int64, orgName string) error
- func Expand(clusterInfo *types.ClusterInfo, tags []cloud.Tag, num int) (instanceIds []string, err error)
- func ExpandAndRepair(c *types.ClusterInfo, num int, taskId int64) ([]string, error)
- func ExpandCluster(c *types.ClusterInfo, num int, taskId int64) (instanceIds []cloud.Instance, err error)
- func GetAccounts(provider, accountName, accountKey string, pageNum, pageSize int) ([]model.Account, int64, error)
- func GetAccountsByOrgId(orgId int64) (*types.OrgKeys, error)
- func GetAksByOrgAkProvider(ctx context.Context, orgId int64, ak, provider string) ([]string, error)
- func GetAksByOrgId(orgId int64) ([]string, error)
- func GetCloudInstancesByClusterName(clusterInfo *types.ClusterInfo) (instances []cloud.Instance, err error)
- func GetClusterById(ctx context.Context, Id int64) (*model.Cluster, error)
- func GetClusterByName(ctx context.Context, name string) (*model.Cluster, error)
- func GetClusterCount(ctx context.Context, accountKeys []string) (count int64, err error)
- func GetClusterTagsByClusterName(ctx context.Context, name string) ([]model.ClusterTag, error)
- func GetClustersByNames(ctx context.Context, names []string) ([]model.Cluster, error)
- func GetDefaultAccount(provider string) (*types.OrgKeys, error)
- func GetEnabledClusterNamesByAccount(ctx context.Context, accountKey string) ([]string, error)
- func GetEnabledClusterNamesByAccounts(ctx context.Context, accountKeys []string) ([]string, error)
- func GetEnabledClusterNamesByCond(ctx context.Context, ak, clusterName string, aks []string, strict bool) ([]string, error)
- func GetImages(ctx context.Context, req GetImagesRequest) ([]cloud.Image, error)
- func GetInstance(ctx context.Context, instanceId string) (*model.Instance, error)
- func GetInstanceByTag(c *types.ClusterInfo, tags []cloud.Tag) (instances []cloud.Instance, err error)
- func GetInstanceCount(ctx context.Context, accountKeys []string, clusterName string) (int64, error)
- func GetInstanceCountByCluster(ctx context.Context, clusters []model.Cluster) map[string]int64
- func GetInstanceUsageStatistics(ctx context.Context, clusterName string, specifyDay time.Time, orgId int64, ...) ([]model.Instance, int64, error)
- func GetInstanceUsageTotal(ctx context.Context, clusterName string, specifyDay time.Time, orgId int64) (int64, error)
- func GetInstances(clusterInfo *types.ClusterInfo, instancesIds []string) (instances []cloud.Instance, err error)
- func GetInstancesByAccount(ctx context.Context, accountKey string, pageNum, pageSize int) (instances []model.Instance, total int64, err error)
- func GetInstancesByAccounts(ctx context.Context, accountKeys, status []string, pageNum, pageSize int, ...) (clusterNames []string, instances []model.Instance, total int64, err error)
- func GetInstancesByCond(ctx context.Context, cond InstancesSearchCond) (ret []model.Instance, total int64, err error)
- func GetInstancesByTaskId(ctx context.Context, taskId string, taskAction string) ([]model.Instance, error)
- func GetOrgInfoById(ctx context.Context, id int64) (*model.Org, error)
- func GetOrgKeysByAk(ctx context.Context, ak string) (*types.OrgKeys, error)
- func GetOrgList(ctx context.Context) (ret []model.Org, err error)
- func GetRegions(ctx context.Context, req GetRegionsRequest) ([]cloud.Region, error)
- func GetTask(ctx context.Context, taskId string) (*model.Task, error)
- func GetTaskCount(ctx context.Context, accountKeys []string) (int64, error)
- func GetTaskListByAk(ctx context.Context, accountKey string, pageNum, pageSize int) ([]model.Task, int64, error)
- func GetTaskListByAks(ctx context.Context, accountKeys []string, pageNum, pageSize int) ([]model.Task, int64, error)
- func GetTaskListByCond(ctx context.Context, accountKey []string, cond model.TaskSearchCond) ([]model.Task, int64, error)
- func GetUserById(ctx context.Context, uid int64) (*model.User, error)
- func GetUserList(ctx context.Context, orgId int64, pageNum, pageSize int) (ret []model.User, total int64, err error)
- func GetVPCFromCloud(ctx context.Context, req GetVPCFromCloudRequest) (vpc cloud.VPC, err error)
- func GetZones(ctx context.Context, req GetZonesRequest) ([]cloud.Zone, error)
- func Init(workerCount int)
- func ListClusters(ctx context.Context, accountKeys []string, clusterName, provider string, ...) ([]model.Cluster, int, error)
- func Login(ctx context.Context, username, password string) *model.User
- func ModifyAdminPassword(ctx context.Context, userId int64, userName, oldPassword, newPassword string) error
- func ModifyUsername(ctx context.Context, uid int64, newUsername string) error
- func QueryOrders(accName, provider, ak, regionId string, startTime, endTime time.Time) error
- func RefreshCache() error
- func RepairCluster(c *types.ClusterInfo, taskId int64, instanceIds []string) (err error)
- func SaveOrders(accName, provider string, cloudOrder []cloud.Order) error
- func Shrink(clusterInfo *types.ClusterInfo, instanceIds []string) error
- func ShrinkCluster(c *types.ClusterInfo, num int, taskId int64) (err error)
- func ShrinkClusterBySpecificIps(c *types.ClusterInfo, deletingIPs string, count int, taskId int64) (err error)
- func SyncInstanceTypes(ctx context.Context, provider string) error
- func UpdateUserStatus(ctx context.Context, usernames []string, status string) error
- type AddSecurityGroupRuleRequest
- type CreateNetworkRequest
- type CreateNetworkResponse
- type CreateSecurityGroupRequest
- type CreateSwitchRequest
- type CreateVPCRequest
- type GetImagesRequest
- type GetRegionsRequest
- type GetSecurityGroupRequest
- type GetSwitchRequest
- type GetVPCFromCloudRequest
- type GetVPCRequest
- type GetZonesRequest
- type Group
- type GroupRule
- type InstanceTypeByZone
- type InstancesSearchCond
- type ListInstanceTypeRequest
- type ListInstanceTypeResponse
- type SecurityGroupResponse
- type SimpleTask
- type SimpleTaskHandler
- type Switch
- type SwitchResponse
- type VPCResponse
- type Vpc
Constants ¶
View Source
const ( TargetTypeVpc targetType = iota TargetTypeSwitch TargetTypeSecurityGroup TargetTypeNetwork TargetTypeAccount TargetTypeInstanceType DefaultRegion = "cn-qingdao" )
View Source
const ( DirectionIn = "ingress" DirectionOut = "egress" )
Variables ¶
This section is empty.
Functions ¶
func AddSecurityGroupRule ¶
func AddSecurityGroupRule(ctx context.Context, req AddSecurityGroupRuleRequest) (string, error)
func BatchCreateInstanceType ¶
func BatchCreateInstanceType(ctx context.Context, inss []model.InstanceType) error
func CheckAccountValid ¶
func CleanClusterUnusedInstances ¶
func CleanClusterUnusedInstances(clusterInfo *types.ClusterInfo) (int, error)
CleanClusterUnusedInstances 清除由于系统异常导致的云厂商中残留的机器
func ConvertToClusterInfo ¶
func ConvertToClusterInfo(m *model.Cluster, tags []model.ClusterTag) (*types.ClusterInfo, error)
ConvertToClusterInfo 将cluster,和tags转换为一个Cloud clusterInfo
func CreateCloudAccount ¶
func CreateCluster4Test ¶
func CreateClusterTags ¶
func CreateClusterTags(tags *[]model.ClusterTag) error
func CreateExpandTask ¶
func CreateSecurityGroup ¶
func CreateSecurityGroup(ctx context.Context, req CreateSecurityGroupRequest) (securityGroupId string, err error)
func CreateShrinkTask ¶
func CreateSwitch ¶
func CreateSwitch(ctx context.Context, req CreateSwitchRequest) (switchId string, err error)
func CreateUser ¶
func CreateVPC ¶
func CreateVPC(ctx context.Context, req CreateVPCRequest) (vpcId string, err error)
func DeleteCloudAccount ¶
func EditCloudAccount ¶
func ExpandAndRepair ¶
func ExpandCluster ¶
func GetAccounts ¶
func GetAksByOrgAkProvider ¶
func GetAksByOrgId ¶
func GetCloudInstancesByClusterName ¶
func GetCloudInstancesByClusterName(clusterInfo *types.ClusterInfo) (instances []cloud.Instance, err error)
func GetClusterByName ¶
func GetClusterCount ¶
func GetClustersByNames ¶
func GetInstance ¶
func GetInstanceByTag ¶
func GetInstanceCount ¶
func GetInstanceUsageTotal ¶
func GetInstances ¶
func GetInstancesByAccount ¶
func GetInstancesByAccounts ¶
func GetInstancesByCond ¶
func GetInstancesByTaskId ¶
func GetRegions ¶
func GetTaskListByAk ¶
func GetTaskListByAks ¶
func GetTaskListByCond ¶
func GetUserList ¶
func GetVPCFromCloud ¶
func ListClusters ¶
func ModifyAdminPassword ¶
func QueryOrders ¶
func RefreshCache ¶
func RefreshCache() error
func RepairCluster ¶
func RepairCluster(c *types.ClusterInfo, taskId int64, instanceIds []string) (err error)
func ShrinkCluster ¶
func ShrinkCluster(c *types.ClusterInfo, num int, taskId int64) (err error)
Types ¶
type CreateNetworkRequest ¶
type CreateNetworkResponse ¶
func CreateNetwork ¶
func CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (vpcRes CreateNetworkResponse, err error)
type CreateSwitchRequest ¶
type CreateVPCRequest ¶
type GetImagesRequest ¶
type GetRegionsRequest ¶
type GetSecurityGroupRequest ¶
type GetSwitchRequest ¶
type GetVPCFromCloudRequest ¶
type GetVPCRequest ¶
type GetZonesRequest ¶
type InstanceTypeByZone ¶
type InstanceTypeByZone struct { InstanceTypeFamily string `json:"instance_type_family"` InstanceType string `json:"instance_type"` Core int `json:"core"` Memory int `json:"memory"` }
func GetInstanceTypeByName ¶ added in v0.1.2
func GetInstanceTypeByName(instanceTypeName string) InstanceTypeByZone
func (*InstanceTypeByZone) GetDesc ¶ added in v0.1.4
func (i *InstanceTypeByZone) GetDesc() string
type InstancesSearchCond ¶
type ListInstanceTypeRequest ¶
type ListInstanceTypeResponse ¶
type ListInstanceTypeResponse struct {
InstanceTypes []InstanceTypeByZone `json:"instance_types"`
}
func ListInstanceType ¶
func ListInstanceType(ctx context.Context, req ListInstanceTypeRequest) (ListInstanceTypeResponse, error)
type SecurityGroupResponse ¶
func GetSecurityGroup ¶
func GetSecurityGroup(ctx context.Context, req GetSecurityGroupRequest) (SecurityGroupResponse, error)
type SimpleTask ¶
type SimpleTaskHandler ¶
type SimpleTaskHandler struct { Tasks chan *SimpleTask // contains filtered or unexported fields }
var H *SimpleTaskHandler
func (*SimpleTaskHandler) SubmitTask ¶
func (s *SimpleTaskHandler) SubmitTask(t *SimpleTask)
type SwitchResponse ¶
func GetSwitch ¶
func GetSwitch(ctx context.Context, req GetSwitchRequest) (resp SwitchResponse, err error)
type VPCResponse ¶
func GetVPC ¶
func GetVPC(ctx context.Context, req GetVPCRequest) (resp VPCResponse, err error)
Click to show internal directories.
Click to hide internal directories.