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
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