utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2019 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Overview

******************************************************************************

  • IBM Confidential
  • OCO Source Materials
  • IBM Cloud Container Service, 5737-D43
  • (C) Copyright IBM Corp. 2018 All Rights Reserved.
  • The source code for this program is not published or otherwise divested of
  • its trade secrets, irrespective of what has been deposited with
  • the U.S. Copyright Office. *****************************************************************************

******************************************************************************

  • IBM Confidential
  • OCO Source Materials
  • IBM Cloud Container Service, 5737-D43
  • (C) Copyright IBM Corp. 2018 All Rights Reserved.
  • The source code for this program is not published or otherwise divested of
  • its trade secrets, irrespective of what has been deposited with
  • the U.S. Copyright Office. *****************************************************************************

Index

Constants

This section is empty.

Variables

View Source
var ENDURANCE_TIERS = map[string]int{
	"0.25": 100,
	"2":    200,
	"4":    300,
	"10":   1000,
}
View Source
var IOPS = map[string]string{"LOW_INTENSITY_TIER": "0.25", "READHEAVY_TIER": "2", "WRITEHEAVY_TIER": "4", "10_IOPS_PER_GB": "10"}

Functions

func ConverStringToMap

func ConverStringToMap(mapString string) map[string]string

func ConvertToLocalSnapshotObject

func ConvertToLocalSnapshotObject(storageSnapshot datatypes.Network_Storage, logger *zap.Logger, pName provider.VolumeProvider, volType provider.VolumeType) *provider.Snapshot

func ConvertToVolumeType

func ConvertToVolumeType(storage datatypes.Network_Storage, logger *zap.Logger, prName provider.VolumeProvider, volType provider.VolumeType) (volume *provider.Volume)

func GetDataCenterID

func GetDataCenterID(logger *zap.Logger, sess backend.Session, dataCenterName string) (int, error)

GetDataCenterID

func GetEnduranceTierIopsPerGB

func GetEnduranceTierIopsPerGB(logger *zap.Logger, originalVolume datatypes.Network_Storage) string

GetEnduranceTierIopsPerGB(originalVolume)

func GetEnterpriseEnduranceTierPrice

func GetEnterpriseEnduranceTierPrice(logger *zap.Logger, packageDetails datatypes.Product_Package, tier_level string) int

func GetEnterpriseSpacePrice

func GetEnterpriseSpacePrice(logger *zap.Logger, packageDetails datatypes.Product_Package, category string, size int, tier_level string) int

func GetNetworkStorageFromOrderID

func GetNetworkStorageFromOrderID(bkSession backend.Session, volumeType string, orderIDIn int, logger *zap.Logger) (*datatypes.Network_Storage, error)

Retrieves storageID of given orderID.

func GetOrderTypeAndCategory

func GetOrderTypeAndCategory(service_offering, storage_type, volume_type string) (bool, string)

func GetPackageDetails

func GetPackageDetails(logger *zap.Logger, sess backend.Session, category string) (datatypes.Product_Package, error)

GetPackageDetails

func GetPerformanceIopsPrice

func GetPerformanceIopsPrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int, iops int) int

func GetPerformanceSpacePrice

func GetPerformanceSpacePrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int) int

func GetPriceIDByCategory

func GetPriceIDByCategory(logger *zap.Logger, packageDetails datatypes.Product_Package, category string) int

GetPriceIDByCategory

func GetPriceIDFromItemByPriceCategory

func GetPriceIDFromItemByPriceCategory(logger *zap.Logger, item datatypes.Product_Item, category string, restrictionType string, restrictionValue int) int

GetPriceIDFromItemByPriceCategory

func GetSaaSEnduranceSpacePrice

func GetSaaSEnduranceSpacePrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int, tier string) int

GetSaaSEnduranceSpacePrice

func GetSaaSEnduranceTierPrice

func GetSaaSEnduranceTierPrice(logger *zap.Logger, packageDetails datatypes.Product_Package, tier string) int

GetSaaSEnduranceTierPrice

func GetSaaSPerformanceIopsPrice

func GetSaaSPerformanceIopsPrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int, iops int) int

GetSaaSPerformanceIopsPrice

func GetSaaSPerformanceSpacePrice

func GetSaaSPerformanceSpacePrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int) int

GetSaaSPerformanceSpacePrice

func GetSaaSSnapshotOrderSpacePrice

func GetSaaSSnapshotOrderSpacePrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int, restrictionType string, restrictionValue int) int

GetSaaSSnapshotOrderSpacePrice

func GetSaaSSnapshotSpacePrice

func GetSaaSSnapshotSpacePrice(logger *zap.Logger, packageDetails datatypes.Product_Package, size int, tier string, iops int) int

GetSaaSSnapshotSpacePrice

func GetStorageID

func GetStorageID(sess backend.Session, volumeType string, orderID int, logger *zap.Logger, config *config.SoftlayerConfig) (int, error)

func GetSubnetIPAddressListFromIPs

func GetSubnetIPAddressListFromIPs(logger *zap.Logger, session backend.Session, ipAddressList []string) ([]datatypes.Network_Subnet_IpAddress, error)

GetSubnetIPAddressListFromIPs returns list of Network_Subnet_IpAddress from IP address list

func GetSubnetListFromIDs

func GetSubnetListFromIDs(logger *zap.Logger, session backend.Session, subnetIDs []string) ([]datatypes.Network_Subnet, error)

GetSubnetListFromIDs returns list of Network_Subnet from subnetIDs

func IsVolumeCreatedWithStaaS

func IsVolumeCreatedWithStaaS(volume datatypes.Network_Storage) bool

IsVolumeCreatedWithStaaS

func ProvisioningRetry

func ProvisioningRetry(fn retryFuncProv, logger *zap.Logger, timeoutSec string, retryIntervalSec string) error

func ToInt

func ToInt(valueInInt string) int

ToInt

func WaitForTransactionsComplete

func WaitForTransactionsComplete(sess backend.Session, storageID int, logger *zap.Logger, config *config.SoftlayerConfig) error

Makes sure there are no active transactions for volume with given ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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