Documentation ¶
Index ¶
- func BoolPoint(b bool) *bool
- func Contains(arry []string, val string) (index int, flag bool)
- func ConvertMapToJSONString(inputMap map[string]interface{}) string
- func ConvertStringToInt(mystring string) int
- func ConvertStructToMap(s interface{}) map[string]interface{}
- func ConvertStructToString(s interface{}) string
- func Dig(object interface{}, keys []interface{}) interface{}
- func DigArray(object interface{}, keys ...interface{}) []interface{}
- func DigBool(object interface{}, keys ...interface{}) bool
- func DigInt(object interface{}, keys ...interface{}) int
- func DigString(object interface{}, keys ...interface{}) string
- func DigStringArray(object interface{}, keys ...interface{}) []string
- func EndsWith(st string, substring string) (flag bool)
- func FindAnUpgradeVersion(connection *client.Connection) string
- func GenerateClusterName(profileName string) string
- func GetDefaultVersion(connection *client.Connection) *v1.Version
- func GetGreaterOrEqualVersions(connection *client.Connection, throttleVersion string, channel string, ...) (versions []string)
- func GetGreaterVersions(connection *client.Connection, throttleVersion string, channel string, ...) (versions []string)
- func GetHcpHigherVersions(connection *client.Connection, throttleVersion string, channel string) (versions []string)
- func GetHcpLowerVersions(connection *client.Connection, throttleVersion string, channel string) (versions []string)
- func GetLowerOrEqualVersions(connection *client.Connection, throttleVersion string, channel string, ...) (versions []string)
- func GetLowerVersions(connection *client.Connection, throttleVersion string, channel string, ...) (versions []string)
- func GetProfile(profileName string, fileName string) *profile
- func IsInMap(inputMap map[string]interface{}, key string) bool
- func IsSorted(arry []string, mode string) (flag bool)
- func IsStreamUpgrade(version string, upgradeVersion string, stream string) (isStreamUpgrade bool, err error)
- func Join(s ...string) string
- func ListVersions(connection *client.Connection, parameter ...map[string]interface{}) (resp *v1.VersionsListResponse, err error)
- func Lstrip(st string, substring string) string
- func MapStructure(m map[string]interface{}, i interface{}) error
- func Max(a int, b int) int
- func Min(a int, b int) int
- func NeedFiltered(filterList []string, key string) bool
- func NegateBoolToString(value bool) string
- func NewRand() *rand.Rand
- func Parse(data []byte) map[string]interface{}
- func ParseProfiles(fileName string) map[string]*profile
- func Rstrip(st string, substring string) string
- func RunCMD(cmd string) (stdout string, stderr string, err error)
- func SortRawVersions(versionList []string) []string
- func StartsWith(st string, substring string) (flag bool)
- func Strip(st string, substring string) string
- type ImageVersion
- func EnabledVersions(connection *client.Connection, channel string, throttleVersion string, ...) []*ImageVersion
- func GetOneSpecifiedVersion(versionList []*ImageVersion, index string) *ImageVersion
- func GetVersionsWithUpgrades(connection *client.Connection, channel string, stream string, hcpEnabled bool) (imageVersionList []*ImageVersion, err error)
- func GetVersionsWithZYUpgrades(connection *client.Connection, channel string, hcpEnabled bool) (imageVersionList *ImageVersion, err error)
- func HCPEnabledVersions(connection *client.Connection, channel string, upgradeAvailable ...bool) []*ImageVersion
- func SortVersions(versionList []*ImageVersion) []*ImageVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶ added in v1.3.0
Contains will return bool balue that whether the arry contains string val
func ConvertMapToJSONString ¶ added in v1.3.0
ConvertMapToJSONString converts the map to a json string.
func ConvertStringToInt ¶ added in v1.3.0
func ConvertStructToMap ¶ added in v1.3.0
func ConvertStructToMap(s interface{}) map[string]interface{}
func ConvertStructToString ¶ added in v1.3.0
func ConvertStructToString(s interface{}) string
func DigArray ¶ added in v1.3.0
func DigArray(object interface{}, keys ...interface{}) []interface{}
DigArray tries to find an array inside the given object with the given path, and returns its value. If there is no attribute with the given path then the test will be aborted with an error.
func DigInt ¶ added in v1.3.0
func DigInt(object interface{}, keys ...interface{}) int
DigInt tries to find an attribute inside the given object with the given path, and returns its value, assuming that it is an integer. If there is no attribute with the given path then the test will be aborted with an error.
func DigString ¶ added in v1.3.0
func DigString(object interface{}, keys ...interface{}) string
If there is no attribute with the given path then the return value will be an empty string.
func DigStringArray ¶ added in v1.3.0
func DigStringArray(object interface{}, keys ...interface{}) []string
DigStringArray tries to find an array inside the given object with the given path, and returns its value. If there is no attribute with the given path then the test will be aborted with an error.
func EndsWith ¶ added in v1.3.0
EndsWith will return the bool value that whether the st is end with substring
func FindAnUpgradeVersion ¶
func FindAnUpgradeVersion(connection *client.Connection) string
func GenerateClusterName ¶ added in v1.4.0
func GetDefaultVersion ¶
func GetDefaultVersion(connection *client.Connection) *v1.Version
GetGreaterVersions will return a version list which is euqal or greater than the version provided as throttleVersion
func GetGreaterVersions ¶
func GetGreaterVersions(connection *client.Connection, throttleVersion string, channel string, onlyRosa bool, upgradeRequired bool) (versions []string)
GetGreaterVersions will return a version list which is euqal or greater than the version provided as throttleVersion
func GetHcpHigherVersions ¶
func GetHcpHigherVersions(connection *client.Connection, throttleVersion string, channel string) (versions []string)
It will return all the versions higher that throttle version for the specified channel
func GetHcpLowerVersions ¶
func GetHcpLowerVersions(connection *client.Connection, throttleVersion string, channel string) (versions []string)
It will return all the versions lower that throttle version for the specified channel
func GetLowerOrEqualVersions ¶
func GetLowerVersions ¶
func GetProfile ¶ added in v1.4.0
func IsStreamUpgrade ¶
func IsStreamUpgrade(version string, upgradeVersion string, stream string) (isStreamUpgrade bool, err error)
checks if upgradeVersion is a 'stream' upgrade for version
func ListVersions ¶
func ListVersions(connection *client.Connection, parameter ...map[string]interface{}) (resp *v1.VersionsListResponse, err error)
func MapStructure ¶ added in v1.3.0
MapStructure will map the map to the address of the structre *i
func NeedFiltered ¶ added in v1.4.0
NeedFiltered will return the attribute that should be filtered filterList should be array with regex like ["excluded\..+","excluded_[\s\S]+"]
func NegateBoolToString ¶ added in v1.3.0
NegateBoolToString reverts the boolean to its oppositely value as a string.
func Parse ¶ added in v1.3.0
Parse parses the given JSON data and returns a map of strings containing the result.
func ParseProfiles ¶ added in v1.4.0
func SortRawVersions ¶
func StartsWith ¶ added in v1.3.0
StartsWith return bool whether st start with substring
Types ¶
type ImageVersion ¶
type ImageVersion struct { ID string `json:"id,omitempty"` RawID string `json:"raw_id,omitempty"` ChannelGroup string `json:"channel_group,omitempty"` Enabled bool `json:"enabled,omitempty"` Default bool `json:"default,omitempty"` RosaEnabled bool `json:"rosa_enabled,omitempty"` }
ImageVersion
func EnabledVersions ¶
func EnabledVersions(connection *client.Connection, channel string, throttleVersion string, onlyRosa bool, upgradeAvailable ...bool) []*ImageVersion
func GetOneSpecifiedVersion ¶
func GetOneSpecifiedVersion(versionList []*ImageVersion, index string) *ImageVersion
GetOneSpecifiedVersion returns a version with the specified index. The supported index string are one of ['latest', 'mid', 'oldest'], if the index string is an empty string or not belonged to the above list, the index will be a random value. If the version list is empty, will return nil directly.
func GetVersionsWithUpgrades ¶
func GetVersionsWithUpgrades(connection *client.Connection, channel string, stream string, hcpEnabled bool) (imageVersionList []*ImageVersion, err error)
It will return a list of versions which have available upgrades in the specified stream (x,y,z)
func GetVersionsWithZYUpgrades ¶
func GetVersionsWithZYUpgrades(connection *client.Connection, channel string, hcpEnabled bool) (imageVersionList *ImageVersion, err error)
It will return a list of versions which have available upgrades in both y and z Streams
func HCPEnabledVersions ¶
func HCPEnabledVersions(connection *client.Connection, channel string, upgradeAvailable ...bool) []*ImageVersion
func SortVersions ¶
func SortVersions(versionList []*ImageVersion) []*ImageVersion
SortVersions sort the version list from lower to higher.