util

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SomaError

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

func (SomaError) Code

func (e SomaError) Code() uint16

func (SomaError) Error

func (e SomaError) Error() string

func (SomaError) RequestError

func (e SomaError) RequestError() bool

type SomaUtil

type SomaUtil struct {
	Log *log.Logger
}

func (*SomaUtil) Abort

func (u *SomaUtil) Abort(txt ...string)

func (*SomaUtil) AbortOnError

func (u *SomaUtil) AbortOnError(err error, txt ...string)

func (SomaUtil) BucketByUUIDOrName

func (u SomaUtil) BucketByUUIDOrName(c *resty.Client, b string) string

func (SomaUtil) BucketIdByName

func (u SomaUtil) BucketIdByName(c *resty.Client, bucket string) string

func (*SomaUtil) CheckRestyResponse

func (u *SomaUtil) CheckRestyResponse(resp *resty.Response)

func (*SomaUtil) CheckServerKeyword

func (u *SomaUtil) CheckServerKeyword(s string)

func (SomaUtil) CheckStringIsServiceAttribute

func (u SomaUtil) CheckStringIsServiceAttribute(c *resty.Client, s string)

func (SomaUtil) CheckStringIsSystemProperty

func (u SomaUtil) CheckStringIsSystemProperty(c *resty.Client, s string)

func (*SomaUtil) CheckStringNotAKeyword

func (u *SomaUtil) CheckStringNotAKeyword(s string, keys []string)

func (SomaUtil) CleanConstraints

func (u SomaUtil) CleanConstraints(c *resty.Client, constraints []proto.CheckConfigConstraint, repoId string, teamId string) []proto.CheckConfigConstraint

func (SomaUtil) CleanThresholds

func (u SomaUtil) CleanThresholds(c *resty.Client, thresholds []proto.CheckConfigThreshold) []proto.CheckConfigThreshold

func (*SomaUtil) DecodeCheckConfigurationResultFromResponse

func (u *SomaUtil) DecodeCheckConfigurationResultFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultAttributeFromResponse

func (u SomaUtil) DecodeProtoResultAttributeFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultBucketFromResponse

func (u SomaUtil) DecodeProtoResultBucketFromResponse(resp *resty.Response) *proto.Result

func (*SomaUtil) DecodeProtoResultCapabilityFromResponse

func (u *SomaUtil) DecodeProtoResultCapabilityFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultClusterFromResponse

func (u SomaUtil) DecodeProtoResultClusterFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultGroupFromResponse

func (u SomaUtil) DecodeProtoResultGroupFromResponse(resp *resty.Response) *proto.Result

func (*SomaUtil) DecodeProtoResultLevelFromResponse

func (u *SomaUtil) DecodeProtoResultLevelFromResponse(resp *resty.Response) *proto.Result

func (*SomaUtil) DecodeProtoResultMonitoringFromResponse

func (u *SomaUtil) DecodeProtoResultMonitoringFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultNodeFromResponse

func (u SomaUtil) DecodeProtoResultNodeFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultOncallFromResponse

func (u SomaUtil) DecodeProtoResultOncallFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultPropertyFromResponse

func (u SomaUtil) DecodeProtoResultPropertyFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultRepositoryFromResponse

func (u SomaUtil) DecodeProtoResultRepositoryFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultServerFromResponse

func (u SomaUtil) DecodeProtoResultServerFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeProtoResultTeamFromResponse

func (u SomaUtil) DecodeProtoResultTeamFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DecodeResultFromResponse

func (u SomaUtil) DecodeResultFromResponse(resp *resty.Response) *proto.Result

func (SomaUtil) DeleteRequest

func (u SomaUtil) DeleteRequest(c *resty.Client, p string) *resty.Response

DELETE

func (SomaUtil) DeleteRequestWithBody

func (u SomaUtil) DeleteRequestWithBody(c *resty.Client, body interface{}, p string) *resty.Response

func (SomaUtil) FindSourceForBucketProperty

func (u SomaUtil) FindSourceForBucketProperty(c *resty.Client, pTyp, pName, view, bucketId string) string

func (SomaUtil) FindSourceForClusterProperty

func (u SomaUtil) FindSourceForClusterProperty(c *resty.Client, pTyp, pName, view, clusterId string) string

func (SomaUtil) FindSourceForGroupProperty

func (u SomaUtil) FindSourceForGroupProperty(c *resty.Client, pTyp, pName, view, groupId string) string

func (SomaUtil) FindSourceForNodeProperty

