Skip to content

Commit bbe9dcc

Browse files
Add jsonpath cmd
1 parent a12e989 commit bbe9dcc

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

cmd/jsonpath/jsonpath.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package jsonpath
2+
3+
import (
4+
_ "embed"
5+
6+
"github.com/sailpoint-oss/sailpoint-cli/internal/util"
7+
"github.com/spf13/cobra"
8+
)
9+
10+
//go:embed jsonpath.md
11+
var jsonpathHelp string
12+
13+
func NewJSONPathCmd() *cobra.Command {
14+
help := util.ParseHelp(jsonpathHelp)
15+
cmd := &cobra.Command{
16+
Use: "jsonpath",
17+
Short: "JSONPath validation for workflows and event triggers",
18+
Long: help.Long,
19+
Example: help.Example,
20+
Aliases: []string{"jp"},
21+
Args: cobra.MaximumNArgs(1),
22+
23+
Run: func(cmd *cobra.Command, args []string) {
24+
cmd.Help()
25+
},
26+
}
27+
28+
// log.Info("Hello World!")
29+
30+
return cmd
31+
}

cmd/jsonpath/jsonpath.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
==Long==
2+
# JSONPath Validator
3+
JSONPath validation for workflows and event triggers.
4+
5+
References:
6+
- https://developer.sailpoint.com/docs/extensibility/event-triggers/filtering-events
7+
- https://documentation.sailpoint.com/saas/help/workflows/workflow-basics.html#trigger_filter
8+
====
9+
10+
==Example==
11+
12+
```bash
13+
sail spconfig jsonpath
14+
```
15+
16+
====

cmd/root/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/sailpoint-oss/sailpoint-cli/cmd/cluster"
77
"github.com/sailpoint-oss/sailpoint-cli/cmd/connector"
88
"github.com/sailpoint-oss/sailpoint-cli/cmd/environment"
9+
"github.com/sailpoint-oss/sailpoint-cli/cmd/jsonpath"
910
"github.com/sailpoint-oss/sailpoint-cli/cmd/report"
1011
"github.com/sailpoint-oss/sailpoint-cli/cmd/rule"
1112
"github.com/sailpoint-oss/sailpoint-cli/cmd/sanitize"
@@ -53,6 +54,7 @@ func NewRootCommand() *cobra.Command {
5354
cluster.NewClusterCommand(),
5455
connector.NewConnCmd(t),
5556
environment.NewEnvironmentCommand(),
57+
jsonpath.NewJSONPathCmd(),
5658
report.NewReportCommand(),
5759
sdk.NewSDKCommand(),
5860
search.NewSearchCommand(),

0 commit comments

Comments
 (0)