commonruntime

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

define string of resource types redefined for backward compatibility

View Source
const (
	// Error message templates
	ERR_GETTING_PROCESS_INFO    = "error getting process information: %v"
	ERR_GETTING_HOST_INFO       = "error getting host information: %v"
	ERR_GETTING_CPU_INFO        = "error getting CPU information: %v"
	ERR_GETTING_MEMORY_INFO     = "error getting memory information: %v"
	ERR_GETTING_DISK_INFO       = "error getting disk information: %v"
	ERR_GETTING_DISK_IO_INFO    = "error getting disk I/O information: %v"
	ERR_GETTING_NETWORK_IO_INFO = "error getting network I/O information: %v"
)
View Source
const CONNECTION_NAME_COLUMN = "connection_name"

==================================================================== Common column name and struct for GORM

View Source
const NAME_ID_COLUMN = "name_id"
View Source
const OWNER_CLUSTER_NAME_COLUMN = "owner_cluster_name"
View Source
const OWNER_VPC_NAME_COLUMN = "owner_vpc_name"
View Source
const SYSTEM_ID_COLUMN = "system_id"

Variables

View Source
var GoServicePort string

GO Service Port

View Source
var MiddleStartTime string
View Source
var ServerIPorName string

// CB-Spider Servcie Address Configuration // cf) https://github.com/cloud-barista/cb-spider/wiki/CB-Spider-Service-Address-Configuration REST and GO SERVER_ADDRESS since v0.4.4

View Source
var ServerPort string
View Source
var ServiceIPorName string

REST SERVICE_ADDRESS for AdminWeb since v0.4.4

View Source
var ServicePort string
View Source
var ShortStartTime string
View Source
var StartTime string

CB-Spider Start Time

Functions

func AbortMultipartUpload added in v0.11.6

func AbortMultipartUpload(connectionName string, bucketName string, objectName string, uploadID string) error

func AddAccessSubnet added in v0.10.8

func AddAccessSubnet(connectionName string, nameID string, subnetIID cres.IID) (*cres.FileSystemInfo, error)

func AddNLBVMs added in v0.5.11

func AddNLBVMs(connectionName string, nlbName string, vmNames []string) (*cres.NLBInfo, error)

(1) check exist(NameID) and VMs (2) add VMs (3) Get NLBInfo (4) Set ResoureInfo

func AddNodeGroup added in v0.6.13

func AddNodeGroup(connectionName string, rsType string, clusterName string, reqInfo cres.NodeGroupInfo, IDTransformMode string) (*cres.ClusterInfo, error)

(1) check exist(NameID) (2) add NodeGroup (3) Get ClusterInfo (4) Set ResoureInfo

func AddRules added in v0.5.4

func AddRules(connectionName string, sgName string, reqInfoList []cres.SecurityRuleInfo) (*cres.SecurityInfo, error)

(1) check exist(NameID) (2) add Rules

func AddSubnet added in v0.3.1

func AddSubnet(connectionName string, rsType string, vpcName string, reqInfo cres.SubnetInfo, IDTransformMode string) (*cres.VPCInfo, error)

(1) check exist(NameID) (2) create Resource (3) insert IID

func AddTag added in v0.9.2

func AddTag(connectionName string, resType cres.RSType, resName string, tag cres.KeyValue) (cres.KeyValue, error)

AddTag adds a tag to a resource.

func AnyCall added in v0.6.9

func AnyCall(connectionName string, reqInfo cres.AnyCallInfo) (*cres.AnyCallInfo, error)

func AttachDisk added in v0.6.7

func AttachDisk(connectionName string, diskName string, ownerVMName string) (*cres.DiskInfo, error)

(1) check exist(NameID) and VMs (2) attach disk to VM (3) Set ResoureInfo

func ChangeDiskSize added in v0.6.7

func ChangeDiskSize(connectionName string, diskName string, size string) (bool, error)

func ChangeHealthChecker added in v0.5.10

func ChangeHealthChecker(connectionName string, nlbName string, healthChecker cres.HealthCheckerInfo) (*cres.NLBInfo, error)

---------------------------------------------------// @todo To support or not will be decided later. // ---------------------------------------------------// (1) check exist(NameID) (2) change HealthCheckerInfo (3) Get NLBInfo (4) Set ResoureInfo

func ChangeListener added in v0.5.10

func ChangeListener(connectionName string, nlbName string, listener cres.ListenerInfo) (*cres.NLBInfo, error)

---------------------------------------------------// @todo To support or not will be decided later. // ---------------------------------------------------// (1) check exist(NameID) (2) change listener (3) Get NLBInfo (4) Set ResoureInfo

func ChangeNodeGroupScaling added in v0.6.13

func ChangeNodeGroupScaling(connectionName string, clusterName string, nodeGroupName string,
	DesiredNodeSize int, MinNodeSize int, MaxNodeSize int) (cres.NodeGroupInfo, error)

func ChangeVMGroup added in v0.5.10

func ChangeVMGroup(connectionName string, nlbName string, vmGroup cres.VMGroupInfo) (*cres.NLBInfo, error)

---------------------------------------------------// @todo To support or not will be decided later. // ---------------------------------------------------// (1) check exist(NameID) (2) change VMGroup (3) Get NLBInfo (4) Set ResoureInfo

func CompleteMultipartUpload added in v0.11.0

func CompleteMultipartUpload(connectionName string, bucketName string, objectName string, uploadID string, parts []CompletePart) (string, string, error)

func ControlVM

func ControlVM(connectionName string, rsType string, nameID string, action string) (cres.VMStatus, error)