func (u SomaUtil) FindSourceForNodeProperty(c *resty.Client, pTyp, pName, view, nodeId string) string

func (SomaUtil) FindSourceForRepoProperty

func (u SomaUtil) FindSourceForRepoProperty(c *resty.Client, pTyp, pName, view, repoId string) string

func (SomaUtil) GetBucketDetails

func (u SomaUtil) GetBucketDetails(c *resty.Client, bucketId string) *proto.Bucket

func (SomaUtil) GetBucketIdByName

func (u SomaUtil) GetBucketIdByName(c *resty.Client, bucket string, repoId string) string

func (*SomaUtil) GetCapabilityIdByName

func (u *SomaUtil) GetCapabilityIdByName(c *resty.Client, capability string) string

func (*SomaUtil) GetCheckByName

func (u *SomaUtil) GetCheckByName(c *resty.Client, ck string, r string) string

func (*SomaUtil) GetCliArgumentCount

func (u *SomaUtil) GetCliArgumentCount(c *cli.Context) int

func (SomaUtil) GetClusterDetails

func (u SomaUtil) GetClusterDetails(c *resty.Client, clusterId string) *proto.Cluster

func (SomaUtil) GetClusterIdByName

func (u SomaUtil) GetClusterIdByName(c *resty.Client, cl string, bId string) string

func (*SomaUtil) GetFullArgumentSlice

func (u *SomaUtil) GetFullArgumentSlice(c *cli.Context) []string

func (SomaUtil) GetGroupDetails

func (u SomaUtil) GetGroupDetails(c *resty.Client, groupId string) *proto.Group

func (SomaUtil) GetGroupIdByName

func (u SomaUtil) GetGroupIdByName(c *resty.Client, g string, bId string) string

func (*SomaUtil) GetMonitoringIdByName

func (u *SomaUtil) GetMonitoringIdByName(c *resty.Client, monitoring string) string

func (*SomaUtil) GetNewPassword

func (u *SomaUtil) GetNewPassword() string

func (SomaUtil) GetNodeConfigById

func (u SomaUtil) GetNodeConfigById(c *resty.Client, node string) *proto.NodeConfig

func (SomaUtil) GetNodeDetails

func (u SomaUtil) GetNodeDetails(c *resty.Client, nodeId string) *proto.Node

func (SomaUtil) GetNodeIdByName

func (u SomaUtil) GetNodeIdByName(c *resty.Client, node string) string

func (SomaUtil) GetObjectIdForCheck

func (u SomaUtil) GetObjectIdForCheck(c *resty.Client, t string, n string, b string) string

func (SomaUtil) GetOncallDetailsById

func (u SomaUtil) GetOncallDetailsById(c *resty.Client, oncallid string) (string, string)

func (SomaUtil) GetOncallIdByName

func (u SomaUtil) GetOncallIdByName(c *resty.Client, oncall string) string

func (*SomaUtil) GetPermissionIdByName

func (u *SomaUtil) GetPermissionIdByName(c *resty.Client, perm string) string

func (SomaUtil) GetPropertyIdByName

func (u SomaUtil) GetPropertyIdByName(c *resty.Client, pType string, prop string, ctx string) string

func (SomaUtil) GetRepositoryDetails

func (u SomaUtil) GetRepositoryDetails(c *resty.Client, repoId string) *proto.Repository

func (SomaUtil) GetRepositoryIdByName

func (u SomaUtil) GetRepositoryIdByName(c *resty.Client, repo string) string

func (SomaUtil) GetRepositoryIdForBucket

func (u SomaUtil) GetRepositoryIdForBucket(c *resty.Client, bucket string) string

func (SomaUtil) GetRequest

func (u SomaUtil) GetRequest(c *resty.Client, p string) *resty.Response

GET

func (SomaUtil) GetRequestWithBody

func (u SomaUtil) GetRequestWithBody(c *resty.Client, body interface{}, p string) *resty.Response

func (SomaUtil) GetServerAssetIdByName

func (u SomaUtil) GetServerAssetIdByName(c *resty.Client, serverName string) uint64

func (SomaUtil) GetServerIdByAssetId

func (u SomaUtil) GetServerIdByAssetId(cache *db.DB, c *resty.Client, aid uint64) string

func (SomaUtil) GetServerIdByName

func (u SomaUtil) GetServerIdByName(cache *db.DB, c *resty.Client, server string) string

func (SomaUtil) GetTeamIdByName

func (u SomaUtil) GetTeamIdByName(c *resty.Client, teamName string) string

func (SomaUtil) GetTeamIdByRepositoryId

func (u SomaUtil) GetTeamIdByRepositoryId(c *resty.Client, repo string) string

