Note:"splits the first string when the second string is found and converts it into an array ",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:regexReplaceAll,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString,jpNumber}},
{Types:[]jpType{jpString,jpNumber}},
},
Handler:jpRegexReplaceAll,
},
ReturnType:[]jpType{jpString},
Note:"converts all parameters to string",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:regexReplaceAllLiteral,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString,jpNumber}},
{Types:[]jpType{jpString,jpNumber}},
},
Handler:jpRegexReplaceAllLiteral,
},
ReturnType:[]jpType{jpString},
Note:"converts all parameters to string",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:regexMatch,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString,jpNumber}},
},
Handler:jpRegexMatch,
},
ReturnType:[]jpType{jpBool},
Note:"first string is the regular exression which is compared with second input which can be a number or string",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:patternMatch,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString,jpNumber}},
},
Handler:jpPatternMatch,
},
ReturnType:[]jpType{jpBool},
Note:"'*' matches zero or more alphanumeric characters, '?' matches a single alphanumeric character",
},{
// Validates if label (param1) would match pod/host/etc labels (param2)
FunctionEntry:gojmespath.FunctionEntry{
Name:labelMatch,
Arguments:[]argSpec{
{Types:[]jpType{jpObject}},
{Types:[]jpType{jpObject}},
},
Handler:jpLabelMatch,
},
ReturnType:[]jpType{jpBool},
Note:"object arguments must be enclosed in backticks; ex. `{{request.object.spec.template.metadata.labels}}`",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:add,
Arguments:[]argSpec{
{Types:[]jpType{jpAny}},
{Types:[]jpType{jpAny}},
},
Handler:jpAdd,
},
ReturnType:[]jpType{jpAny},
Note:"does arithmetic addition of two specified values of numbers, quantities, and durations",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:subtract,
Arguments:[]argSpec{
{Types:[]jpType{jpAny}},
{Types:[]jpType{jpAny}},
},
Handler:jpSubtract,
},
ReturnType:[]jpType{jpAny},
Note:"does arithmetic subtraction of two specified values of numbers, quantities, and durations",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:multiply,
Arguments:[]argSpec{
{Types:[]jpType{jpAny}},
{Types:[]jpType{jpAny}},
},
Handler:jpMultiply,
},
ReturnType:[]jpType{jpAny},
Note:"does arithmetic multiplication of two specified values of numbers, quantities, and durations",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:divide,
Arguments:[]argSpec{
{Types:[]jpType{jpAny}},
{Types:[]jpType{jpAny}},
},
Handler:jpDivide,
},
ReturnType:[]jpType{jpAny},
Note:"divisor must be non zero",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:modulo,
Arguments:[]argSpec{
{Types:[]jpType{jpAny}},
{Types:[]jpType{jpAny}},
},
Handler:jpModulo,
},
ReturnType:[]jpType{jpAny},
Note:"divisor must be non-zero, arguments must be integers",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:base64Decode,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpBase64Decode,
},
ReturnType:[]jpType{jpString},
Note:"decodes a base 64 string",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:base64Encode,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpBase64Encode,
},
ReturnType:[]jpType{jpString},
Note:"encodes a regular, plaintext and unencoded string to base64",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeSince,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeSince,
},
ReturnType:[]jpType{jpString},
Note:"calculate the difference between a start and end period of time where the end may either be a static definition or the then-current time",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeNow,
Handler:jpTimeNow,
},
ReturnType:[]jpType{jpString},
Note:"returns current time in RFC 3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeNowUtc,
Handler:jpTimeNowUtc,
},
ReturnType:[]jpType{jpString},
Note:"returns current UTC time in RFC 3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:pathCanonicalize,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpPathCanonicalize,
},
ReturnType:[]jpType{jpString},
Note:"normalizes or canonicalizes a given path by removing excess slashes",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:truncate,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpNumber}},
},
Handler:jpTruncate,
},
ReturnType:[]jpType{jpString},
Note:"length argument must be enclosed in backticks; ex. \"{{request.object.metadata.name | truncate(@, `9`)}}\"",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:semverCompare,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpSemverCompare,
},
ReturnType:[]jpType{jpBool},
Note:"compares two strings which comply with the semantic versioning schema and outputs a boolean response as to the position of the second relative to the first",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:parseJson,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpParseJson,
},
ReturnType:[]jpType{jpAny},
Note:"decodes a valid JSON encoded string to the appropriate type. Opposite of `to_string` function",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:parseYAML,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpParseYAML,
},
ReturnType:[]jpType{jpAny},
Note:"decodes a valid YAML encoded string to the appropriate type provided it can be represented as JSON",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:items,
Arguments:[]argSpec{
{Types:[]jpType{jpObject,jpArray}},
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpItems,
},
ReturnType:[]jpType{jpArray},
Note:"converts a map or array to an array of objects where each key:value is an item in the array",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:objectFromLists,
Arguments:[]argSpec{
{Types:[]jpType{jpArray}},
{Types:[]jpType{jpArray}},
},
Handler:jpObjectFromLists,
},
ReturnType:[]jpType{jpObject},
Note:"converts a pair of lists containing keys and values to an object",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:random,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpRandom,
},
ReturnType:[]jpType{jpString},
Note:"Generates a random sequence of characters",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:x509_decode,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpX509Decode,
},
ReturnType:[]jpType{jpObject},
Note:"decodes an x.509 certificate to an object. you may also use this in conjunction with `base64_decode` jmespath function to decode a base64-encoded certificate",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeToCron,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpTimeToCron,
},
ReturnType:[]jpType{jpString},
Note:"converts a time (RFC 3339) to a cron expression (string).",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeAdd,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeAdd,
},
ReturnType:[]jpType{jpString},
Note:"adds duration (second string) to a time value (first string)",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeParse,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeParse,
},
ReturnType:[]jpType{jpString},
Note:"changes a time value of a given layout to RFC 3339",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeUtc,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
},
Handler:jpTimeUtc,
},
ReturnType:[]jpType{jpString},
Note:"calcutes time in UTC from a given time in RFC 3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeDiff,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeDiff,
},
ReturnType:[]jpType{jpString},
Note:"calculate the difference between a start and end date in RFC3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeBefore,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeBefore,
},
ReturnType:[]jpType{jpBool},
Note:"checks if a time is before another time, both in RFC3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeAfter,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeAfter,
},
ReturnType:[]jpType{jpBool},
Note:"checks if a time is after another time, both in RFC3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeBetween,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeBetween,
},
ReturnType:[]jpType{jpBool},
Note:"checks if a time is between a start and end time, all in RFC3339 format",
},{
FunctionEntry:gojmespath.FunctionEntry{
Name:timeTruncate,
Arguments:[]argSpec{
{Types:[]jpType{jpString}},
{Types:[]jpType{jpString}},
},
Handler:jpTimeTruncate,
},
ReturnType:[]jpType{jpString},
Note:"returns the result of rounding time down to a multiple of duration",