MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / feedParameters

Function feedParameters

commands/trigger.go:54–73  ·  view source on GitHub ↗

** * Constructs the parameters to pass to the feed, consisting of the event type, trigger name, and subject key. * * NOTE: this function will exit in case of a processing error since it indicates a problem parsing parameters. * * @return the feed name and parameters if a feed is specified. */

(feed string, lifecycle string, trigger *QualifiedName, authKey string)

Source from the content-addressed store, hash-verified

52 * @return the feed name and parameters if a feed is specified.
53 */
54func feedParameters(feed string, lifecycle string, trigger *QualifiedName, authKey string) (*QualifiedName, []string) {
55 if feed == "" {
56 return nil, make([]string, 0)
57 }
58
59 whisk.Debug(whisk.DbgInfo, "Trigger has a feed\n")
60
61 var params []string
62 name := fmt.Sprintf("/%s/%s", trigger.GetNamespace(), trigger.GetEntityName())
63 params = append(params, getFormattedJSON(FEED_LIFECYCLE_EVENT, lifecycle))
64 params = append(params, getFormattedJSON(FEED_TRIGGER_NAME, name))
65 params = append(params, getFormattedJSON(FEED_AUTH_KEY, authKey))
66
67 feedQualifiedName, err := NewQualifiedName(feed)
68 if err != nil {
69 ExitOnError(NewQualifiedNameError(feed, err))
70 }
71
72 return feedQualifiedName, params
73}
74
75/**
76 * Create or update a trigger.

Callers 2

CreateMethod · 0.85
CreateExtendedVersionFunction · 0.85

Calls 6

getFormattedJSONFunction · 0.85
NewQualifiedNameFunction · 0.85
ExitOnErrorFunction · 0.85
NewQualifiedNameErrorFunction · 0.85
GetNamespaceMethod · 0.80
GetEntityNameMethod · 0.80

Tested by

no test coverage detected