resource

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Package resource is to manage multi-cloud infra resource

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddK8sNodeGroup

func AddK8sNodeGroup(nsId string, k8sClusterId string, u *model.TbK8sNodeGroupReq) (*model.TbK8sClusterInfo, error)

AddK8sNodeGroup adds a K8sNodeGroup

func ChangeK8sNodeGroupAutoscaleSize

func ChangeK8sNodeGroupAutoscaleSize(nsId string, k8sClusterId string, k8sNodeGroupName string, u *model.TbChangeK8sNodeGroupAutoscaleSizeReq) (*model.TbChangeK8sNodeGroupAutoscaleSizeRes, error)

ChangeK8sNodeGroupAutoscaleSize change NodeGroup's Autoscaling Size

func CheckChildResource

func CheckChildResource(nsId string, resourceType string, parentResourceId string, resourceId string) (bool, error)

CheckChildResource returns the existence of the TB Resource resource in bool form.

func CheckK8sCluster

func CheckK8sCluster(nsId string, k8sClusterId string) (bool, error)

CheckK8sCluster returns the existence of the TB K8sCluster object in bool form.

func CheckResource

func CheckResource(nsId string, resourceType string, resourceId string) (bool, error)

CheckResource returns the existence of the TB Resource resource in bool form.

func ContainsZone added in v0.9.9

func ContainsZone(zones []string, zone string) bool

func ConvertSpiderImageToTumblebugImage

func ConvertSpiderImageToTumblebugImage(spiderImage model.SpiderImageInfo) (model.TbImageInfo, error)

ConvertSpiderImageToTumblebugImage accepts an Spider image object, converts to and returns an TB image object

func ConvertSpiderMyImageToTumblebugCustomImage

func ConvertSpiderMyImageToTumblebugCustomImage(spiderMyImage model.SpiderMyImageInfo) (model.TbCustomImageInfo, error)

ConvertSpiderMyImageToTumblebugCustomImage accepts an Spider MyImage object, converts to and returns an TB customImage object

func ConvertSpiderSpecToTumblebugSpec

func ConvertSpiderSpecToTumblebugSpec(spiderSpec model.SpiderSpecInfo) (model.TbSpecInfo, error)

ConvertSpiderSpecToTumblebugSpec accepts an Spider spec object, converts to and returns an TB spec object

func CreateDataDisk

func CreateDataDisk(nsId string, u *model.TbDataDiskReq, option string) (model.TbDataDiskInfo, error)

CreateDataDisk accepts DataDisk creation request, creates and returns an TB dataDisk object

func CreateFirewallRules

func CreateFirewallRules(nsId string, securityGroupId string, req []model.TbFirewallRuleInfo, objectOnly bool) (model.TbSecurityGroupInfo, error)

CreateFirewallRules accepts firewallRule creation request, creates and returns an TB securityGroup object

func CreateK8sCluster

func CreateK8sCluster(nsId string, req *model.TbK8sClusterReq, option string) (*model.TbK8sClusterInfo, error)

CreateK8sCluster create a k8s cluster

func CreateObjectStorage added in v0.10.2

func CreateObjectStorage(nsId string, objectStorageReq *model.RestPostObjectStorageRequest, retry string) (model.ObjectStorageInfo, error)

CreateObjectStorage creates a SQL database via Terrarium

func CreateSecurityGroup

func CreateSecurityGroup(nsId string, u *model.TbSecurityGroupReq, option string) (model.TbSecurityGroupInfo, error)

CreateSecurityGroup accepts SG creation request, creates and returns an TB SG object

func CreateSharedResource added in v0.9.10

func CreateSharedResource(nsId string, resType string, connectionName string) error

