Documentation
¶
Index ¶
- Constants
- Variables
- func CreateDBaaSClusterAndWait(ctx context.Context, client *edgecloud.Client, ...) (*edgecloud.DBaaSCluster, error)
- func DBaaSClusterGetByCreatorTaskID(ctx context.Context, client *edgecloud.Client, name string, ...) (*edgecloud.DBaaSCluster, error)
- func DeletePoolByNameIfExist(ctx context.Context, client *edgecloud.Client, name, loadBalancerID string) error
- func DeleteResourceIfExist(ctx context.Context, client *edgecloud.Client, resource interface{}, ...) error
- func DeleteUnusedPools(ctx context.Context, client *edgecloud.Client, oldPools []edgecloud.Pool, ...) error
- func FindDefaultSG(ctx context.Context, client *edgecloud.Client) (*edgecloud.SecurityGroup, error)
- func FindPoolMemberByAddressPortAndSubnetID(pool edgecloud.Pool, addr net.IP, protocolPort int, subnetID string) (found bool)
- func FlavorIsAvailable(ctx context.Context, client *edgecloud.Client, flavorName string, ...) (bool, error)
- func FlavorIsExist(ctx context.Context, client *edgecloud.Client, flavorName string) (bool, error)
- func FloatingIPDetailedByID(ctx context.Context, client *edgecloud.Client, id string) (*edgecloud.FloatingIP, error)
- func FloatingIPDetailedByIPAddress(ctx context.Context, client *edgecloud.Client, floatingIPAddress string) (*edgecloud.FloatingIP, error)
- func FloatingIPsListByPortID(ctx context.Context, client *edgecloud.Client, portID string) ([]edgecloud.FloatingIP, error)
- func GenerateRandomString(length int, includeLetters, includeDigits, includeSpecial bool) (string, error)
- func GetLbL7PolicyFromName(ctx context.Context, client *edgecloud.Client, name string) (*edgecloud.L7Policy, error)
- func InstanceNetworkInterfaceByID(ctx context.Context, client *edgecloud.Client, instanceID string, ...) (*edgecloud.InstancePortInterface, error)
- func InstanceNetworkPortByID(ctx context.Context, client *edgecloud.Client, instanceID string, ...) (*edgecloud.InstancePort, error)
- func IsLockedErr(resp *edgecloud.Response) bool
- func IsNotFoundErr(resp *edgecloud.Response) bool
- func L7PoliciesListByListenerID(ctx context.Context, client *edgecloud.Client, listenerID string) ([]edgecloud.L7Policy, error)
- func LBListenerGetByName(ctx context.Context, client *edgecloud.Client, name, loadBalancerID string) (*edgecloud.Listener, error)
- func LBPoolGetByName(ctx context.Context, client *edgecloud.Client, name, loadBalancerID string) (*edgecloud.Pool, error)
- func LBSharedPoolList(ctx context.Context, client *edgecloud.Client, loadBalancerID string) ([]edgecloud.Pool, error)
- func LoadbalancerFlavorIsExist(ctx context.Context, client *edgecloud.Client, flavorName string) (bool, error)
- func LoadbalancerGetByName(ctx context.Context, client *edgecloud.Client, name string) (*edgecloud.Loadbalancer, error)
- func PoolMemberGetByID(ctx context.Context, client *edgecloud.Client, poolID, memberID string) (*edgecloud.PoolMember, error)
- func ResourceIsDeleted[T any](ctx context.Context, getResourceFunc GetResourceFunc[T], id string) error
- func ResourceIsExist[T any](ctx context.Context, getResourceFunc GetResourceFunc[T], id string) (bool, error)
- func RetryDeleteLocked(ctx context.Context, client *edgecloud.Client, ...) error
- func SecurityGroupListByIDs(ctx context.Context, client *edgecloud.Client, targetSgIDs []string) (sgs []edgecloud.SecurityGroup, err error)
- func ServerGroupGetByInstance(ctx context.Context, client *edgecloud.Client, instanceID string) (*edgecloud.ServerGroup, error)
- func SnapshotsListByNameAndVolumeID(ctx context.Context, client *edgecloud.Client, name, volumeID string) ([]edgecloud.Snapshot, error)
- func SnapshotsListByStatusAndVolumeID(ctx context.Context, client *edgecloud.Client, status, volumeID string) ([]edgecloud.Snapshot, error)
- func VolumesListByName(ctx context.Context, client *edgecloud.Client, name string) ([]edgecloud.Volume, error)
- func WaitAndGetTaskInfo(ctx context.Context, client *edgecloud.Client, taskID string, ...) (*edgecloud.Task, error)
- func WaitDBaaSClusterByCreatorTaskID(ctx context.Context, client *edgecloud.Client, name string, ...) (*edgecloud.DBaaSCluster, error)
- func WaitDBaaSClusterStatusHealthy(ctx context.Context, client *edgecloud.Client, clusterID string, ...) (*edgecloud.DBaaSCluster, error)
- func WaitForInstanceShutoff(ctx context.Context, client *edgecloud.Client, instanceID string, ...) error
- func WaitForTaskComplete(ctx context.Context, client *edgecloud.Client, taskID string, ...) error
- func WaitLoadbalancerProvisioningStatusActive(ctx context.Context, client *edgecloud.Client, loadBalancerID string, ...) error
- func WaitSnapshotStatusReady(ctx context.Context, client *edgecloud.Client, snapshotID string, ...) error
- func WaitVolumeAttachedToInstance(ctx context.Context, client *edgecloud.Client, volumeID, instanceID string, ...) error
- func WaitVolumeDetachedFromInstance(ctx context.Context, client *edgecloud.Client, volumeID, instanceID string, ...) error
- func WithRetry(f retry.RetryableFunc, attempts *uint) error
- type GetResourceFunc
- type SecurityGroupRuleProtocol
- type TaskAPIFunc
- type TaskResult
Constants ¶
View Source
const Attempts uint = 10
View Source
const (
DBaaSClusterHealthyStatus = "HEALTHY"
)
View Source
const InstanceShutoffStatus = "SHUTOFF"
View Source
const SnapshotReadyStatus = "available"
Variables ¶
View Source
var ( ErrDBaaSClustersNotFound = errors.New("no DBaaS clusters were found for the specified search criteria") ErrDBaaSClusterNotReady = errors.New("DBaaS cluster failed to become healthy within the allocated time") )
View Source
var ( ErrFloatingIPsNotFound = errors.New("no FloatingIPs were found for the specified search criteria") ErrFloatingIPNotFound = errors.New("no FloatingIP was found for the specified search criteria") )
View Source
var ( ErrInstanceNotShutOff = errors.New("the instance is not shut off") ErrInstanceInterfaceNotFound = errors.New("instance interface not found") ErrInstancePortNotFound = errors.New("instance port not found") )
View Source
var ( ErrLoadbalancersNotFound = errors.New("no Loadbalancers were found for the specified search criteria") ErrLoadbalancerPoolsNotFound = errors.New("no Loadbalancer pools were found for the specified search criteria") ErrLoadbalancerPoolsMemberNotFound = errors.New("no Loadbalancer pool member were found for the specified search criteria") ErrLoadbalancerListenerNotFound = errors.New("no Loadbalancer listener were found for the specified search criteria") ErrMultipleResults = errors.New("multiple results where only one expected") ErrErrorState = errors.New("loadbalancer in Error state") ErrNotActiveStatus = errors.New("waiting for Active status") )
View Source
var ( ErrSnapshotsNotFound = errors.New("no Snapshots were found for the specified search criteria") ErrSnapshotNotReady = errors.New("snapshot failed to be ready within the allocated time") )
View Source
var ( ErrVolumesNotFound = errors.New("no Volumes were found for the specified search criteria") ErrVolumesNotAttached = errors.New("volume failed to be attached within the allocated time") ErrVolumesNotDetached = errors.New("volume failed to be detached within the allocated time") )
View Source
var ErrDefaultSGNotFound = errors.New("default security group is not found")
View Source
var ErrL7PoliciesNotFound = errors.New("no l7Policies were found for the specified search criteria")
View Source
var ErrSecGroupNotFound = errors.New("security group is not found")
View Source
var ErrServerGroupNotFound = errors.New("no server group was found for the specified search criteria")
Functions ¶
func CreateDBaaSClusterAndWait ¶ added in v2.5.9
func DBaaSClusterGetByCreatorTaskID ¶ added in v2.5.9
func DeletePoolByNameIfExist ¶
func DeleteResourceIfExist ¶
func DeleteUnusedPools ¶
func FindDefaultSG ¶ added in v2.1.3
func FlavorIsAvailable ¶
func FlavorIsExist ¶
func FloatingIPDetailedByID ¶
func FloatingIPsListByPortID ¶
func GenerateRandomString ¶ added in v2.5.0
func GetLbL7PolicyFromName ¶ added in v2.0.29
func InstanceNetworkInterfaceByID ¶ added in v2.1.5
func InstanceNetworkPortByID ¶ added in v2.1.5
func IsLockedErr ¶ added in v2.5.6
func IsNotFoundErr ¶ added in v2.5.6
func LBListenerGetByName ¶
func LBPoolGetByName ¶
func LBSharedPoolList ¶
func LoadbalancerGetByName ¶
func PoolMemberGetByID ¶
func ResourceIsDeleted ¶
func ResourceIsExist ¶
func RetryDeleteLocked ¶ added in v2.5.6
func SecurityGroupListByIDs ¶ added in v2.1.5
func VolumesListByName ¶
func WaitAndGetTaskInfo ¶
func WaitDBaaSClusterByCreatorTaskID ¶ added in v2.5.9
func WaitDBaaSClusterStatusHealthy ¶ added in v2.5.9
func WaitForInstanceShutoff ¶
func WaitForTaskComplete ¶
func WaitSnapshotStatusReady ¶
Types ¶
type GetResourceFunc ¶
type SecurityGroupRuleProtocol ¶ added in v2.0.5
type SecurityGroupRuleProtocol edgecloud.SecurityGroupRuleProtocol
func (SecurityGroupRuleProtocol) List ¶ added in v2.0.5
func (s SecurityGroupRuleProtocol) List() []edgecloud.SecurityGroupRuleProtocol
func (SecurityGroupRuleProtocol) StringList ¶ added in v2.0.5
func (s SecurityGroupRuleProtocol) StringList() []string
type TaskAPIFunc ¶
type TaskResult ¶
type TaskResult struct {
DdosProfiles []int `json:"ddos_profiles"`
FloatingIPs []string `json:"floatingips"`
HealthMonitors []string `json:"healthmonitors"`
Images []string `json:"images"`
Instances []string `json:"instances"`
L7Polices []string `json:"l7polices"`
L7Rules []string `json:"l7rules"`
Listeners []string `json:"listeners"`
Loadbalancers []string `json:"loadbalancers"`
Members []string `json:"members"`
Networks []string `json:"networks"`
Pools []string `json:"pools"`
Ports []string `json:"ports"`
Projects []string `json:"projects"`
Routers []string `json:"routers"`
Secrets []string `json:"secrets"`
ServerGroups []string `json:"servergroups"`
Snapshots []string `json:"snapshots"`
Subnets []string `json:"subnets"`
Volumes []string `json:"volumes"`
MkaasClusters []float64 `json:"mkaasclusters"`
MkaasPools []float64 `json:"mkaaspools"`
DbaasClusters []string `json:"dbaasclusters"`
}
func ExecuteAndExtractTaskResult ¶
func ExecuteAndExtractTaskResult[T any](ctx context.Context, apiFunc TaskAPIFunc[T], opt T, client *edgecloud.Client, timeouts ...time.Duration) (*TaskResult, error)
func ExtractTaskResultFromTask ¶
func ExtractTaskResultFromTask(task *edgecloud.Task) (*TaskResult, error)
Click to show internal directories.
Click to hide internal directories.