(1) get IID(NameId) (2) control CSP:VM(SystemId)

func CountAllClusters added in v0.8.17

func CountAllClusters() (int64, error)

func CountAllDisks added in v0.8.17

func CountAllDisks() (int64, error)

func CountAllKeys added in v0.8.17

func CountAllKeys() (int64, error)

func CountAllMyImages added in v0.8.17

func CountAllMyImages() (int64, error)

func CountAllNLBs added in v0.8.17

func CountAllNLBs() (int64, error)

func CountAllSecurityGroups added in v0.8.17

func CountAllSecurityGroups() (int64, error)

func CountAllSubnets added in v0.8.17

func CountAllSubnets() (int64, error)

func CountAllVMs added in v0.8.17

func CountAllVMs() (int64, error)

func CountAllVPCs added in v0.8.17

func CountAllVPCs() (int64, error)

func CountClustersByConnection added in v0.8.17

func CountClustersByConnection(connectionName string) (int64, error)

func CountDisksByConnection added in v0.8.17

func CountDisksByConnection(connectionName string) (int64, error)

func CountKeysByConnection added in v0.8.17

func CountKeysByConnection(connectionName string) (int64, error)

func CountMyImagesByConnection added in v0.8.17

func CountMyImagesByConnection(connectionName string) (int64, error)

func CountNLBsByConnection added in v0.8.17

func CountNLBsByConnection(connectionName string) (int64, error)

func CountS3BucketsByConnection added in v0.12.1

func CountS3BucketsByConnection(connectionName string) (int64, error)

func CountSecurityGroupsByConnection added in v0.8.17

func CountSecurityGroupsByConnection(connectionName string) (int64, error)

func CountSubnetsByConnection added in v0.8.17

func CountSubnetsByConnection(connectionName string) (int64, error)

func CountVMsByConnection added in v0.8.17

func CountVMsByConnection(connectionName string) (int64, error)

func CountVPCsByConnection added in v0.8.17

func CountVPCsByConnection(connectionName string) (int64, error)

func CreateCluster added in v0.6.13

