Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
- refactor(argparser/flags.go): add flag conversion utilities for converting string flags to bools and checking ascending and desecnding flags ([#1611](https://github.com/fastly/cli/pull/1611))
- feat(service/purge): Add 'service purge' command as replacement for 'purge', with an unlisted and deprecated alias of 'purge'. ([#1612](https://github.com/fastly/cli/pull/1612))
- feat(service/version): Add 'service version ...' commands as replacements for 'service-version ...', with unlisted and deprecated aliases of 'service-version ...'. ([#1614](https://github.com/fastly/cli/pull/1614))
- feat(vcl): moved the `vcl` command under the `service` command, with an unlisted and deprecated alias of `vcl` ([#1616](https://github.com/fastly/cli/pull/1616))
- feat(service/vcl): moved the `vcl` command under the `service` command, with an unlisted and deprecated alias of `vcl` ([#1616](https://github.com/fastly/cli/pull/1616))
- feat(service/healthcheck): moved the `healthcheck` command under the `service` command, with an unlisted and deprecated alias of `healthcheck` ([#1619](https://github.com/fastly/cli/pull/1619))

### Bug fixes:

Expand Down
1 change: 0 additions & 1 deletion pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ dashboard
dictionary
dictionary-entry
domain
healthcheck
imageoptimizer
install
ip-list
Expand Down
29 changes: 29 additions & 0 deletions pkg/commands/alias/healthcheck/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package healthcheck

import (
"io"

servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// CreateCommand wraps the CreateCommand from the servicehealthcheck package.
type CreateCommand struct {
*servicehealthcheck.CreateCommand
}

// NewCreateCommand returns a usable command registered under the parent.
func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateCommand {
c := CreateCommand{servicehealthcheck.NewCreateCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *CreateCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service healthcheck create' command instead.")
return c.CreateCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/healthcheck/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package healthcheck

import (
"io"

servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// DeleteCommand wraps the DeleteCommand from the servicehealthcheck package.
type DeleteCommand struct {
*servicehealthcheck.DeleteCommand
}

// NewDeleteCommand returns a usable command registered under the parent.
func NewDeleteCommand(parent argparser.Registerer, g *global.Data) *DeleteCommand {
c := DeleteCommand{servicehealthcheck.NewDeleteCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *DeleteCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service healthcheck delete' command instead.")
return c.DeleteCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/healthcheck/describe.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package healthcheck

import (
"io"

servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// DescribeCommand wraps the DescribeCommand from the servicehealthcheck package.
type DescribeCommand struct {
*servicehealthcheck.DescribeCommand
}

// NewDescribeCommand returns a usable command registered under the parent.
func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCommand {
c := DescribeCommand{servicehealthcheck.NewDescribeCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *DescribeCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service healthcheck describe' command instead.")
return c.DescribeCommand.Exec(in, out)
}
2 changes: 2 additions & 0 deletions pkg/commands/alias/healthcheck/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package healthcheck contains the 'healthcheck' alias for the 'service healthcheck' command.
package healthcheck
29 changes: 29 additions & 0 deletions pkg/commands/alias/healthcheck/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package healthcheck

import (
"io"

servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// ListCommand wraps the ListCommand from the servicehealthcheck package.
type ListCommand struct {
*servicehealthcheck.ListCommand
}

// NewListCommand returns a usable command registered under the parent.
func NewListCommand(parent argparser.Registerer, g *global.Data) *ListCommand {
c := ListCommand{servicehealthcheck.NewListCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *ListCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service healthcheck list' command instead.")
return c.ListCommand.Exec(in, out)
}
27 changes: 27 additions & 0 deletions pkg/commands/alias/healthcheck/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package healthcheck

import (
"io"

servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
)

// RootCommand wraps the RootCommand from the servicehealthcheck package.
type RootCommand struct {
*servicehealthcheck.RootCommand
}

// NewRootCommand returns a usable command registered under the parent.
func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
c := RootCommand{servicehealthcheck.NewRootCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *RootCommand) Exec(in io.Reader, out io.Writer) error {
return c.RootCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/healthcheck/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package healthcheck

import (
"io"

servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// UpdateCommand wraps the UpdateCommand from the servicehealthcheck package.
type UpdateCommand struct {
*servicehealthcheck.UpdateCommand
}

// NewUpdateCommand returns a usable command registered under the parent.
func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateCommand {
c := UpdateCommand{servicehealthcheck.NewUpdateCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service healthcheck update' command instead.")
return c.UpdateCommand.Exec(in, out)
}
28 changes: 20 additions & 8 deletions pkg/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/fastly/cli/pkg/commands/acl"
"github.com/fastly/cli/pkg/commands/aclentry"
"github.com/fastly/cli/pkg/commands/alerts"
aliashealthcheck "github.com/fastly/cli/pkg/commands/alias/healthcheck"
aliaspurge "github.com/fastly/cli/pkg/commands/alias/purge"
aliasvcl "github.com/fastly/cli/pkg/commands/alias/vcl"
aliasvclcondition "github.com/fastly/cli/pkg/commands/alias/vcl/condition"
Expand All @@ -25,7 +26,6 @@ import (
"github.com/fastly/cli/pkg/commands/dictionary"
"github.com/fastly/cli/pkg/commands/dictionaryentry"
"github.com/fastly/cli/pkg/commands/domain"
"github.com/fastly/cli/pkg/commands/healthcheck"
"github.com/fastly/cli/pkg/commands/imageoptimizerdefaults"
"github.com/fastly/cli/pkg/commands/install"
"github.com/fastly/cli/pkg/commands/ip"
Expand Down Expand Up @@ -99,6 +99,7 @@ import (
"github.com/fastly/cli/pkg/commands/secretstoreentry"
"github.com/fastly/cli/pkg/commands/service"
servicedomain "github.com/fastly/cli/pkg/commands/service/domain"
servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"
servicepurge "github.com/fastly/cli/pkg/commands/service/purge"
servicevcl "github.com/fastly/cli/pkg/commands/service/vcl"
servicevclcondition "github.com/fastly/cli/pkg/commands/service/vcl/condition"
Expand Down Expand Up @@ -233,12 +234,12 @@ func Define( // nolint:revive // function-length
domainDescribe := domain.NewDescribeCommand(domainCmdRoot.CmdClause, data)
domainList := domain.NewListCommand(domainCmdRoot.CmdClause, data)
domainUpdate := domain.NewUpdateCommand(domainCmdRoot.CmdClause, data)
healthcheckCmdRoot := healthcheck.NewRootCommand(app, data)
healthcheckCreate := healthcheck.NewCreateCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckDelete := healthcheck.NewDeleteCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckDescribe := healthcheck.NewDescribeCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckList := healthcheck.NewListCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckUpdate := healthcheck.NewUpdateCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckCmdRoot := aliashealthcheck.NewRootCommand(app, data)
healthcheckCreate := aliashealthcheck.NewCreateCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckDelete := aliashealthcheck.NewDeleteCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckDescribe := aliashealthcheck.NewDescribeCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckList := aliashealthcheck.NewListCommand(healthcheckCmdRoot.CmdClause, data)
healthcheckUpdate := aliashealthcheck.NewUpdateCommand(healthcheckCmdRoot.CmdClause, data)
imageoptimizerdefaultsCmdRoot := imageoptimizerdefaults.NewRootCommand(app, data)
imageoptimizerdefaultsGet := imageoptimizerdefaults.NewGetCommand(imageoptimizerdefaultsCmdRoot.CmdClause, data)
imageoptimizerdefaultsUpdate := imageoptimizerdefaults.NewUpdateCommand(imageoptimizerdefaultsCmdRoot.CmdClause, data)
Expand Down Expand Up @@ -664,6 +665,12 @@ func Define( // nolint:revive // function-length
servicedomainList := servicedomain.NewListCommand(servicedomainCmdRoot.CmdClause, data)
servicedomainUpdate := servicedomain.NewUpdateCommand(servicedomainCmdRoot.CmdClause, data)
servicedomainValidate := servicedomain.NewValidateCommand(servicedomainCmdRoot.CmdClause, data)
servicehealthcheckCmdRoot := servicehealthcheck.NewRootCommand(serviceCmdRoot.CmdClause, data)
servicehealthcheckCreate := servicehealthcheck.NewCreateCommand(servicehealthcheckCmdRoot.CmdClause, data)
servicehealthcheckDelete := servicehealthcheck.NewDeleteCommand(servicehealthcheckCmdRoot.CmdClause, data)
servicehealthcheckDescribe := servicehealthcheck.NewDescribeCommand(servicehealthcheckCmdRoot.CmdClause, data)
servicehealthcheckList := servicehealthcheck.NewListCommand(servicehealthcheckCmdRoot.CmdClause, data)
servicehealthcheckUpdate := servicehealthcheck.NewUpdateCommand(servicehealthcheckCmdRoot.CmdClause, data)
statsCmdRoot := stats.NewRootCommand(app, data)
statsHistorical := stats.NewHistoricalCommand(statsCmdRoot.CmdClause, data)
statsRealtime := stats.NewRealtimeCommand(statsCmdRoot.CmdClause, data)
Expand Down Expand Up @@ -843,7 +850,6 @@ func Define( // nolint:revive // function-length
domainDescribe,
domainList,
domainUpdate,
healthcheckCmdRoot,
healthcheckCreate,
healthcheckDelete,
healthcheckDescribe,
Expand Down Expand Up @@ -1259,6 +1265,12 @@ func Define( // nolint:revive // function-length
servicedomainList,
servicedomainUpdate,
servicedomainValidate,
servicehealthcheckCmdRoot,
servicehealthcheckCreate,
servicehealthcheckDelete,
servicehealthcheckDescribe,
servicehealthcheckList,
servicehealthcheckUpdate,
serviceVersionActivate,
serviceVersionClone,
serviceVersionCmdRoot,
Expand Down
Loading