Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add condition commands #1008

Merged
merged 4 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ make test TEST_ARGS="-run <...> <path>"
**Example**:

```sh
make test TEST_ARGS="-run TestBackendCreate ./pkg/backend/..."
make test TEST_ARGS="-run TestBackendCreate ./pkg/commands/backend"
```

Some integration tests aren't run outside of the CI environment, to enable these tests locally you'll need to set a specific environment variable relevant to the test.
Expand Down
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 @@ -70,6 +70,7 @@ import (
"github.com/fastly/cli/pkg/commands/update"
"github.com/fastly/cli/pkg/commands/user"
"github.com/fastly/cli/pkg/commands/vcl"
"github.com/fastly/cli/pkg/commands/vcl/condition"
"github.com/fastly/cli/pkg/commands/vcl/custom"
"github.com/fastly/cli/pkg/commands/vcl/snippet"
"github.com/fastly/cli/pkg/commands/version"
Expand Down Expand Up @@ -426,6 +427,12 @@ func defineCommands(
userList := user.NewListCommand(userCmdRoot.CmdClause, g, m)
userUpdate := user.NewUpdateCommand(userCmdRoot.CmdClause, g, m)
vclCmdRoot := vcl.NewRootCommand(app, g)
vclConditionCmdRoot := condition.NewRootCommand(vclCmdRoot.CmdClause, g)
vclConditionCreate := condition.NewCreateCommand(vclConditionCmdRoot.CmdClause, g, m)
vclConditionDelete := condition.NewDeleteCommand(vclConditionCmdRoot.CmdClause, g, m)
vclConditionDescribe := condition.NewDescribeCommand(vclConditionCmdRoot.CmdClause, g, m)
vclConditionList := condition.NewListCommand(vclConditionCmdRoot.CmdClause, g, m)
vclConditionUpdate := condition.NewUpdateCommand(vclConditionCmdRoot.CmdClause, g, m)
vclCustomCmdRoot := custom.NewRootCommand(vclCmdRoot.CmdClause, g)
vclCustomCreate := custom.NewCreateCommand(vclCustomCmdRoot.CmdClause, g, m)
vclCustomDelete := custom.NewDeleteCommand(vclCustomCmdRoot.CmdClause, g, m)
Expand Down Expand Up @@ -780,6 +787,12 @@ func defineCommands(
userList,
userUpdate,
vclCmdRoot,
vclConditionCmdRoot,
vclConditionCreate,
vclConditionDelete,
vclConditionDescribe,
vclConditionList,
vclConditionUpdate,
vclCustomCmdRoot,
vclCustomCreate,
vclCustomDelete,
Expand Down
27 changes: 27 additions & 0 deletions pkg/app/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,33 @@
}
},
"vcl": {
"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"
]
}
},
"custom": {
"create": {
"apis": [
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
Integralist marked this conversation as resolved.
Show resolved Hide resolved
config
config-store
config-store-entry
Expand Down
Loading
Loading