func CreateCluster(connectionName string, rsType string, reqInfo cres.ClusterInfo, IDTransformMode string) (*cres.ClusterInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) create Resource (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (5) insert spiderIID (6) create userIID (7) set used Resources's userIID

func CreateDisk added in v0.6.7

func CreateDisk(connectionName string, rsType string, reqInfo cres.DiskInfo, IDTransformMode string) (*cres.DiskInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) create Resource (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (5) insert spiderIID (6) create userIID

func CreateFileSystem added in v0.10.8

func CreateFileSystem(connectionName string, reqInfo cres.FileSystemInfo) (*cres.FileSystemInfo, error)

func CreateKey

func CreateKey(connectionName string, rsType string, reqInfo cres.KeyPairReqInfo, IDTransformMode string) (*cres.KeyPairInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) create Resource (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (5) insert spiderIID (6) create userIID

func CreateNLB added in v0.5.10

func CreateNLB(connectionName string, rsType string, reqInfo cres.NLBInfo, IDTransformMode string) (*cres.NLBInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) create Resource (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (5) insert spiderIID (6) create userIID

func CreateS3Bucket added in v0.10.8

func CreateS3Bucket(connectionName, bucketName string) (*minio.BucketInfo, error)

func CreateSecurity

func CreateSecurity(connectionName string, rsType string, reqInfo cres.SecurityReqInfo, IDTransformMode string) (*cres.SecurityInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) create Resource (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (5) insert spiderIID (6) create userIID

func CreateVPC

func CreateVPC(connectionName string, rsType string, reqInfo cres.VPCReqInfo, IDTransformMode string) (*cres.VPCInfo, error)

func DeleteCSPResource

func DeleteCSPResource(connectionName string, rsType string, systemID string) (bool, cres.VMStatus, error)

delete CSP's Resource(SystemId)

func DeleteCluster added in v0.7.6

func DeleteCluster(connectionName string, rsType string, nameID string, force string) (bool, error)

func DeleteDisk added in v0.7.6

func DeleteDisk(connectionName string, rsType string, nameID string, force string) (bool, error)

func DeleteFileSystem added in v0.10.8

func DeleteFileSystem(connectionName string, nameID string) (bool, error)

func DeleteKey added in v0.7.6

func DeleteKey(connectionName string, rsType string, nameID string, force string) (bool, error)

(1) get spiderIID (2) delete Resource(SystemId) (3) delete IID

func DeleteMyImage added in v0.7.6

func DeleteMyImage(connectionName string, rsType string, nameID string, force string) (bool, error)

func DeleteNLB added in v0.7.6

func DeleteNLB(connectionName string, rsType string, nameID string, force string) (bool, error)

(1) get spiderIID (2) delete Resource(SystemId) (3) delete IID

func DeleteS3Bucket added in v0.10.8

func DeleteS3Bucket(connectionName, bucketName string, force string) (bool, error)

func DeleteS3BucketCORS added in v0.11.0

func DeleteS3BucketCORS(connectionName string, bucketName string) (bool, error)

func DeleteS3Object added in v0.10.8

func DeleteS3Object(connectionName, bucketName, objectName string) (bool, error)

func DeleteS3ObjectDeleteMarker added in v0.11.0

func DeleteS3ObjectDeleteMarker(connectionName, bucketName, objectName string) (bool, error)

DeleteS3ObjectDeleteMarker deletes a delete marker (null version ID case)

func DeleteS3ObjectVersion added in v0.11.0

func DeleteS3ObjectVersion(connectionName, bucketName, objectName, versionID string) (bool, error)

DeleteS3ObjectVersion deletes a specific version of an object

func DeleteSecurity added in v0.7.6

func DeleteSecurity(connectionName string, rsType string, nameID string, force string) (bool, error)

(1) get spiderIID (2) delete Resource(SystemId) (3) delete IID

func DeleteVM added in v0.7.6

func DeleteVM(connectionName string, rsType string, nameID string, force string) (bool, cres.VMStatus, error)

func DeleteVPC added in v0.7.6

func DeleteVPC(connectionName string, rsType string, nameID string, force string) (bool, error)

(1) get spiderIID (2) delete Resource(SystemId) (3) delete IID

func DetachDisk added in v0.6.7

func DetachDisk(connectionName string, diskName string, ownerVMName string) (bool, error)

(1) check exist(NameID) (2) detach disk from VM

func DisplayResourceUsage added in v0.10.4

func DisplayResourceUsage(sysInfoTotalMemory string, usage *ResourceUsage)

DisplayResourceUsage prints the collected resource usage information

func DisplaySystemInfo added in v0.10.4

func DisplaySystemInfo(sysInfo *SystemInfo)

DisplaySystemInfo prints the collected system information

func EmptyCheckAndTrim added in v0.4.15

func EmptyCheckAndTrim(inputName string, inputValue string) (string, error)

func EnableVersioning added in v0.10.8

func EnableVersioning(connectionName string, bucketName string) (bool, error)

func FindTag added in v0.9.2

func FindTag(connectionName string, resType cres.RSType, keyword string) ([]*cres.TagInfo, error)

FindTag finds tags by key or value.

func ForceEmptyAndDeleteBucket added in v0.11.0

func ForceEmptyAndDeleteBucket(connectionName, bucketName string) (bool, error)

ForceEmptyAndDeleteBucket completely empties a bucket and deletes it

func ForceEmptyBucket added in v0.11.0

func ForceEmptyBucket(connectionName, bucketName string) (bool, error)

ForceEmptyBucket completely empties a bucket but keeps the bucket

func GenerateClusterToken added in v0.11.13

func GenerateClusterToken(connectionName string, clusterName string) (string, error)

Generate Token for Cluster Authentication (1) get IID(NameId) (2) generate token using driver

func GetAllSPLockInfo added in v0.5.7

func GetAllSPLockInfo() []string

func GetCSPResourceInfo added in v0.6.17

func GetCSPResourceInfo(connectionName string, rsType string, systemID string) ([]byte, error)

Get Json string of CSP's Resource(SystemId) Info

func GetCSPResourceName added in v0.6.6

func GetCSPResourceName(connectionName string, rsType string, nameID string) (string, error)

================ get CSP Name

func GetCSPVM added in v0.6.16

func GetCSPVM(connectionName string, rsType string, cspID string) (*cres.VMInfo, error)

func GetCluster added in v0.6.13

func GetCluster(connectionName string, rsType string, clusterName string) (*cres.ClusterInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetClusterOwnerVPC added in v0.6.13

func GetClusterOwnerVPC(connectionName string, cspID string) (owerVPC cres.IID, err error)

func GetDisk added in v0.6.7

func GetDisk(connectionName string, rsType string, nameID string) (*cres.DiskInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetDriverCapabilityInfo added in v0.10.3

func GetDriverCapabilityInfo(connectionName string) (ifs.DriverCapabilityInfo, error)

================ DriverCapabilityInfo Handler

func GetFileSystem added in v0.10.8

func GetFileSystem(connectionName string, nameID string) (*cres.FileSystemInfo, error)

func GetID_MGMT added in v0.8.15

func GetID_MGMT(thisMode string) string

func GetImage

func GetImage(connectionName string, rsType string, nameID string) (*cres.ImageInfo, error)

func GetKey

func GetKey(connectionName string, rsType string, nameID string) (*cres.KeyPairInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetMyImage added in v0.6.10

func GetMyImage(connectionName string, rsType string, nameID string) (*cres.MyImageInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetNLB added in v0.5.10

func GetNLB(connectionName string, rsType string, nameID string) (*cres.NLBInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetNLBOwnerVPC added in v0.5.10

func GetNLBOwnerVPC(connectionName string, cspID string) (owerVPC cres.IID, err error)

func GetOrgVMSpec

func GetOrgVMSpec(connectionName string, nameID string) (string, error)

func GetPriceInfo added in v0.8.2

func GetPriceInfo(connectionName string, productFamily string, regionName string, filterList []cres.KeyValue, simpleVMSpecInfo bool) (string, error)

func GetRegionZone added in v0.7.6

func GetRegionZone(connectionName string, nameID string) (*cres.RegionZoneInfo, error)

func GetRegionZonePreConfig added in v0.8.5

func GetRegionZonePreConfig(driverName string, credentialName string, nameID string) (*cres.RegionZoneInfo, error)

func GetS3Bucket added in v0.10.8

func GetS3Bucket(connectionName, bucketName string) (*minio.BucketInfo, error)

func GetS3BucketCORS added in v0.11.0

func GetS3BucketCORS(connectionName string, bucketName string) (*cors.Config, error)

func GetS3BucketRegionInfo added in v0.11.6

func GetS3BucketRegionInfo(connectionName, bucketName string) (string, error)

func GetS3BucketTotalSize added in v0.12.5

func GetS3BucketTotalSize(connectionName, bucketName string) (int64, int64, error)

func GetS3ObjectInfo added in v0.10.8

func GetS3ObjectInfo(connectionName, bucketName, objectName string) (*minio.ObjectInfo, error)

func GetS3ObjectInfoWithVersion added in v0.11.0

func GetS3ObjectInfoWithVersion(connectionName, bucketName, objectName, versionId string) (*minio.ObjectInfo, error)

func GetS3ObjectStream added in v0.10.8

func GetS3ObjectStream(connectionName, bucketName, objectName string) (io.ReadCloser, error)

func GetS3ObjectStreamWithVersion added in v0.11.0

func GetS3ObjectStreamWithVersion(connectionName, bucketName, objectName, versionId string) (io.ReadCloser, error)

func GetS3PresignedURL added in v0.10.8

func GetS3PresignedURL(connectionName string, bucketName string, objectName string, method string, expiresSeconds int64, responseContentDisposition string) (string, error)

func GetSGOwnerVPC added in v0.5.5

func GetSGOwnerVPC(connectionName string, cspID string) (owerVPC cres.IID, err error)

func GetSecurity

func GetSecurity(connectionName string, rsType string, nameID string) (*cres.SecurityInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetSubnet added in v0.9.5

func GetSubnet(connectionName string, vpcName string, nameID string) (*cres.SubnetInfo, error)

(1) get spiderIID(NameId) (2) get resource(driverIID) (3) set ResourceInfo(userIID)

func GetTag added in v0.9.2

func GetTag(connectionName string, resType cres.RSType, resName string, key string) (cres.KeyValue, error)

GetTag gets a specific tag of a resource.

func GetVM

func GetVM(connectionName string, rsType string, nameID string) (*cres.VMInfo, error)

(1) get IID(NameId) (2) get resource(SystemId) (3) set ResourceInfo(IID.NameId)

func GetVMGroupHealthInfo added in v0.5.10

func GetVMGroupHealthInfo(connectionName string, nlbName string) (*cres.HealthInfo, error)

(1) check exist(NameID) (2) Get HealthInfo (3) Get NLBInfo (4) Set ResoureInfo

func GetVMSpec

func GetVMSpec(connectionName string, nameID string) (*cres.VMSpecInfo, error)

func GetVMStatus

func GetVMStatus(connectionName string, rsType string, nameID string) (cres.VMStatus, error)

(1) get IID(NameId) (2) get CSP:VMStatus(SystemId)

func GetVPC

func GetVPC(connectionName string, rsType string, nameID string) (*cres.VPCInfo, error)

(1) get spiderIID(NameId) (2) get resource(driverIID) (3) set ResourceInfo(userIID)

func GetVersioning added in v0.11.0

func GetVersioning(connectionName string, bucketName string) (string, error)

func InitiateMultipartUpload added in v0.11.0

func InitiateMultipartUpload(connectionName string, bucketName string, objectName string) (string, error)

func ListAccessSubnet added in v0.10.8

func ListAccessSubnet(connectionName string, nameID string) ([]cres.IID, error)

func ListCluster added in v0.6.13

func ListCluster(connectionName string, rsType string) ([]*cres.ClusterInfo, error)

(1) get IID:list (2) get ClusterInfo:list (3) set userIID, and ...

func ListDisk added in v0.6.7

func ListDisk(connectionName string, rsType string) ([]*cres.DiskInfo, error)

(1) get IID:list (2) get DiskInfo:list (3) set userIID, and ...

func ListFileSystem added in v0.10.8

func ListFileSystem(connectionName string) ([]*cres.FileSystemInfo, error)

func ListImage

func ListImage(connectionName string, rsType string) ([]*cres.ImageInfo, error)

func ListKey

func ListKey(connectionName string, rsType string) ([]*cres.KeyPairInfo, error)

(1) get IID:list (2) get KeyInfo:list

func ListMyImage added in v0.6.10

func ListMyImage(connectionName string, rsType string) ([]*cres.MyImageInfo, error)

(1) get IID:list (2) get MyImageInfo:list (3) set userIID, and ...

func ListNLB added in v0.5.10

func ListNLB(connectionName string, rsType string) ([]*cres.NLBInfo, error)

(1) get IID:list (2) get NLBInfo:list (3) set userIID, and ...

func ListOrgRegion added in v0.7.6

func ListOrgRegion(connectionName string) (string, error)

func ListOrgRegionPreConfig added in v0.8.5

func ListOrgRegionPreConfig(driverName string, credentialName string) (string, error)

func ListOrgVMSpec

func ListOrgVMSpec(connectionName string) (string, error)

func ListOrgZone added in v0.7.6

func ListOrgZone(connectionName string) (string, error)

func ListProductFamily added in v0.8.2

func ListProductFamily(connectionName string, regionName string) ([]string, error)

================ PriceInfo Handler

func ListRegionZone added in v0.7.6

func ListRegionZone(connectionName string) ([]*cres.RegionZoneInfo, error)

================ RegionZone Handler

func ListRegionZonePreConfig added in v0.8.5

func ListRegionZonePreConfig(driverName string, credentialName string) ([]*cres.RegionZoneInfo, error)

func ListResourceName added in v0.8.20

func ListResourceName(connectionName, rsType string) ([]string, error)

ListResourceName lists resource names by connectionName and rsType

func ListS3Buckets added in v0.10.8

func ListS3Buckets(connectionName string) ([]*minio.BucketInfo, error)

func ListS3ObjectVersions added in v0.10.8

func ListS3ObjectVersions(connectionName string, bucketName string, prefix string) ([]minio.ObjectInfo, error)

func ListS3Objects added in v0.10.8

func ListS3Objects(connectionName, bucketName, prefix string) ([]minio.ObjectInfo, error)

func ListSecurity

func ListSecurity(connectionName string, rsType string) ([]*cres.SecurityInfo, error)

(1) get IID:list (2) get SecurityInfo:list (3) set userIID, and ...

func ListTag added in v0.9.2

func ListTag(connectionName string, resType cres.RSType, resName string) ([]cres.KeyValue, error)

ListTag lists all tags of a resource.

func ListVM

func ListVM(connectionName string, rsType string) ([]*cres.VMInfo, error)

(1) get IID:list (2) get VMInfo:list

func ListVMSpec

func ListVMSpec(connectionName string) ([]*cres.VMSpecInfo, error)

================ VMSpec Handler

func ListVMStatus

func ListVMStatus(connectionName string, rsType string) ([]*cres.VMStatusInfo, error)

(1) get IID:list (2) get VMStatusInfo:list

func ListVPC

func ListVPC(connectionName string, rsType string) ([]*cres.VPCInfo, error)

(1) get IID:list (2) get VPCInfo:list (3) set userIID, and...

func ListVpcSecurity added in v0.10.2

func ListVpcSecurity(connectionName, rsType, vpcName string) ([]*cres.SecurityInfo, error)

(1) get IID of Security Group for typical VPC:list (2) get SecurityInfo:list (3) set userIID, and ...

func LoadConfigFileYAML added in v0.8.18

func LoadConfigFileYAML(configFilePath string) (string, error)

loading config file with yaml format

func NewS3Client added in v0.10.8

func NewS3Client(connInfo *S3ConnectionInfo) (*minio.Client, error)

func NewS3ClientForBucketCreation added in v0.12.1

func NewS3ClientForBucketCreation(connInfo *S3ConnectionInfo) (*minio.Client, error)

NewS3ClientForBucketCreation creates a client for bucket creation For Tencent, uses path-style (non virtual-hosted-style) to avoid DNS issues

func PutS3ObjectFromReader added in v0.11.0

func PutS3ObjectFromReader(connectionName string, bucketName string, objectName string, reader io.Reader, objectSize int64) (minio.UploadInfo, error)

func RSTypeString added in v0.8.20

func RSTypeString(rsType string) string

func RegisterCluster added in v0.6.13

func RegisterCluster(connectionName string, vpcUserID string, userIID cres.IID) (*cres.ClusterInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (0) check VPC existence(VPC UserID) (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterDisk added in v0.6.7

func RegisterDisk(connectionName string, zoneId string, userIID cres.IID) (*cres.DiskInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterKey added in v0.4.12

func RegisterKey(connectionName string, userIID cres.IID) (*cres.KeyPairInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterMyImage added in v0.6.10

func RegisterMyImage(connectionName string, userIID cres.IID) (*cres.MyImageInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterNLB added in v0.5.10

func RegisterNLB(connectionName string, vpcUserID string, userIID cres.IID) (*cres.NLBInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (0) check VPC existence(VPC UserID) (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterSecurity added in v0.4.12

func RegisterSecurity(connectionName string, vpcUserID string, userIID cres.IID) (*cres.SecurityInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (0) check VPC existence(VPC UserID) (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterSubnet added in v0.7.6

func RegisterSubnet(connectionName string, zoneId string, vpcName string, userIID cres.IID) (*cres.VPCInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterVM added in v0.4.12

func RegisterVM(connectionName string, userIID cres.IID) (*cres.VMInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RegisterVPC added in v0.4.12

func RegisterVPC(connectionName string, userIID cres.IID) (*cres.VPCInfo, error)

UserIID{UserID, CSP-ID} => SpiderIID{UserID, SP-XID:CSP-ID} (1) check existence(UserID) (2) get resource info(CSP-ID) (3) create spiderIID: {UserID, SP-XID:CSP-ID} (4) insert spiderIID

func RemoveAccessSubnet added in v0.10.8

func RemoveAccessSubnet(connectionName string, nameID string, subnetIID cres.IID) (bool, error)

func RemoveCSPNodeGroup added in v0.6.14

func RemoveCSPNodeGroup(connectionName string, clusterName string, systemID string) (bool, error)

func RemoveCSPSubnet added in v0.4.11

func RemoveCSPSubnet(connectionName string, vpcName string, systemID string) (bool, error)

remove CSP's Subnet(SystemId)

func RemoveNLBVMs added in v0.5.11

func RemoveNLBVMs(connectionName string, nlbName string, vmNames []string) (bool, error)

(1) check exist(NameID) (2) remove VMs

func RemoveNodeGroup added in v0.6.13

func RemoveNodeGroup(connectionName string, clusterName string, nodeGroupName string, force string) (bool, error)

func RemoveRules added in v0.5.4

func RemoveRules(connectionName string, sgName string, reqRuleInfoList []cres.SecurityRuleInfo) (bool, error)

(1) check exist(NameID) (2) remove Rules

func RemoveSubnet added in v0.4.11

func RemoveSubnet(connectionName string, vpcName string, nameID string, force string) (bool, error)

(1) get spiderIID (2) delete Resource(SystemId) (3) delete IID

func RemoveTag added in v0.9.2

func RemoveTag(connectionName string, resType cres.RSType, resName string, key string) (bool, error)

RemoveTag removes a specific tag from a resource.

func SetNodeGroupAutoScaling added in v0.6.13

func SetNodeGroupAutoScaling(connectionName string, clusterName string, nodeGroupName string, on bool) (bool, error)

func SetS3BucketCORS added in v0.11.0

func SetS3BucketCORS(connectionName string, bucketName string, allowedOrigins []string, allowedMethods []string, allowedHeaders []string, exposeHeaders []string, maxAgeSeconds int) (bool, error)

func SnapshotVM added in v0.6.10

func SnapshotVM(connectionName string, rsType string, reqInfo cres.MyImageInfo, IDTransformMode string) (*cres.MyImageInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) create Resource (4) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (5) insert spiderIID (6) create userIID

func SpiderletAnyCall added in v0.9.8

func SpiderletAnyCall(connectionName string, reqInfo cres.AnyCallInfo) (*cres.AnyCallInfo, error)

// for Spiderlet

func StartVM

func StartVM(connectionName string, rsType string, reqInfo cres.VMReqInfo, IDTransformMode string) (*cres.VMInfo, error)

(1) check exist(NameID) (2) generate SP-XID and create reqIID, driverIID (3) clone the reqInfo with DriverIID (4) create Resource (5) create spiderIID: {reqNameID, "driverNameID:driverSystemID"} (6) insert spiderIID (7) create userIID

func SuspendVersioning added in v0.10.8

func SuspendVersioning(connectionName string, bucketName string) (bool, error)

func UnregisterResource added in v0.4.12

func UnregisterResource(connectionName string, rsType string, nameId string) (bool, error)

UnregisterResource API does not delete the real resource. This API just unregister the resource from Spider. (1) check exist(NameID) (2) delete SpiderIID

func UnregisterSubnet added in v0.7.6

func UnregisterSubnet(connectionName string, vpcName string, nameId string) (bool, error)

func UpdateRegionZoneDisplayNames added in v0.10.1

func UpdateRegionZoneDisplayNames(csp string, infoList []*cres.RegionZoneInfo) ([]*cres.RegionZoneInfo, error)

func UpgradeCluster added in v0.6.14

func UpgradeCluster(connectionName string, clusterName string, newVersion string) (cres.ClusterInfo, error)

func UploadPart added in v0.11.0

func UploadPart(connectionName string, bucketName string, objectName string, uploadID string, partNumber int, reader io.Reader, size int64) (string, error)

func ValidateStruct added in v0.4.15

func ValidateStruct(is interface{}, emptyPermissionList []string) error

Types

type AllResourceInfoList added in v0.10.2

type AllResourceInfoList struct {
	ResourceType cres.RSType `json:"ResourceType"`
	AllListInfo  struct {
		MappedInfoList  []interface{} `json:"MappedInfoList"`
		OnlySpiderList  []*cres.IID   `json:"OnlySpiderList"`
		OnlyCSPInfoList []interface{} `json:"OnlyCSPInfoList"`
	}
}

func ListAllResourceInfo added in v0.10.2

func ListAllResourceInfo(connectionName string, rsType cres.RSType) (AllResourceInfoList, error)

type AllResourceList

type AllResourceList struct {
	AllList struct {
		MappedList     []*cres.IID `json:"MappedList"`
		OnlySpiderList []*cres.IID `json:"OnlySpiderList"`
		OnlyCSPList    []*cres.IID `json:"OnlyCSPList"`
	}
}

func ListAllResource

func ListAllResource(connectionName string, rsType string) (AllResourceList, error)

list all Resources for management (1) get IID:list (2) get CSP:list (3) filtering CSP-list by IID-list (4) make MappedList, OnlySpiderList, OnlyCSPList

type CapabilityType added in v0.10.3

type CapabilityType string
const (
	PRICE_INFO      CapabilityType = "PriceInfo"
	CLUSTER_HANDLER CapabilityType = "ClusterHandler"
	TAG_HANDLER     CapabilityType = "TagHandler"

	ZONE_BASED_CONTROL CapabilityType = "Zone-based Control"
)

type ClusterDependentIIDInfo added in v0.7.6

type ClusterDependentIIDInfo struct {
	ConnectionName   string `gorm:"primaryKey"` // ex) "aws-seoul-config"
	NameId           string `gorm:"primaryKey"` // ex) "my_resource"
	SystemId         string // ID in CSP, ex) "i7baab81a4ez"
	OwnerClusterName string `gorm:"primaryKey"` // ex) "my_cluster"' for NodeGroup
}

type ClusterIIDInfo added in v0.7.6

type ClusterIIDInfo VPCDependentIIDInfo

==================================================================== type for GORM

func (ClusterIIDInfo) TableName added in v0.7.6

func (ClusterIIDInfo) TableName() string

type CompletePart added in v0.11.0

type CompletePart struct {
	PartNumber int
	ETag       string
}

type DeleteResult added in v0.11.0

type DeleteResult struct {
	Key     string
	Success bool
	Error   string
}

func DeleteMultipleObjectVersions added in v0.11.0

func DeleteMultipleObjectVersions(connectionName, bucketName string, objects []ObjectVersionToDelete) ([]DeleteResult, error)

DeleteMultipleObjectVersions deletes multiple object versions

func DeleteMultipleObjects added in v0.11.0

func DeleteMultipleObjects(connectionName string, bucketName string, objectNames []string) ([]DeleteResult, error)

type DeletedResourceInfoList added in v0.8.20

type DeletedResourceInfoList struct {
	ResourceType          string               `json:"ResourceType" validate:"required" example:"VPC"`  // Resource type
	IsAllDeleted          bool                 `json:"IsAllDeleted" validate:"required" example:"true"` // true: all deleted, false: some remained
	DeletedIIDList        []*cres.IID          `json:"DeletedIIDList" validate:"required"`              // List of deleted resource IDs
	RemainedErrorInfoList []*RemainedErrorInfo `json:"RemainedErrorInfoList" validate:"required"`       // List of resources that failed to delete
}

DeletedResourceInfoList represents information about deleted resources by type

type DestroyedInfo added in v0.8.20

type DestroyedInfo struct {
	IsAllDestroyed bool                       `json:"IsAllDestroyed" validate:"required" example:"true"` // true: all destroyed, false: some remained
	DestroyedList  []*DeletedResourceInfoList `json:"DeletedAllListByResourceType" validate:"required"`  // List of resources deleted by type
}

DestroyedInfo represents the status of resource destruction in a connection

func Destroy added in v0.8.20

func Destroy(connectionName string) (DestroyedInfo, error)

Destroy all Resources in a Connection

type DiskIIDInfo added in v0.7.6

type DiskIIDInfo ZoneLevelIIDInfo

func (DiskIIDInfo) TableName added in v0.7.6

func (DiskIIDInfo) TableName() string

type DiskPartitionInfo added in v0.10.4

type DiskPartitionInfo struct {
	MountPoint string
	TotalSpace string
}

DiskPartitionInfo contains information about a disk partition

type FileSystemIIDInfo added in v0.10.8

type FileSystemIIDInfo struct {
	ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
	ZoneId         string // ex) "ap-southeast-2a"
	NameId         string `gorm:"primaryKey"` // ex) "my_filesystem"
	SystemId       string // ID in CSP, ex) "fs-12345678"
	OwnerVPCName   string // ex) "my_vpc" - NOT primaryKey
}

func (FileSystemIIDInfo) TableName added in v0.10.8

func (FileSystemIIDInfo) TableName() string

type FirstIIDInfo added in v0.7.6

type FirstIIDInfo struct {
	ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
	NameId         string `gorm:"primaryKey"` // ex) "my_resource"
	SystemId       string // ID in CSP, ex) "i7baab81a4ez"
}

type Initiator added in v0.11.6

type Initiator struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

type KeyIIDInfo added in v0.7.6

type KeyIIDInfo FirstIIDInfo

func (KeyIIDInfo) TableName added in v0.7.6

func (KeyIIDInfo) TableName() string

type ListMultipartUploadsResult added in v0.11.6

type ListMultipartUploadsResult struct {
	Bucket             string                `xml:"Bucket"`
	KeyMarker          string                `xml:"KeyMarker"`
	UploadIDMarker     string                `xml:"UploadIdMarker"`
	NextKeyMarker      string                `xml:"NextKeyMarker"`
	NextUploadIDMarker string                `xml:"NextUploadIdMarker"`
	MaxUploads         int                   `xml:"MaxUploads"`
	IsTruncated        bool                  `xml:"IsTruncated"`
	Uploads            []MultipartUploadInfo `xml:"Upload"`
	Prefix             string                `xml:"Prefix"`
	Delimiter          string                `xml:"Delimiter"`
}

func ListMultipartUploads added in v0.11.6

func ListMultipartUploads(connectionName string, bucketName string, prefix string, keyMarker string, uploadIDMarker string, delimiter string, maxUploads int) (*ListMultipartUploadsResult, error)

type ListPartsResult added in v0.11.6

type ListPartsResult struct {
	Bucket               string     `xml:"Bucket"`
	Key                  string     `xml:"Key"`
	UploadID             string     `xml:"UploadId"`
	PartNumberMarker     int        `xml:"PartNumberMarker"`
	NextPartNumberMarker int        `xml:"NextPartNumberMarker"`
	MaxParts             int        `xml:"MaxParts"`
	IsTruncated          bool       `xml:"IsTruncated"`
	Parts                []PartInfo `xml:"Part"`
	Initiator            Initiator  `xml:"Initiator"`
	Owner                Owner      `xml:"Owner"`
	StorageClass         string     `xml:"StorageClass"`
}

func ListParts added in v0.11.6

func ListParts(connectionName string, bucketName string, objectName string, uploadID string, partNumberMarker int, maxParts int) (*ListPartsResult, error)

type MultipartUploadInfo added in v0.11.6

type MultipartUploadInfo struct {
	Key          string    `xml:"Key"`
	UploadID     string    `xml:"UploadId"`
	Initiated    time.Time `xml:"Initiated"`
	StorageClass string    `xml:"StorageClass"`
	Initiator    Initiator `xml:"Initiator"`
	Owner        Owner     `xml:"Owner"`
}

type MyImageIIDInfo added in v0.7.6

type MyImageIIDInfo FirstIIDInfo

func (MyImageIIDInfo) TableName added in v0.7.6

func (MyImageIIDInfo) TableName() string

type NLBIIDInfo added in v0.7.6

type NLBIIDInfo VPCDependentIIDInfo

func (NLBIIDInfo) TableName added in v0.7.6

func (NLBIIDInfo) TableName() string

type NodeGroupIIDInfo added in v0.7.6

type NodeGroupIIDInfo ClusterDependentIIDInfo

func (NodeGroupIIDInfo) TableName added in v0.7.6

func (NodeGroupIIDInfo) TableName() string

type ObjectVersionToDelete added in v0.11.0

type ObjectVersionToDelete struct {
	Key       string
	VersionID string
}

Helper struct for versioned delete operations

type Owner added in v0.11.6

type Owner struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

type PartInfo added in v0.11.6

type PartInfo struct {
	PartNumber   int       `xml:"PartNumber"`
	LastModified time.Time `xml:"LastModified"`
	ETag         string    `xml:"ETag"`
	Size         int64     `xml:"Size"`
}

type RemainedErrorInfo added in v0.8.20

type RemainedErrorInfo struct {
	Name     string `json:"Name" validate:"required" example:"vpc-01"`           // Resource name that failed to delete
	ErrorMsg string `json:"ErrorMsg" validate:"required" example:"delete error"` // Error message for the failed resource
}

RemainedErrorInfo provides details of resources that failed to delete

type ResourceUsage added in v0.10.4

type ResourceUsage struct {
	// System information
	SystemCPUPercent     string            // Total CPU usage with % format
	SystemCPUCorePercent map[string]string // Per-core CPU usage percentages with core number as key
	SystemMemoryUsed     string            // GiB format
	SystemMemoryTotal    string            // GiB format
	SystemMemoryPercent  string            // % format
	SystemDiskRead       string
	SystemDiskWrite      string
	SystemNetSent        string
	SystemNetReceived    string

	// Process information
	ProcessName           string
	ProcessCPUPercent     string            // Total process CPU usage with % format
	ProcessCPUCorePercent map[string]string // Per-core process CPU usage percentages with core number as key
	ProcessMemoryUsed     string            // GiB format
	ProcessMemoryPercent  string            // % format
	ProcessDiskRead       string
	ProcessDiskWrite      string
	ProcessNetSent        string
	ProcessNetReceived    string
}

ResourceUsage contains system resource usage information

func FetchResourceUsage added in v0.10.4

func FetchResourceUsage() (ResourceUsage, error)

FetchResourceUsage collects and returns resource usage information

type ResultVMInfo added in v0.5.9

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

type ResultVPCInfo added in v0.5.9

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

type S3BucketIIDInfo added in v0.10.8

type S3BucketIIDInfo struct {
	ConnectionName string `gorm:"primaryKey"`
	NameId         string `gorm:"primaryKey"`
	SystemId       string
	Region         string
}

func (S3BucketIIDInfo) TableName added in v0.10.8

func (S3BucketIIDInfo) TableName() string

type S3ConnectionInfo added in v0.10.8

type S3ConnectionInfo struct {
	Endpoint       string
	AccessKey      string
	SecretKey      string
	UseSSL         bool
	RegionRequired bool
	Region         string
	ProviderName   string
	AppId          string // Tencent COS AppId
}

func GetS3ConnectionInfo added in v0.10.8

func GetS3ConnectionInfo(connectionName string) (*S3ConnectionInfo, error)

type SGIIDInfo added in v0.7.6

type SGIIDInfo VPCDependentIIDInfo

func (SGIIDInfo) TableName added in v0.7.6

func (SGIIDInfo) TableName() string

type SubnetIIDInfo added in v0.7.6

type SubnetIIDInfo ZoneLevelVPCDependentIIDInfo

func (SubnetIIDInfo) TableName added in v0.7.6

func (SubnetIIDInfo) TableName() string

type SubnetReqZoneInfo added in v0.8.19

type SubnetReqZoneInfo struct {
	IId  cres.IID
	Zone string
}

type SystemInfo added in v0.10.4

type SystemInfo struct {
	Hostname        string
	Platform        string
	PlatformVersion string
	KernelArch      string
	KernelVersion   string
	Uptime          string

	CPUModel      string
	PhysicalCores int
	LogicalCores  int
	ClockSpeed    string

	TotalMemory string
	SwapMemory  string

	DiskPartitions []DiskPartitionInfo
}

SystemInfo contains all system information

func FetchSystemInfo added in v0.10.4

func FetchSystemInfo() (SystemInfo, error)

FetchSystemInfo collects and returns system information

type VMIIDInfo added in v0.7.6

type VMIIDInfo ZoneLevelIIDInfo

func (VMIIDInfo) TableName added in v0.7.6

func (VMIIDInfo) TableName() string

type VMUsingResources added in v0.5.5

type VMUsingResources struct {
	Resources struct {
		VPC    *cres.IID   `json:"VPC"`
		SGList []*cres.IID `json:"SGList"`
		VMKey  *cres.IID   `json:"VMKey"`
	}
}

func GetVMUsingRS added in v0.5.5

func GetVMUsingRS(connectionName string, cspID string) (VMUsingResources, error)

type VPCDependentIIDInfo added in v0.7.6

type VPCDependentIIDInfo struct {
	ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
	NameId         string `gorm:"primaryKey"` // ex) "my_resource"
	SystemId       string // ID in CSP, ex) "i7baab81a4ez"
	OwnerVPCName   string `gorm:"primaryKey"` // ex) "my_vpc" for NLB
}

type VPCIIDInfo added in v0.7.6

type VPCIIDInfo FirstIIDInfo

==================================================================== type for GORM

func (VPCIIDInfo) TableName added in v0.7.6

func (VPCIIDInfo) TableName() string

type WAITER added in v0.5.11

type WAITER struct {
	Sleep   int // sec, default = 1
	Timeout int // sec, default = 120
	// contains filtered or unexported fields
}

============================================

func NewWaiter added in v0.5.11

func NewWaiter(sleep int, timeout int) *WAITER

func (*WAITER) Wait added in v0.5.11

func (waiter *WAITER) Wait() bool

type ZoneLevelIIDInfo added in v0.8.11

type ZoneLevelIIDInfo struct {
	ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
	ZoneId         string // ex) "ap-northeast-2a"
	NameId         string `gorm:"primaryKey"` // ex) "my_resource"
	SystemId       string // ID in CSP, ex) "i7baab81a4ez"
}

type ZoneLevelVPCDependentIIDInfo added in v0.8.19

type ZoneLevelVPCDependentIIDInfo struct {
	ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
	ZoneId         string // ex) "ap-northeast-2a"
	NameId         string `gorm:"primaryKey"` // ex) "my_resource"
	SystemId       string // ID in CSP, ex) "i7baab81a4ez"
	OwnerVPCName   string `gorm:"primaryKey"` // ex) "my_vpc" for NLB
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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