Documentation ¶
Overview ¶
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
Index ¶
- Constants
- func GetWrappedString(s string, prefix string, suffix string) string
- func NewDiskId() string
- func NewDiskManagerMock(mc TestContext) alicloud.DiskManager
- func NewInstanceId() string
- func NewInstanceManagerMock(mc TestContext) alicloud.InstanceManager
- func NewNetworkInterfaceId() string
- func NewNetworkManagerMock(context TestContext) alicloud.NetworkManager
- func NewOssBucketName() string
- func NewOssManagerMock(mc TestContext) alicloud.OssManager
- func NewOssObejctName() string
- func NewRegistryMock() registry.Client
- func NewSnapshotId() string
- func NewStemcellId() string
- func NewStemcellManagerMock(mc TestContext) alicloud.StemcellManager
- func NewVswitchId() string
- func RandomString(length int) string
- type Builder
- type DiskManagerMock
- func (a DiskManagerMock) AttachDisk(instCid string, diskCid string) error
- func (a DiskManagerMock) ChangeDiskStatus(cid string, toStatus alicloud.DiskStatus, ...) error
- func (a DiskManagerMock) CreateDisk(region string, args *ecs.CreateDiskRequest) (string, error)
- func (a DiskManagerMock) CreateSnapshot(diskCid string, snapshotName string) (string, error)
- func (a DiskManagerMock) DeleteDisk(diskCid string) error
- func (a DiskManagerMock) DeleteSnapshot(snapshotCid string) error
- func (a DiskManagerMock) DetachDisk(instCid string, diskCid string) error
- func (a DiskManagerMock) GetDisk(diskCid string) (*ecs.Disk, error)
- func (a DiskManagerMock) GetDisks(instCid string) ([]ecs.Disk, error)
- func (a DiskManagerMock) ModifyDiskAttribute(diskCid string, name string, description string) error
- func (a DiskManagerMock) ResizeDisk(diskCid string, sizeGB int) error
- func (a DiskManagerMock) WaitForDiskStatus(diskCid string, toStatus alicloud.DiskStatus) (string, error)
- type InstanceManagerMock
- func (a InstanceManagerMock) AddTags(cid string, tags map[string]string) error
- func (a InstanceManagerMock) ChangeInstanceStatus(cid string, toStatus alicloud.InstanceStatus, ...) error
- func (a InstanceManagerMock) CleanupInstanceNetworkInterfaces(cid string, eniIds []string) error
- func (a InstanceManagerMock) CreateInstance(region string, args *ecs.CreateInstanceRequest) (string, error)
- func (a InstanceManagerMock) DeleteInstance(cid string) error
- func (a InstanceManagerMock) GetAttachedNetworkInterfaceIds(cid string) []string
- func (a InstanceManagerMock) GetInstance(cid string) (*ecs.Instance, error)
- func (a InstanceManagerMock) GetInstanceStatus(cid string) (alicloud.InstanceStatus, error)
- func (a InstanceManagerMock) ModifyInstanceAttribute(cid string, name string, description string) error
- func (a InstanceManagerMock) RebootInstance(cid string) error
- func (a InstanceManagerMock) StartInstance(cid string) error
- func (a InstanceManagerMock) StopInstance(cid string) error
- func (a InstanceManagerMock) WaitForInstanceStatus(cid string, toStatus alicloud.InstanceStatus) (alicloud.InstanceStatus, error)
- type NetworkManagerMock
- func (a NetworkManagerMock) BindEip(region string, instanceId string, eip string) error
- func (a NetworkManagerMock) BindSLB(region, instanceId, slbId string, weight int) error
- func (a NetworkManagerMock) DescribeEip(region, eip string) (ecs.EipAddressInDescribeEipAddresses, error)
- func (a NetworkManagerMock) DescribeSecurityGroupAttribute(region, groupId string) (ecs.DescribeSecurityGroupAttributeResponse, error)
- func (a NetworkManagerMock) JoinSecurityGroup(region, instanceId string, groupId string) error
- func (a NetworkManagerMock) WaitForEipStatus(region, eip string, toStatus alicloud.EipStatus) error
- type OssManagerMock
- func (a OssManagerMock) CreateBucket(name string, options ...oss.Option) error
- func (a OssManagerMock) DeleteBucket(name string) error
- func (a OssManagerMock) DeleteObject(bucket oss.Bucket, name string) error
- func (a OssManagerMock) GetBucket(name string) (*oss.Bucket, error)
- func (a OssManagerMock) MultipartUploadFile(bucket oss.Bucket, objectKey, filePath string, partSize int64, ...) error
- func (a OssManagerMock) UploadFile(bucket oss.Bucket, objectKey, filePath string, partSize int64, ...) error
- type RegistryClientMock
- type StemcellManagerMock
- func (a StemcellManagerMock) DeleteStemcell(id string) error
- func (a StemcellManagerMock) FindStemcellById(id string) (*ecs.Image, error)
- func (a StemcellManagerMock) ImportImage(args *ecs.ImportImageRequest) (string, error)
- func (a StemcellManagerMock) OpenLocalFile(path string) (*os.File, error)
- func (a StemcellManagerMock) WaitForImageReady(id string) error
- type TestContext
- func (c TestContext) NewBucket(name string) (string, *oss.Bucket)
- func (c TestContext) NewDisk(instCid string) (string, *ecs.Disk)
- func (c TestContext) NewInstance() (string, *ecs.Instance)
- func (c TestContext) NewNetworkInterface() *ecs.NetworkInterface
- func (c TestContext) NewObject(name, path string) string
- func (c TestContext) NewSnapshot(diskCid string) string
- func (c TestContext) NewStemcell() (string, *ecs.Image)
Constants ¶
View Source
const (
MaxDiskSizeGB = 32768
)
Variables ¶
This section is empty.
Functions ¶
func NewDiskManagerMock ¶
func NewDiskManagerMock(mc TestContext) alicloud.DiskManager
func NewInstanceId ¶
func NewInstanceId() string
func NewInstanceManagerMock ¶
func NewInstanceManagerMock(mc TestContext) alicloud.InstanceManager
func NewNetworkInterfaceId ¶
func NewNetworkInterfaceId() string
func NewNetworkManagerMock ¶
func NewNetworkManagerMock(context TestContext) alicloud.NetworkManager
func NewOssBucketName ¶
func NewOssBucketName() string
func NewOssManagerMock ¶
func NewOssManagerMock(mc TestContext) alicloud.OssManager
func NewOssObejctName ¶
func NewOssObejctName() string
func NewRegistryMock ¶
func NewSnapshotId ¶
func NewSnapshotId() string
func NewStemcellId ¶
func NewStemcellId() string
func NewStemcellManagerMock ¶
func NewStemcellManagerMock(mc TestContext) alicloud.StemcellManager
func NewVswitchId ¶
func NewVswitchId() string
func RandomString ¶
Types ¶
type DiskManagerMock ¶
type DiskManagerMock struct {
// contains filtered or unexported fields
}
func (DiskManagerMock) AttachDisk ¶
func (a DiskManagerMock) AttachDisk(instCid string, diskCid string) error
func (DiskManagerMock) ChangeDiskStatus ¶
func (a DiskManagerMock) ChangeDiskStatus(cid string, toStatus alicloud.DiskStatus, checkFunc func(disk *ecs.Disk) (bool, error)) error
func (DiskManagerMock) CreateDisk ¶
func (a DiskManagerMock) CreateDisk(region string, args *ecs.CreateDiskRequest) (string, error)
func (DiskManagerMock) CreateSnapshot ¶
func (a DiskManagerMock) CreateSnapshot(diskCid string, snapshotName string) (string, error)
func (DiskManagerMock) DeleteDisk ¶
func (a DiskManagerMock) DeleteDisk(diskCid string) error
func (DiskManagerMock) DeleteSnapshot ¶
func (a DiskManagerMock) DeleteSnapshot(snapshotCid string) error
func (DiskManagerMock) DetachDisk ¶
func (a DiskManagerMock) DetachDisk(instCid string, diskCid string) error
func (DiskManagerMock) GetDisk ¶
func (a DiskManagerMock) GetDisk(diskCid string) (*ecs.Disk, error)
func (DiskManagerMock) GetDisks ¶
func (a DiskManagerMock) GetDisks(instCid string) ([]ecs.Disk, error)
func (DiskManagerMock) ModifyDiskAttribute ¶
func (a DiskManagerMock) ModifyDiskAttribute(diskCid string, name string, description string) error
func (DiskManagerMock) ResizeDisk ¶
func (a DiskManagerMock) ResizeDisk(diskCid string, sizeGB int) error
func (DiskManagerMock) WaitForDiskStatus ¶
func (a DiskManagerMock) WaitForDiskStatus(diskCid string, toStatus alicloud.DiskStatus) (string, error)
type InstanceManagerMock ¶
type InstanceManagerMock struct {
// contains filtered or unexported fields
}
func (InstanceManagerMock) AddTags ¶
func (a InstanceManagerMock) AddTags(cid string, tags map[string]string) error
func (InstanceManagerMock) ChangeInstanceStatus ¶
func (a InstanceManagerMock) ChangeInstanceStatus(cid string, toStatus alicloud.InstanceStatus, checkFunc func(status alicloud.InstanceStatus) (bool, error)) error
func (InstanceManagerMock) CleanupInstanceNetworkInterfaces ¶
func (a InstanceManagerMock) CleanupInstanceNetworkInterfaces(cid string, eniIds []string) error
func (InstanceManagerMock) CreateInstance ¶
func (a InstanceManagerMock) CreateInstance(region string, args *ecs.CreateInstanceRequest) (string, error)
func (InstanceManagerMock) DeleteInstance ¶
func (a InstanceManagerMock) DeleteInstance(cid string) error
func (InstanceManagerMock) GetAttachedNetworkInterfaceIds ¶
func (a InstanceManagerMock) GetAttachedNetworkInterfaceIds(cid string) []string
func (InstanceManagerMock) GetInstance ¶
func (a InstanceManagerMock) GetInstance(cid string) (*ecs.Instance, error)
func (InstanceManagerMock) GetInstanceStatus ¶
func (a InstanceManagerMock) GetInstanceStatus(cid string) (alicloud.InstanceStatus, error)
func (InstanceManagerMock) ModifyInstanceAttribute ¶
func (a InstanceManagerMock) ModifyInstanceAttribute(cid string, name string, description string) error
func (InstanceManagerMock) RebootInstance ¶
func (a InstanceManagerMock) RebootInstance(cid string) error
func (InstanceManagerMock) StartInstance ¶
func (a InstanceManagerMock) StartInstance(cid string) error
func (InstanceManagerMock) StopInstance ¶
func (a InstanceManagerMock) StopInstance(cid string) error
func (InstanceManagerMock) WaitForInstanceStatus ¶
func (a InstanceManagerMock) WaitForInstanceStatus(cid string, toStatus alicloud.InstanceStatus) (alicloud.InstanceStatus, error)
type NetworkManagerMock ¶
type NetworkManagerMock struct { }
func (NetworkManagerMock) BindEip ¶
func (a NetworkManagerMock) BindEip(region string, instanceId string, eip string) error
func (NetworkManagerMock) BindSLB ¶
func (a NetworkManagerMock) BindSLB(region, instanceId, slbId string, weight int) error
func (NetworkManagerMock) DescribeEip ¶
func (a NetworkManagerMock) DescribeEip(region, eip string) (ecs.EipAddressInDescribeEipAddresses, error)
func (NetworkManagerMock) DescribeSecurityGroupAttribute ¶
func (a NetworkManagerMock) DescribeSecurityGroupAttribute(region, groupId string) (ecs.DescribeSecurityGroupAttributeResponse, error)
func (NetworkManagerMock) JoinSecurityGroup ¶
func (a NetworkManagerMock) JoinSecurityGroup(region, instanceId string, groupId string) error
func (NetworkManagerMock) WaitForEipStatus ¶
func (a NetworkManagerMock) WaitForEipStatus(region, eip string, toStatus alicloud.EipStatus) error
type OssManagerMock ¶
type OssManagerMock struct {
// contains filtered or unexported fields
}
func (OssManagerMock) CreateBucket ¶
func (a OssManagerMock) CreateBucket(name string, options ...oss.Option) error
func (OssManagerMock) DeleteBucket ¶
func (a OssManagerMock) DeleteBucket(name string) error
func (OssManagerMock) DeleteObject ¶
func (a OssManagerMock) DeleteObject(bucket oss.Bucket, name string) error
func (OssManagerMock) GetBucket ¶
func (a OssManagerMock) GetBucket(name string) (*oss.Bucket, error)
func (OssManagerMock) MultipartUploadFile ¶
func (OssManagerMock) UploadFile ¶
type RegistryClientMock ¶
type RegistryClientMock struct {
// contains filtered or unexported fields
}
func (RegistryClientMock) Delete ¶
func (c RegistryClientMock) Delete(instanceID string) error
func (RegistryClientMock) Fetch ¶
func (c RegistryClientMock) Fetch(instanceID string) (registry.AgentSettings, error)
func (RegistryClientMock) Update ¶
func (c RegistryClientMock) Update(instanceID string, agentSettings registry.AgentSettings) error
type StemcellManagerMock ¶
type StemcellManagerMock struct {
// contains filtered or unexported fields
}
func (StemcellManagerMock) DeleteStemcell ¶
func (a StemcellManagerMock) DeleteStemcell(id string) error
func (StemcellManagerMock) FindStemcellById ¶
func (a StemcellManagerMock) FindStemcellById(id string) (*ecs.Image, error)
func (StemcellManagerMock) ImportImage ¶
func (a StemcellManagerMock) ImportImage(args *ecs.ImportImageRequest) (string, error)
func (StemcellManagerMock) OpenLocalFile ¶
func (a StemcellManagerMock) OpenLocalFile(path string) (*os.File, error)
func (StemcellManagerMock) WaitForImageReady ¶
func (a StemcellManagerMock) WaitForImageReady(id string) error
type TestContext ¶
type TestContext struct { Disks map[string]*ecs.Disk Instances map[string]*ecs.Instance Stemcells map[string]*ecs.Image Buckets map[string]*oss.Bucket OssObjects map[string]string Snapshots map[string]string NetworkInterfaces map[string]*ecs.NetworkInterface // contains filtered or unexported fields }
func NewTestContext ¶
func NewTestContext(config alicloud.Config) TestContext
func (TestContext) NewInstance ¶
func (c TestContext) NewInstance() (string, *ecs.Instance)
func (TestContext) NewNetworkInterface ¶
func (c TestContext) NewNetworkInterface() *ecs.NetworkInterface
func (TestContext) NewObject ¶
func (c TestContext) NewObject(name, path string) string
func (TestContext) NewSnapshot ¶
func (c TestContext) NewSnapshot(diskCid string) string
func (TestContext) NewStemcell ¶
func (c TestContext) NewStemcell() (string, *ecs.Image)
Click to show internal directories.
Click to hide internal directories.