Skip to content

Commit

Permalink
feat: remove name field from rule
Browse files Browse the repository at this point in the history
  • Loading branch information
anataty authored and kulti committed Jan 7, 2025
1 parent f0e1d42 commit b862131
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
7 changes: 0 additions & 7 deletions internal/app/enaptercli/cmd_rule_engine_rule_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
type cmdRuleEngineRuleCreate struct {
cmdRuleEngineRule
slug string
name string
scriptPath string
runtimeVersion int
execInterval time.Duration
Expand All @@ -43,11 +42,6 @@ func (c *cmdRuleEngineRuleCreate) Flags() []cli.Flag {
Name: "slug",
Usage: "Slug of a new rule",
Destination: &c.slug,
},
&cli.StringFlag{
Name: "name",
Usage: "Name of a new rule",
Destination: &c.name,
Required: true,
},
&cli.StringFlag{
Expand Down Expand Up @@ -87,7 +81,6 @@ func (c *cmdRuleEngineRuleCreate) do(ctx context.Context) error {
body, err := json.Marshal(map[string]any{
"rule": map[string]any{
"slug": c.slug,
"name": c.name,
"script": map[string]any{
"code": base64.StdEncoding.EncodeToString(scriptBytes),
"runtime_version": c.runtimeVersion,
Expand Down
10 changes: 0 additions & 10 deletions internal/app/enaptercli/cmd_rule_engine_rule_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type cmdRuleEngineRuleUpdate struct {
cmdRuleEngineRule
ruleID string
slug string
name string
}

func buildCmdRuleEngineRuleUpdate() *cli.Command {
Expand Down Expand Up @@ -44,11 +43,6 @@ func (c *cmdRuleEngineRuleUpdate) Flags() []cli.Flag {
Usage: "A new rule slug",
Destination: &c.slug,
},
&cli.StringFlag{
Name: "name",
Usage: "A new rule name",
Destination: &c.name,
},
)
}

Expand All @@ -65,10 +59,6 @@ func (c *cmdRuleEngineRuleUpdate) do(cliCtx *cli.Context) error {
payload.Rule["slug"] = c.slug
payload.UpdateMask += "slug,"
}
if cliCtx.IsSet("name") {
payload.Rule["name"] = c.name
payload.UpdateMask += "name,"
}

payload.UpdateMask = strings.TrimSuffix(payload.UpdateMask, ",")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ USAGE:
OPTIONS:
--verbose log extra details about operation (default: false)
--slug value Slug of a new rule
--name value Name of a new rule
--script value Path to a file containing the script code
--runtime-version value Version of a runtime to use for the script execution (default: 3)
--exec-interval value How often to execute the script. This option is only compatible with the runtime version 1 (default: 0s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ OPTIONS:
--verbose log extra details about operation (default: false)
--rule-id value Rule ID or slug to update
--slug value A new rule slug
--name value A new rule name
--help, -h show help

ENVIRONMENT VARIABLES:
Expand Down

0 comments on commit b862131

Please sign in to comment.