CreateSharedResource is to register default resource from asset files (../assets/*.csv)

func CreateSiteToSiteVPN added in v0.9.22

func CreateSiteToSiteVPN(nsId string, mciId string, vpnReq *model.RestPostVpnRequest, retry string) (model.VPNInfo, error)

CreateSiteToSiteVPN creates a site-to-site VPN via Terrarium

func CreateSqlDB added in v0.10.2

func CreateSqlDB(nsId string, sqlDbReq *model.RestPostSqlDBRequest, retry string) (model.SqlDBInfo, error)

CreateSqlDB creates a SQL database via Terrarium

func CreateSshKey

func CreateSshKey(nsId string, u *model.TbSshKeyReq, option string) (model.TbSshKeyInfo, error)

CreateSshKey accepts SSH key creation request, creates and returns an TB sshKey object

func CreateSubnet

func CreateSubnet(nsId string, vNetId string, subnetReq *model.TbSubnetReq) (model.TbSubnetInfo, error)

CreateSubnet creates and returns the vNet object

func CreateVNet

func CreateVNet(nsId string, vNetReq *model.TbVNetReq) (model.TbVNetInfo, error)

CreateVNet accepts vNet creation request, creates and returns an TB vNet object

func DelAllResources

func DelAllResources(nsId string, resourceType string, subString string, forceFlag string) (model.IdList, error)

DelAllResources deletes all TB Resource objects of the given resourceType.

func DelAllSharedResources

func DelAllSharedResources(nsId string) (model.IdList, error)

DelAllSharedResources deletes all Default securityGroup, sshKey, vNet objects

func DelEleInSlice

func DelEleInSlice(arr interface{}, index int)

DelEleInSlice delete an element from slice by index

  • arr: the reference of slice
  • index: the index of element will be deleted

func DelResource

func DelResource(nsId string, resourceType string, resourceId string, forceFlag string) error

DelResource deletes the TB Resource object

func DeleteAllK8sCluster

func DeleteAllK8sCluster(nsId, subString, option string) (*model.IdList, error)

DeleteAllK8sCluster deletes all clusters

func DeleteFirewallRules

func DeleteFirewallRules(nsId string, securityGroupId string, req []model.TbFirewallRuleInfo) (model.TbSecurityGroupInfo, error)

DeleteFirewallRules accepts firewallRule creation request, creates and returns an TB securityGroup object

func DeleteK8sCluster

func DeleteK8sCluster(nsId, k8sClusterId, option string) (bool, error)

DeleteK8sCluster deletes a k8s cluster

func DeleteObjectStorage added in v0.10.2

func DeleteObjectStorage(nsId string, objectStorageId string) (model.SimpleMsg, error)

DeleteObjectStorage deletes a SQL database via Terrarium

func DeleteSiteToSiteVPN added in v0.9.22

func DeleteSiteToSiteVPN(nsId string, mciId string, vpnId string) (model.SimpleMsg, error)

DeleteSiteToSiteVPN deletes a site-to-site VPN via Terrarium

func DeleteSqlDB added in v0.10.2

func DeleteSqlDB(nsId string, sqlDbId string) (model.SimpleMsg, error)

DeleteSqlDB deletes a SQL database via Terrarium

func DeleteSubnet added in v0.9.9

func DeleteSubnet(nsId string, vNetId string, subnetId string, actionParam string) (model.SimpleMsg, error)

DeleteSubnet deletes and returns the result

func DeleteVNet added in v0.9.9

func DeleteVNet(nsId string, vNetId string, actionParam string) (model.SimpleMsg, error)

DeleteVNet accepts vNet creation request, creates and returns an TB vNet object

func DeregisterSubnet added in v0.9.9

func DeregisterSubnet(nsId string, vNetId string, subnetId string) (model.SimpleMsg, error)

DeregisterSubnet deregister subnet and returns the result

func DeregisterVNet added in v0.9.9

func DeregisterVNet(nsId string, vNetId string, withSubnets string) (model.SimpleMsg, error)

DeregisterVNet accepts vNet unregistration request, deregister and returns the result

func DesignVNets added in v0.9.10

DesignVNets accepts a VNet design request, designs and returns a VNet design response

func FetchImagesForAllConnConfigs

func FetchImagesForAllConnConfigs(nsId string) (connConfigCount uint, imageCount uint, err error)

FetchImagesForAllConnConfigs gets all conn configs from Spider, lookups all images for each region of conn config, and saves into TB image objects

func FetchImagesForConnConfig

func FetchImagesForConnConfig(connConfig string, nsId string) (imageCount uint, err error)

FetchImagesForAllConnConfigs gets all conn configs from Spider, lookups all images for each region of conn config, and saves into TB image objects

func FetchSpecsForAllConnConfigs

func FetchSpecsForAllConnConfigs(nsId string) (connConfigCount uint, specCount uint, err error)

FetchSpecsForAllConnConfigs gets all conn configs from Spider, lookups all specs for each region of conn config, and saves into TB spec objects

func FetchSpecsForConnConfig

func FetchSpecsForConnConfig(connConfigName string, nsId string) (uint, error)

FetchSpecsForConnConfig lookups all specs for region of conn config, and saves into TB spec objects

func FilterSpecsByRange

func FilterSpecsByRange(nsId string, filter model.FilterSpecsByRangeRequest) ([]model.TbSpecInfo, error)

FilterSpecsByRange accepts criteria ranges for filtering, and returns the list of filtered TB spec objects

func GenSpecMapKey

func GenSpecMapKey(region, specName string) string

GenSpecMapKey generates a SpecMap key for storing or accessing data in a map

func GetAllIDsOfSiteToSiteVPN added in v0.9.22

func GetAllIDsOfSiteToSiteVPN(nsId string, mciId string) (model.VpnIdList, error)

GetAllIDsOfSiteToSiteVPN returns a list of site-to-site VPN IDs

func GetAllSiteToSiteVPN added in v0.9.22

func GetAllSiteToSiteVPN(nsId string, mciId string) (model.VpnInfoList, error)

GetSiteToSiteVPN returns a site-to-site VPN

func GetAssociatedObjectCount

func GetAssociatedObjectCount(nsId string, resourceType string, resourceId string) (int, error)

GetAssociatedObjectCount returns the number of Resource's associated Tumblebug objects

func GetAssociatedObjectList

func GetAssociatedObjectList(nsId string, resourceType string, resourceId string) ([]string, error)

GetAssociatedObjectList returns the list of Resource's associated Tumblebug objects

func GetCspResourceName added in v0.9.10

func GetCspResourceName(nsId string, resourceType string, resourceId string) (string, error)

GetCspResourceName is func to retrieve CSP native resource ID

func GetFirstNZones added in v0.9.10

func GetFirstNZones(connectionName string, firstN int) ([]string, int, error)

GetFirstNZones returns the first N zones of the given connection

func GetIdFromStruct

func GetIdFromStruct(u interface{}) (string, error)

GetIdFromStruct accepts any struct for argument, and returns value of the field 'Id'

func GetImage

func GetImage(nsId string, imageKey string) (model.TbImageInfo, error)

GetImage accepts namespace Id and imageKey(Id,CspResourceName,GuestOS,...), and returns the TB image object

func GetImageInfoFromLookupImage added in v0.9.16

func GetImageInfoFromLookupImage(nsId string, u model.TbImageReq) (model.TbImageInfo, error)

GetImageInfoFromLookupImage

func GetK8sCluster

func GetK8sCluster(nsId string, k8sClusterId string) (*model.TbK8sClusterInfo, error)

GetK8sCluster retrives a k8s cluster information

func GetNameFromStruct

func GetNameFromStruct(u interface{}) (string, error)

GetNameFromStruct accepts any struct for argument, and returns value of the field 'Name'

func GetObjectStorage added in v0.10.2

func GetObjectStorage(nsId string, objectStorageId string, detail string) (model.ObjectStorageInfo, error)

GetObjectStorage returns a Object Storage via Terrarium

func GetProviderRegionZoneResourceKey

func GetProviderRegionZoneResourceKey(providerName, regionName, zoneName, resourceName string) string

GenResourceKey generates a Resource key for concatenating providerName, regionName, zoneName, resourceName

func GetRequestStatusOfObjectStorage added in v0.10.2

func GetRequestStatusOfObjectStorage(nsId string, objectStorageId string, reqId string) (model.Response, error)

GetRequestStatusOfObjectStorage checks the status of a specific request

func GetRequestStatusOfSiteToSiteVpn added in v0.9.22

func GetRequestStatusOfSiteToSiteVpn(nsId string, mciId string, vpnId string, reqId string) (model.Response, error)

GetRequestStatusOfSiteToSiteVpn checks the status of a specific request

func GetRequestStatusOfSqlDB added in v0.10.2

func GetRequestStatusOfSqlDB(nsId string, sqlDbId string, reqId string) (model.Response, error)

GetRequestStatusOfSqlDB checks the status of a specific request

func GetResource

func GetResource(nsId string, resourceType string, resourceId string) (interface{}, error)

GetResource returns the requested TB Resource object

func GetSiteToSiteVPN added in v0.9.22

func GetSiteToSiteVPN(nsId string, mciId string, vpnId string, detail string) (model.VPNInfo, error)

GetSiteToSiteVPN returns a site-to-site VPN via Terrarium

func GetSpec

func GetSpec(nsId string, specKey string) (model.TbSpecInfo, error)

GetSpec accepts namespace Id and specKey(Id,CspResourceName,...), and returns the TB spec object

func GetSqlDB added in v0.10.2

func GetSqlDB(nsId string, sqlDbId string, detail string) (model.SqlDBInfo, error)

GetSqlDB returns a SQL DB via Terrarium

func GetSubnet added in v0.9.9

func GetSubnet(nsId string, vNetId string, subnetId string) (model.TbSubnetInfo, error)

GetSubnet

func GetVNet added in v0.9.9

func GetVNet(nsId string, vNetId string) (model.TbVNetInfo, error)

func HandleK8sClusterAction added in v0.10.0

func HandleK8sClusterAction(nsId string, k8sClusterId string, action string) (string, error)

HandleK8sClusterAction is func to handle actions to K8sCluster

func IsValidCspForObjectStorage added in v0.10.2

func IsValidCspForObjectStorage(csp string) (bool, error)

func IsValidCspForSqlDB added in v0.10.1

func IsValidCspForSqlDB(csp string) (bool, error)

func IsValidCspSetForVPN added in v0.10.1

func IsValidCspSetForVPN(csp1, csp2 string) (bool, error)

func ListK8sCluster

func ListK8sCluster(nsId string, filterKey string, filterVal string) (interface{}, error)

ListK8sCluster returns the list of TB K8sCluster objects of given nsId

func ListK8sClusterId

func ListK8sClusterId(nsId string) ([]string, error)

ListK8sClusterId returns the list of TB K8sCluster object IDs of given nsId

func ListResource

func ListResource(nsId string, resourceType string, filterKey string, filterVal string) (interface{}, error)

ListResource returns the list of TB Resource objects of given resourceType

func ListResourceId

func ListResourceId(nsId string, resourceType string) ([]string, error)

ListResourceId returns the list of TB Resource object IDs of given resourceType

func ListSubnet added in v0.9.9

func ListSubnet(nsId string, vNetId string) ([]model.TbSubnetInfo, error)

ListSubnet

func LoadAssets added in v0.9.10

func LoadAssets() (model.IdList, error)

LoadAssets is to register common resources from asset files (../assets/*.csv)

func LookupImage

func LookupImage(connConfig string, imageId string) (model.SpiderImageInfo, error)

LookupImage accepts Spider conn config and CSP image ID, lookups and returns the Spider image object

func LookupImageList

func LookupImageList(connConfigName string) (model.SpiderImageList, error)

LookupImageList accepts Spider conn config, lookups and returns the list of all images in the region of conn config in the form of the list of Spider image objects

func LookupMyImage

func LookupMyImage(connConfig string, myImageId string) (model.SpiderMyImageInfo, error)

LookupMyImage accepts Spider conn config and CSP myImage ID, lookups and returns the Spider image object

func LookupSpec

func LookupSpec(connConfig string, specName string) (model.SpiderSpecInfo, error)

LookupSpec accepts Spider conn config and CSP spec name, lookups and returns the Spider spec object

func LookupSpecList

func LookupSpecList(connConfig string) (model.SpiderSpecList, error)

LookupSpecList accepts Spider conn config, lookups and returns the list of all specs in the region of conn config in the form of the list of Spider spec objects

func RefineSubnet added in v0.9.15

func RefineSubnet(nsId string, vNetId string, subnetId string) (model.SimpleMsg, error)

func RefineVNet added in v0.9.15

func RefineVNet(nsId string, vNetId string) (model.SimpleMsg, error)

func RegisterCustomImageWithId

func RegisterCustomImageWithId(nsId string, u *model.TbCustomImageReq) (model.TbCustomImageInfo, error)

RegisterCustomImageWithId accepts customimage creation request, creates and returns an TB customimage object

func RegisterCustomImageWithInfo

func RegisterCustomImageWithInfo(nsId string, content model.TbCustomImageInfo) (model.TbCustomImageInfo, error)

RegisterCustomImageWithInfo accepts customimage registration request, creates and returns an TB customimage object

func RegisterImageWithId

func RegisterImageWithId(nsId string, u *model.TbImageReq, update bool, RDBonly bool) (model.TbImageInfo, error)

RegisterImageWithId accepts image creation request, creates and returns an TB image object

func RegisterImageWithInfo

func RegisterImageWithInfo(nsId string, content *model.TbImageInfo, update bool) (model.TbImageInfo, error)

RegisterImageWithInfo accepts image creation request, creates and returns an TB image object

func RegisterImageWithInfoInBulk added in v0.9.16

func RegisterImageWithInfoInBulk(imageList []model.TbImageInfo) error

RegisterImageWithInfoInBulk register a list of images in bulk

func RegisterSpecWithCspResourceId added in v0.9.10

func RegisterSpecWithCspResourceId(nsId string, u *model.TbSpecReq, update bool) (model.TbSpecInfo, error)

RegisterSpecWithCspResourceId accepts spec creation request, creates and returns an TB spec object

func RegisterSpecWithInfo

func RegisterSpecWithInfo(nsId string, content *model.TbSpecInfo, update bool) (model.TbSpecInfo, error)

RegisterSpecWithInfo accepts spec creation request, creates and returns an TB spec object

func RegisterSpecWithInfoInBulk added in v0.9.16

func RegisterSpecWithInfoInBulk(specList []model.TbSpecInfo) error

RegisterSpecWithInfoInBulk register a list of specs in bulk

func RegisterSubnet added in v0.9.9

func RegisterSubnet(nsId string, vNetId string, subnetReq *model.TbRegisterSubnetReq) (model.TbSubnetInfo, error)

func RegisterVNet added in v0.9.9

func RegisterVNet(nsId string, vNetRegisterReq *model.TbRegisterVNetReq) (model.TbVNetInfo, error)

RegisterVNet accepts vNet registration request, register and returns an TB vNet object

func RemoteCommandToK8sClusterContainer added in v0.10.4

func RemoteCommandToK8sClusterContainer(nsId string, k8sClusterId string, k8sClusterNamespace string, k8sClusterPodName string, k8sClusterContainerName string, req *model.TbK8sClusterContainerCmdReq) (*model.TbK8sClusterContainerCmdResult, error)

RemoteCommandToK8sClusterContainer is func to command to specified Container in K8sCluster by Kubernetes API

func RemoveDuplicateImagesInSQL added in v0.9.16

func RemoveDuplicateImagesInSQL() error

RemoveDuplicateImagesInSQL is to remove duplicate images in db to refine batch insert duplicates

func RemoveDuplicateSpecsInSQL added in v0.9.16

func RemoveDuplicateSpecsInSQL() error

RemoveDuplicateSpecsInSQL is to remove duplicate specs in db to refine batch insert duplicates

func RemoveK8sNodeGroup

func RemoveK8sNodeGroup(nsId, k8sClusterId, k8sNodeGroupName, option string) (bool, error)

RemoveK8sNodeGroup removes a specified NodeGroup

func ResolveProviderRegionZoneResourceKey added in v0.10.2

func ResolveProviderRegionZoneResourceKey(key string) (providerName string, regionName string, zoneName string, resourceName string, err error)

ResolveProviderRegionZoneResourceKey resolves the Resource key into providerName, regionName, zoneName, resourceName

func SearchImage

func SearchImage(nsId string, keywords ...string) ([]model.TbImageInfo, error)

SearchImage accepts arbitrary number of keywords, and returns the list of matched TB image objects

func SetK8sNodeGroupAutoscaling

func SetK8sNodeGroupAutoscaling(nsId string, k8sClusterId string, k8sNodeGroupName string, u *model.TbSetK8sNodeGroupAutoscalingReq) (*model.TbSetK8sNodeGroupAutoscalingRes, error)

SetK8sNodeGroupAutoscaling set NodeGroup's Autoscaling On/Off

func TbCustomImageReqStructLevelValidation

func TbCustomImageReqStructLevelValidation(sl validator.StructLevel)

TbImageReqStructLevelValidation func is for Validation

func TbDataDiskReqStructLevelValidation

func TbDataDiskReqStructLevelValidation(sl validator.StructLevel)

TbDataDiskReqStructLevelValidation func is for Validation

func TbImageReqStructLevelValidation

func TbImageReqStructLevelValidation(sl validator.StructLevel)

TbImageReqStructLevelValidation func is for Validation

func TbK8sClusterReqStructLevelValidation

func TbK8sClusterReqStructLevelValidation(sl validator.StructLevel)

TbK8sClusterReqStructLevelValidation is a function to validate 'model.TbK8sClusterReq' object.

func TbSecurityGroupReqStructLevelValidation

func TbSecurityGroupReqStructLevelValidation(sl validator.StructLevel)

TbSecurityGroupReqStructLevelValidation is a function to validate 'TbSecurityGroupReq' object.

func TbSpecReqStructLevelValidation

func TbSpecReqStructLevelValidation(sl validator.StructLevel)

TbSpecReqStructLevelValidation is a function to validate 'TbSpecReq' object.

func TbSshKeyReqStructLevelValidation

func TbSshKeyReqStructLevelValidation(sl validator.StructLevel)

TbSshKeyReqStructLevelValidation is a function to validate 'TbSshKeyReq' object.

func TbSubnetReqStructLevelValidation

func TbSubnetReqStructLevelValidation(sl validator.StructLevel)

TbSubnetReqStructLevelValidation is a function to validate 'TbSubnetReq' object.

func TbVNetReqStructLevelValidation

func TbVNetReqStructLevelValidation(sl validator.StructLevel)

TbVNetReqStructLevelValidation is a function to validate 'TbVNetReq' object.

func ToNamingRuleCompatible

func ToNamingRuleCompatible(rawName string) string

ToNamingRuleCompatible function transforms a given string to match the regex pattern [a-z]([-a-z0-9]*[a-z0-9])?.

func UpdateAssociatedObjectList

func UpdateAssociatedObjectList(nsId string, resourceType string, resourceId string, cmd string, objectKey string) ([]string, error)

UpdateAssociatedObjectList adds or deletes the objectKey (currently, vmKey) to/from TB object's associatedObjectList

func UpdateImage

func UpdateImage(nsId string, imageId string, fieldsToUpdate model.TbImageInfo, RDBonly bool) (model.TbImageInfo, error)

UpdateImage accepts to-be TB image objects, updates and returns the updated TB image objects

func UpdateResourceObject

func UpdateResourceObject(nsId string, resourceType string, resourceObject interface{})

UpdateResourceObject is func to update the resource object

func UpdateSpec

func UpdateSpec(nsId string, specId string, fieldsToUpdate model.TbSpecInfo) (model.TbSpecInfo, error)

UpdateSpec accepts to-be TB spec objects, updates and returns the updated TB spec objects

func UpdateSshKey

func UpdateSshKey(nsId string, sshKeyId string, fieldsToUpdate model.TbSshKeyInfo) (model.TbSshKeyInfo, error)

UpdateSshKey accepts to-be TB sshKey objects, updates and returns the updated TB sshKey objects

func UpgradeK8sCluster

func UpgradeK8sCluster(nsId string, k8sClusterId string, u *model.TbUpgradeK8sClusterReq) (*model.TbK8sClusterInfo, error)

UpgradeK8sCluster upgrades an existing k8s cluster to the specified version

func UpsizeDataDisk

func UpsizeDataDisk(nsId string, resourceId string, u *model.TbDataDiskUpsizeReq) (model.TbDataDiskInfo, error)

UpsizeDataDisk accepts DataDisk upsize request, creates and returns an TB dataDisk object

func ValidateSubnetReq added in v0.9.9

func ValidateSubnetReq(subnetReq *model.TbSubnetReq, existingVNet model.TbVNetInfo) error

func ValidateVNetReq added in v0.9.9

func ValidateVNetReq(vNetReq *model.TbVNetReq) error

Types

type IdNameOnly

type IdNameOnly struct {
	Id   string
	Name string
}

type NetworkAction added in v0.9.15

type NetworkAction string
const (
	ActionNone        NetworkAction = ""
	ActionRefine      NetworkAction = "refine"
	ActionForce       NetworkAction = "force"
	ActionWithSubnets NetworkAction = "withsubnets"
)

func ParseNetworkAction added in v0.9.15

func ParseNetworkAction(s string) (NetworkAction, bool)

func (NetworkAction) IsValidToDeleteSubnet added in v0.9.15

func (na NetworkAction) IsValidToDeleteSubnet() bool

func (NetworkAction) IsValidToDeleteVNet added in v0.9.15

func (na NetworkAction) IsValidToDeleteVNet() bool

func (NetworkAction) String added in v0.9.15

func (na NetworkAction) String() string

type NetworkStatus added in v0.9.9

type NetworkStatus string

NetworkStatus represents the status of a network resource.

const (

	// CRUD operations
	NetworkOnConfiguring NetworkStatus = "Configuring" // Resources are being configured.
	NetworkOnReading     NetworkStatus = "Reading"     // The network information is being read.
	NetworkOnUpdating    NetworkStatus = "Updating"    // The network is being updated.
	NetworkOnDeleting    NetworkStatus = "Deleting"    // The network is being deleted.

	// Register/deregister operations
	NetworkOnRegistering   NetworkStatus = "Registering"  // The network is being registered.
	NetworkOnDeregistering NetworkStatus = "Dergistering" // The network is being registered.

	// NetworkAvailable status
	NetworkAvailable NetworkStatus = "Available" // The network is fully created and ready for use.

	// In Use status
	NetworkInUse NetworkStatus = "InUse" // The network is currently in use.

	// Unknwon status
	NetworkUnknown NetworkStatus = "Unknown" // The network status is unknown.

	// NetworkError Handling
	NetworkError              NetworkStatus = "Error"              // An error occurred during a CRUD operation.
	NetworkErrorOnConfiguring NetworkStatus = "ErrorOnConfiguring" // An error occurred during the configuring operation.
	NetworkErrorOnReading     NetworkStatus = "ErrorOnReading"     // An error occurred during the reading operation.
	NetworkErrorOnUpdating    NetworkStatus = "ErrorOnUpdating"    // An error occurred during the updating operation.
	NetworkErrorOnDeleting    NetworkStatus = "ErrorOnDeleting"    // An error occurred during the deleting operation.
	NetworkErrorOnRegistering NetworkStatus = "ErrorOnRegistering" // An error occurred during the registering operation.
)

type ObjectStorageAction added in v0.10.2

type ObjectStorageAction string

type ObjectStorageStatus added in v0.10.2

type ObjectStorageStatus string

ObjectStorageStatus represents the status of a network resource.

const (

	// CRUD operations
	ObjectStorageOnConfiguring ObjectStorageStatus = "Configuring" // Resources are being configured.
	// ObjectStorageOnReading     ObjectStorageStatus = "Reading"     // The network information is being read.
	// ObjectStorageOnUpdating    ObjectStorageStatus = "Updating"    // The network is being updated.
	ObjectStorageOnDeleting ObjectStorageStatus = "Deleting" // The network is being deleted.

	// NetworkAvailable status
	ObjectStorageAvailable ObjectStorageStatus = "Available" // The network is fully created and ready for use.

)

type Range

type Range struct {
	Min float32 `json:"min"`
	Max float32 `json:"max"`
}

Range struct is for 'FilterSpecsByRange'

type SqlDBAction added in v0.10.1

type SqlDBAction string

type SqlDBStatus added in v0.10.1

type SqlDBStatus string

SqlDBStatus represents the status of a network resource.

const (

	// CRUD operations
	SqlDBOnConfiguring SqlDBStatus = "Configuring" // Resources are being configured.
	// SqlDBOnReading     SqlDBStatus = "Reading"     // The network information is being read.
	// SqlDBOnUpdating    SqlDBStatus = "Updating"    // The network is being updated.
	SqlDBOnDeleting SqlDBStatus = "Deleting" // The network is being deleted.

	// NetworkAvailable status
	SqlDBAvailable SqlDBStatus = "Available" // The network is fully created and ready for use.

)

type TbDataDiskUpsizeReq

type TbDataDiskUpsizeReq struct {
	DiskSize    string `json:"diskSize" validate:"required"`
	Description string `json:"description"`
}

TbDataDiskUpsizeReq is a struct to handle 'Upsize dataDisk' request toward CB-Tumblebug.

Jump to

Keyboard shortcuts

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