From 404fd12b2ab027bd8e9db82e37bdd1d1d41bec73 Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Fri, 17 Nov 2023 18:31:42 +0100 Subject: [PATCH] WIP --- cmd/realm/triggers.go | 9 +++++++-- test.json | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 test.json diff --git a/cmd/realm/triggers.go b/cmd/realm/triggers.go index 50643a3..baae1be 100644 --- a/cmd/realm/triggers.go +++ b/cmd/realm/triggers.go @@ -97,7 +97,6 @@ realm, depending on the realm's state. In order to force triggers update, use -- func init() { RealmManagementCmd.AddCommand(triggersCmd) - triggersSyncCmd.Flag("force").NoOptDefVal = "true" triggersCmd.AddCommand( triggersListCmd, triggersShowCmd, @@ -195,7 +194,9 @@ func triggersSaveF(command *cobra.Command, args []string) error { os.Exit(1) } - respJSON, err := json.MarshalIndent(triggerDefinition, "", " ") + + respJSON, err := json.MarshalIndent(*triggerDefinition, "", " ") + fmt.Println(respJSON) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) @@ -405,7 +406,11 @@ func getTriggerDefinition(realm, triggerName string) (*triggers.AstarteTrigger, if err != nil { return nil, err } + +fmt.Println(rawTRigger) + triggerDefinition, _ := rawTRigger.(triggers.AstarteTrigger) + fmt.Println(triggerDefinition) return &triggerDefinition, nil } diff --git a/test.json b/test.json new file mode 100644 index 0000000..ef94f43 --- /dev/null +++ b/test.json @@ -0,0 +1,10 @@ +{ + "name": "", + "action": { + "http_url": "", + "http_method": "", + "http_static_headers": "", + "IgnoreSslErrors": false + }, + "simple_triggers": null +} \ No newline at end of file