Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
eddbbt committed Nov 17, 2023
1 parent b8d5f59 commit 404fd12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/realm/triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down
10 changes: 10 additions & 0 deletions test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "",
"action": {
"http_url": "",
"http_method": "",
"http_static_headers": "",
"IgnoreSslErrors": false
},
"simple_triggers": null
}

0 comments on commit 404fd12

Please sign in to comment.