Skip to content

Commit

Permalink
add condition commands
Browse files Browse the repository at this point in the history
  • Loading branch information
noguxun committed Sep 8, 2023
1 parent 4b869ab commit baa4ff9
Show file tree
Hide file tree
Showing 13 changed files with 1,068 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/api/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ type Interface interface {
GetERL(i *fastly.GetERLInput) (*fastly.ERL, error)
ListERLs(i *fastly.ListERLsInput) ([]*fastly.ERL, error)
UpdateERL(i *fastly.UpdateERLInput) (*fastly.ERL, error)

CreateCondition(i *fastly.CreateConditionInput) (*fastly.Condition, error)
DeleteCondition(i *fastly.DeleteConditionInput) error
GetCondition(i *fastly.GetConditionInput) (*fastly.Condition, error)
ListConditions(i *fastly.ListConditionsInput) ([]*fastly.Condition, error)
UpdateCondition(i *fastly.UpdateConditionInput) (*fastly.Condition, error)
}

// RealtimeStatsInterface is the subset of go-fastly's realtime stats API used here.
Expand Down
13 changes: 13 additions & 0 deletions pkg/app/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/fastly/cli/pkg/commands/authtoken"
"github.com/fastly/cli/pkg/commands/backend"
"github.com/fastly/cli/pkg/commands/compute"
"github.com/fastly/cli/pkg/commands/condition"
"github.com/fastly/cli/pkg/commands/config"
"github.com/fastly/cli/pkg/commands/configstore"
"github.com/fastly/cli/pkg/commands/configstoreentry"
Expand Down Expand Up @@ -119,6 +120,12 @@ func defineCommands(
computeServe := compute.NewServeCommand(computeCmdRoot.CmdClause, g, computeBuild, opts.Versioners.Viceroy, m)
computeUpdate := compute.NewUpdateCommand(computeCmdRoot.CmdClause, g, m)
computeValidate := compute.NewValidateCommand(computeCmdRoot.CmdClause, g, m)
conditionCmdRoot := condition.NewRootCommand(app, g)
conditionCreate := condition.NewCreateCommand(conditionCmdRoot.CmdClause, g, m)
conditionDelete := condition.NewDeleteCommand(conditionCmdRoot.CmdClause, g, m)
conditionDescribe := condition.NewDescribeCommand(conditionCmdRoot.CmdClause, g, m)
conditionList := condition.NewListCommand(conditionCmdRoot.CmdClause, g, m)
conditionUpdate := condition.NewUpdateCommand(conditionCmdRoot.CmdClause, g, m)
configCmdRoot := config.NewRootCommand(app, g)
configstoreCmdRoot := configstore.NewRootCommand(app, g)
configstoreCreate := configstore.NewCreateCommand(configstoreCmdRoot.CmdClause, g, m)
Expand Down Expand Up @@ -477,6 +484,12 @@ func defineCommands(
computeServe,
computeUpdate,
computeValidate,
conditionCmdRoot,
conditionCreate,
conditionDelete,
conditionDescribe,
conditionList,
conditionUpdate,
configCmdRoot,
configstoreCmdRoot,
configstoreCreate,
Expand Down
27 changes: 27 additions & 0 deletions pkg/app/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,33 @@
]
}
},
"condition": {
"create": {
"apis": [
"https://developer.fastly.com/reference/api/vcl-services/condition/#create-condition"
]
},
"delete": {
"apis": [
"https://developer.fastly.com/reference/api/vcl-services/condition/#delete-condition"
]
},
"describe": {
"apis": [
"https://developer.fastly.com/reference/api/vcl-services/condition/#get-condition"
]
},
"list": {
"apis": [
"https://developer.fastly.com/reference/api/vcl-services/condition/#list-conditions"
]
},
"update": {
"apis": [
"https://developer.fastly.com/reference/api/vcl-services/condition/#update-condition"
]
}
},
"config-store-entry": {
"delete": {
"examples": [
Expand Down
1 change: 1 addition & 0 deletions pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ acl-entry
auth-token
backend
compute
condition
config
config-store
config-store-entry
Expand Down
Loading

0 comments on commit baa4ff9

Please sign in to comment.