func (*SomaUtil) GetUserIdByName

func (u *SomaUtil) GetUserIdByName(c *resty.Client, user string) string

func (*SomaUtil) GetValidatedBool

func (u *SomaUtil) GetValidatedBool(s string) bool

func (*SomaUtil) GetValidatedUint64

func (u *SomaUtil) GetValidatedUint64(s string, min uint64) uint64

func (*SomaUtil) IsUUID

func (u *SomaUtil) IsUUID(s string) bool

func (*SomaUtil) NotImplemented

func (u *SomaUtil) NotImplemented(txt ...string)

func (*SomaUtil) ParseVariableArguments

func (u *SomaUtil) ParseVariableArguments(keys []string, rKeys []string, args []string) (map[string]string, []string)

func (*SomaUtil) ParseVariadicArguments

func (u *SomaUtil) ParseVariadicArguments(
	multKeys []string,
	uniqKeys []string,
	reqKeys []string,
	args []string,
) map[string][]string

* This function parses whitespace separated argument lists of * keyword/value pairs were keywords can be specified multiple * times, some keywords are required and some only allowed once. * Sequence of multiple keywords are detected and lead to abort * * multKeys => [ "port", "transport" ] * uniqKeys => [ "team" ] * reqKeys => [ "team" ] * args => [ "port", "53", "transport", "tcp", "transport", * "udp", "team", "ITOMI" ] * * result => result["team"] = [ "ITOMI" ] * result["port"] = [ "53" ] * result["transport"] = [ "tcp", "udp" ]

func (*SomaUtil) ParseVariadicCapabilityArguments

func (u *SomaUtil) ParseVariadicCapabilityArguments(
	c *resty.Client,
	multKeys []string,
	uniqKeys []string,
	reqKeys []string,
	args []string,
) (map[string][]string, []proto.CapabilityConstraint)

func (*SomaUtil) ParseVariadicCheckArguments

func (u *SomaUtil) ParseVariadicCheckArguments(args []string) (
	map[string][]string,
	[]proto.CheckConfigConstraint,
	[]proto.CheckConfigThreshold,
)

func (SomaUtil) PatchRequestWithBody

func (u SomaUtil) PatchRequestWithBody(c *resty.Client, body interface{}, p string) *resty.Response

PATCH

func (SomaUtil) PostRequestWithBody

func (u SomaUtil) PostRequestWithBody(c *resty.Client, body interface{}, p string) *resty.Response

POST

func (SomaUtil) PutRequest

func (u SomaUtil) PutRequest(c *resty.Client, p string) *resty.Response

PUT

func (SomaUtil) PutRequestWithBody

func (u SomaUtil) PutRequestWithBody(c *resty.Client, body interface{}, p string) *resty.Response

func (*SomaUtil) ReadPasswordFromTerminal

func (u *SomaUtil) ReadPasswordFromTerminal() (string, error)

func (SomaUtil) ResultFromResponse

func (u SomaUtil) ResultFromResponse(resp *resty.Response) (*proto.Result, error)

func (*SomaUtil) SliceContainsString

func (u *SomaUtil) SliceContainsString(s string, sl []string) bool

func (*SomaUtil) StringIsKeyword

func (u *SomaUtil) StringIsKeyword(s string, keys []string) bool

XXX DEPRECATED FOR SliceContainsString

func (SomaUtil) TeamIdForBucket

func (u SomaUtil) TeamIdForBucket(c *resty.Client, bucket string) string

func (SomaUtil) TeamIdForNode

func (u SomaUtil) TeamIdForNode(c *resty.Client, node string) string

func (SomaUtil) TryGetBucketByUUIDOrName

func (u SomaUtil) TryGetBucketByUUIDOrName(c *resty.Client, b string, r string) string

func (*SomaUtil) TryGetCapabilityByUUIDOrName

func (u *SomaUtil) TryGetCapabilityByUUIDOrName(c *resty.Client, s string) string

func (*SomaUtil) TryGetCheckByUUIDOrName

func (u *SomaUtil) TryGetCheckByUUIDOrName(c *resty.Client, ck string, r string) string

func (SomaUtil) TryGetClusterByUUIDOrName

func (u SomaUtil) TryGetClusterByUUIDOrName(c *resty.Client, cl string, b string) string

func (SomaUtil) TryGetCustomPropertyByUUIDOrName

func (u SomaUtil) TryGetCustomPropertyByUUIDOrName(c *resty.Client, s string, r string) string

func (SomaUtil) TryGetGroupByUUIDOrName

