You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CDTOOL-1217 add CRUD operations for ngwaf custom signals at the account and workspace levels (#1592)
### Change summary
Add CRUD operations for account and workspace level custom signals
All Submissions:
* [x] Have you followed the guidelines in our Contributing document?
* [x] Have you checked to ensure there aren't other open [Pull
Requests](https://github.com/fastly/cli/pulls) for the same
update/change?
<!-- You can erase any parts of this template not applicable to your
Pull Request. -->
### New Feature Submissions:
* [ ] Does your submission pass tests?
### Changes to Core Features:
* [x] Have you written new tests for your core changes, as applicable?
* [x] Have you successfully run tests with your changes locally?
c.CmdClause=parent.Command("create", "Create an account-level custom signal").Alias("add")
38
+
39
+
// Required.
40
+
c.CmdClause.Flag("name", "User submitted display name of a custom signal. Is immutable and must be between 3 and 25 characters").Required().StringVar(&c.name)
41
+
42
+
// Optional.
43
+
c.CmdClause.Flag("description", "User submitted description of a custom signal.").Action(c.description.Set).StringVar(&c.description.Value)
44
+
c.RegisterFlagBool(c.JSONFlag())
45
+
46
+
return&c
47
+
}
48
+
49
+
// Exec invokes the application logic for the command.
50
+
func (c*CreateCommand) Exec(_ io.Reader, out io.Writer) error {
51
+
ifc.Globals.Verbose() &&c.JSONOutput.Enabled {
52
+
returnfsterr.ErrInvalidVerboseJSONCombo
53
+
}
54
+
varerrerror
55
+
input:=&signals.CreateInput{
56
+
Name: &c.name,
57
+
Scope: &scope.Scope{
58
+
Type: scope.ScopeTypeAccount,
59
+
AppliesTo: []string{"*"},
60
+
},
61
+
}
62
+
ifc.description.WasSet {
63
+
input.Description=&c.description.Value
64
+
}
65
+
66
+
fc, ok:=c.Globals.APIClient.(*fastly.Client)
67
+
if!ok {
68
+
returnerrors.New("failed to convert interface to a fastly client")
0 commit comments