func (u SomaUtil) TryGetGroupByUUIDOrName(c *resty.Client, g string, b string) string

func (*SomaUtil) TryGetLevelNameByNameOrShort

func (u *SomaUtil) TryGetLevelNameByNameOrShort(c *resty.Client, s string) string

func (*SomaUtil) TryGetMonitoringByUUIDOrName

func (u *SomaUtil) TryGetMonitoringByUUIDOrName(c *resty.Client, s string) string

func (SomaUtil) TryGetNodeByUUIDOrName

func (u SomaUtil) TryGetNodeByUUIDOrName(c *resty.Client, s string) string

func (SomaUtil) TryGetOncallByUUIDOrName

func (u SomaUtil) TryGetOncallByUUIDOrName(c *resty.Client, s string) string

func (*SomaUtil) TryGetPermissionByUUIDOrName

func (u *SomaUtil) TryGetPermissionByUUIDOrName(c *resty.Client, s string) string

func (SomaUtil) TryGetRepositoryByUUIDOrName

func (u SomaUtil) TryGetRepositoryByUUIDOrName(c *resty.Client, s string) string

func (SomaUtil) TryGetServerByUUIDOrName

func (u SomaUtil) TryGetServerByUUIDOrName(cache *db.DB, c *resty.Client, s string) string

func (SomaUtil) TryGetServicePropertyByUUIDOrName

func (u SomaUtil) TryGetServicePropertyByUUIDOrName(c *resty.Client, s string, t string) string

func (SomaUtil) TryGetSystemPropertyByUUIDOrName

func (u SomaUtil) TryGetSystemPropertyByUUIDOrName(c *resty.Client, s string) string

func (SomaUtil) TryGetTeamByUUIDOrName

func (u SomaUtil) TryGetTeamByUUIDOrName(c *resty.Client, s string) string

func (SomaUtil) TryGetTemplatePropertyByUUIDOrName

func (u SomaUtil) TryGetTemplatePropertyByUUIDOrName(c *resty.Client, s string) string

func (*SomaUtil) TryGetUserByUUIDOrName

func (u *SomaUtil) TryGetUserByUUIDOrName(c *resty.Client, s string) string

func (*SomaUtil) TryResolveGrantId

func (u *SomaUtil) TryResolveGrantId(c *resty.Client, rtyp, rid, pid, cat string) string

func (SomaUtil) UnfilteredResultFromResponse

func (u SomaUtil) UnfilteredResultFromResponse(resp *resty.Response) *proto.Result

func (*SomaUtil) ValidateCliArgument

func (u *SomaUtil) ValidateCliArgument(c *cli.Context, pos uint8, s string)

func (*SomaUtil) ValidateCliArgumentCount

func (u *SomaUtil) ValidateCliArgumentCount(c *cli.Context, i uint8)

func (*SomaUtil) ValidateCliMinArgumentCount

func (u *SomaUtil) ValidateCliMinArgumentCount(c *cli.Context, i uint8)

func (*SomaUtil) ValidatePasswordStrength

func (u *SomaUtil) ValidatePasswordStrength(pass string) bool

func (SomaUtil) ValidatePhoneNumber

func (u SomaUtil) ValidatePhoneNumber(n string)

func (*SomaUtil) ValidateProviderExists

func (u *SomaUtil) ValidateProviderExists(c *resty.Client, s string)

func (*SomaUtil) ValidateRuneCount

func (u *SomaUtil) ValidateRuneCount(s string, l int) string

func (*SomaUtil) ValidateRuneCountRange

func (u *SomaUtil) ValidateRuneCountRange(s string, lower, higher int)

func (*SomaUtil) ValidateStringAsBool

func (u *SomaUtil) ValidateStringAsBool(s string)

func (*SomaUtil) ValidateStringAsEmployeeNumber

func (u *SomaUtil) ValidateStringAsEmployeeNumber(s string)

func (*SomaUtil) ValidateStringAsMailAddress

func (u *SomaUtil) ValidateStringAsMailAddress(s string)

func (*SomaUtil) ValidateStringAsNodeAssetId

func (u *SomaUtil) ValidateStringAsNodeAssetId(s string)

func (*SomaUtil) ValidateStringInSlice

func (u *SomaUtil) ValidateStringInSlice(s string, sl []string)

func (*SomaUtil) ValidateUnitExists

func (u *SomaUtil) ValidateUnitExists(c *resty.Client, s string)

func (SomaUtil) VerifyEnvironment

func (u SomaUtil) VerifyEnvironment(c *resty.Client, env string)

Jump to

Keyboard shortcuts

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