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

fix: report an error when unknown commands are given #486

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion docs/metal_device_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Updates a device.
Updates the hostname of a device. Updates or adds a description, tags, userdata, custom data, and iPXE settings for an already provisioned device. Can also lock or unlock future changes to the device.

```
metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata> | --userdata-file <filepath>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>] [flags]
metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked=<true|false>] [-t <tags>] [-u <userdata> | --userdata-file <filepath>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>] [flags]
```

### Examples
Expand Down
1 change: 1 addition & 0 deletions internal/capacity/capacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *Client) NewCommand() *cobra.Command {
Use: "capacity",
Short: `Capacity operations: get, check`,
Long: "Capacity operations. For more information on capacity in metros, visit https://deploy.equinix.com/developers/docs/metal/locations/metros/ For more information on capacity in facilities, visit https://deploy.equinix.com/developers/docs/metal/locations/facilities/.",
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/capacity/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (c *Client) Check() *cobra.Command {

# Checks if Silicon Valley or Dallas has either 4 c3.medium.x86 or m3.large.x86
metal capacity check -m sv,da -P c3.medium.x86,m3.large.x86 -q 4`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
var locationField string
var returnOut error
Expand Down
2 changes: 1 addition & 1 deletion internal/capacity/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *Client) Retrieve() *cobra.Command {

# Returns c3.large.arm and c3.medium.x86 capacity in the Silicon Valley, New York, and Dallas metros:
metal capacity get --metros sv,ny,da -P c3.large.arm,c3.medium.x86`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
var err error
var locationField string
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (c *Client) NewCommand() *cobra.Command {
Short: "Command line interface for Equinix Metal",
Long: `Command line interface for Equinix Metal`,
DisableAutoGenTag: true,

Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
c.Config(cmd)
},
Expand Down
2 changes: 1 addition & 1 deletion internal/devices/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *Client) Create() *cobra.Command {

# Provisions a c3.medium.x86 in Silicon Valley, running Rocky Linux, from a hardware reservation:
metal device create -p $METAL_PROJECT_ID -P c3.medium.x86 -m sv -H test-rocky -O rocky_8 -r 47161704-1715-4b45-8549-fb3f4b2c32c7`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if userdata != "" && userdataFile != "" {
return fmt.Errorf("either userdata or userdata-file should be set")
Expand Down
2 changes: 1 addition & 1 deletion internal/devices/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (c *Client) Delete() *cobra.Command {

# Deletes a VLAN, skipping confirmation:
metal device delete -f -i 7ec86e23-8dcf-48ed-bd9b-c25c20958277`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
2 changes: 1 addition & 1 deletion internal/devices/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"server", "servers", "devices"},
Short: "Device operations: create, get, update, delete, reinstall, start, stop, and reboot.",
Long: "Device operations that control server provisioning, metadata, and basic operations.",

Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/devices/reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *Client) Reboot() *cobra.Command {
Long: "Reboots the specified device.",
Example: ` # Reboots the specified device:
metal device reboot --id 26a9da5f-a0db-41f6-8467-827e144e59a7`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
DeviceAction := metal.NewDeviceActionInput("reboot")
Expand Down
1 change: 1 addition & 0 deletions internal/devices/reinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (c *Client) Reinstall() *cobra.Command {

# Reinstalls a device with Ubuntu 22.04 while preserving the data on non-OS disks:
metal device reinstall -d 50382f72-02b7-4b40-ac8d-253713e1e174 -O ubuntu_22_04 --preserve-data`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {

DeviceAction := metal.NewDeviceActionInput("reinstall")
Expand Down
2 changes: 1 addition & 1 deletion internal/devices/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (c *Client) Retrieve() *cobra.Command {

# Get a list of devices with the hostname foo and a default project configured:
metal device get --filter hostname=foo`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
deviceID, _ := cmd.Flags().GetString("id")
projectID, _ := cmd.Flags().GetString("project-id")
Expand Down
2 changes: 1 addition & 1 deletion internal/devices/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *Client) Start() *cobra.Command {
Long: "Starts or powers on a device that is currently stopped or powered off.",
Example: ` # Starts the specified device:
metal device start --id 26a9da5f-a0db-41f6-8467-827e144e59a7`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
DeviceAction := metal.NewDeviceActionInput("power_on")
Expand Down
2 changes: 1 addition & 1 deletion internal/devices/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *Client) Stop() *cobra.Command {
Long: "Stops or powers off a device that is currently started or powered on.",
Example: ` # Stops the specified device:
metal device stop --id [device_UUID]`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
DeviceAction := metal.NewDeviceActionInput("power_off")
Expand Down
18 changes: 9 additions & 9 deletions internal/devices/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
func (c *Client) Update() *cobra.Command {
var (
description string
locked bool
userdata string
userdataFile string
hostname string
Expand All @@ -46,7 +45,7 @@ func (c *Client) Update() *cobra.Command {
)
// updateDeviceCmd represents the updateDevice command
updateDeviceCmd := &cobra.Command{
Use: `update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata> | --userdata-file <filepath>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>]`,
Use: `update -i <device_id> [-H <hostname>] [-d <description>] [--locked=<true|false>] [-t <tags>] [-u <userdata> | --userdata-file <filepath>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>]`,
Short: "Updates a device.",
Long: "Updates the hostname of a device. Updates or adds a description, tags, userdata, custom data, and iPXE settings for an already provisioned device. Can also lock or unlock future changes to the device.",
Example: ` # Updates the hostname of a device:
Expand All @@ -64,10 +63,6 @@ func (c *Client) Update() *cobra.Command {
deviceUpdate.Description = &description
}

if userdata != "" && userdataFile != "" {
return fmt.Errorf("either userdata or userdata-file should be set")
}

if userdataFile != "" {
userdataRaw, readErr := os.ReadFile(userdataFile)
if readErr != nil {
Expand All @@ -80,7 +75,11 @@ func (c *Client) Update() *cobra.Command {
deviceUpdate.Userdata = &userdata
}

if locked {
if cmd.Flag("locked").Changed {
locked, err := cmd.Flags().GetBool("locked")
if err != nil {
return fmt.Errorf("could not parse locked value: %w", err)
}
deviceUpdate.Locked = &locked
}

Expand Down Expand Up @@ -123,12 +122,13 @@ func (c *Client) Update() *cobra.Command {
updateDeviceCmd.Flags().StringVarP(&description, "description", "d", "", "Adds or updates the description for the device.")
updateDeviceCmd.Flags().StringVarP(&userdata, "userdata", "u", "", "Adds or updates the userdata for the device.")
updateDeviceCmd.Flags().StringVarP(&userdataFile, "userdata-file", "", "", "Path to a userdata file for device initialization. Can not be used with --userdata.")
updateDeviceCmd.Flags().BoolVarP(&locked, "locked", "l", false, "Locks or unlocks the device for future changes (<true|false>).")
updateDeviceCmd.Flags().BoolP("locked", "l", false, "Locks or unlocks the device for future changes (<true|false>).")
updateDeviceCmd.Flags().StringSliceVarP(&tags, "tags", "t", []string{}, `Adds or updates the tags for the device --tags="tag1,tag2".`)
updateDeviceCmd.Flags().BoolVarP(&alwaysPXE, "always-pxe", "a", false, "Updates the always_pxe toggle for the device (<true|false>).")
updateDeviceCmd.Flags().StringVarP(&ipxescripturl, "ipxe-script-url", "s", "", "Add or update the URL of the iPXE script.")
updateDeviceCmd.Flags().StringVarP(&customdata, "customdata", "c", "", "Adds or updates custom data to be included with your device's metadata.")
_ = updateDeviceCmd.MarkFlagRequired("id")

updateDeviceCmd.MarkFlagsMutuallyExclusive("userdata", "userdata-file")
updateDeviceCmd.Args = cobra.NoArgs
return updateDeviceCmd
}
1 change: 1 addition & 0 deletions internal/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (c *Client) NewCommand() *cobra.Command {
metal env | source`,

DisableFlagsInUseLine: true,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
var formatter func(token, orgID, projID, conPath string) map[string]string

Expand Down
1 change: 1 addition & 0 deletions internal/events/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"events"},
Short: "Events operations: get.",
Long: "Events information for organizations, projects, devices, and the current user.",
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/events/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (c *Client) Retrieve() *cobra.Command {

# Retrieve all events of a device:
metal event get -d ca614540-fbd4-4dbb-9689-457c6ccc8353`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
var events []metal.Event
Expand Down
1 change: 1 addition & 0 deletions internal/facilities/facility.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"facility"},
Short: "Facility operations: get.",
Long: "Information about specific facilities. Facility-level operations have mostly been replaced by Metros, but remains for backwards-compatibility. Documentation about facilities is available at https://deploy.equinix.com/developers/docs/metal/locations/facilities/.",
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/facilities/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (c *Client) Retrieve() *cobra.Command {
Long: "Retrieves a list of facilities available to the current user.",
Example: ` # Lists facilities for current user:
metal facilities get`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
var (
facilityList *metalv1.FacilityList
Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *Client) Create() *cobra.Command {

# Creates a Metal Gateway on the VLAN with a Private 10.x.x.x/28 subnet:
metal gateway create -p $METAL_PROJECT_ID --virtual-network 77e6d57a-d7a4-4816-b451-cf9b043444e2 --private-subnet-size 16`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
includes := []string{"virtual_network", "ip_reservation"}
Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/createbgpneighbours.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *Client) CreateBgpNeighbors() *cobra.Command {

metal gateways create-bgp-dynamic-neighbor --id "9c56fa1d-ec05-470b-a938-0e5dd6a1540c" --bgp-neighbor-range "10.70.43.226/29" --asn 65000
`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (c *Client) Delete() *cobra.Command {

# Deletes a Gateway, skipping confirmation.
metal gateway delete -f -i 77e6d57a-d7a4-4816-b451-cf9b043444e2`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/deletebgpneighbours.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (c *Client) DeleteBgpNeighbors() *cobra.Command {

BGP Dynamic Neighbor deletion initiated. Please check 'metal gateway get-bgp-dynamic-neighbor -i 9c56fa1d-ec05-470b-a938-0e5dd6a1540c for status
`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"gateways", "metal-gateway", "metal-gateways"},
Short: "Metal Gateway operations: create, delete, and retrieve.",
Long: "A Metal Gateway provides a single IPv4 address as a gateway for a subnet. For more information, visit https://deploy.equinix.com/developers/docs/metal/networking/metal-gateway/.",

Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/getbgpneighbours.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (c *Client) GetBgpNeighbors() *cobra.Command {

$ metal gateways get-bgp-dynamic-neighbor --id "9c56fa1d-ec05-470b-a938-0e5dd6a1540c"
`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/listbgpneighbours.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (c *Client) ListBgpNeighbors() *cobra.Command {

$ metal gateways list-bgp-dynamic-neighbor --id "9c56fa1d-ec05-470b-a938-0e5dd6a1540c"
`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (c *Client) Retrieve() *cobra.Command {
Example: `
# Lists Metal Gateways for project 3b0795ba-ec9a-4a9e-83a7-043e7e11407c:
metal gateways get -p 3b0795ba-ec9a-4a9e-83a7-043e7e11407c`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
includes := []string{"virtual_network", "ip_reservation", "vrf"}
Expand Down
1 change: 1 addition & 0 deletions internal/hardware/hardware.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"hardware-reservations", "hardware"},
Short: "Hardware reservation operations: get, move.",
Long: "Information and operations on Hardware Reservations. Provisioning specific devices from a reservation can be performed with the `metal device` command. Documentation is available on https://deploy.equinix.com/developers/docs/metal/deploy/reserved/.",
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/hardware/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (c *Client) Move() *cobra.Command {
Long: "Moves a hardware reservation to a specified project. Both the hardware reservation ID and the Project ID for the destination project are required.",
Example: ` # Moves a hardware reservation to the specified Project:
metal hardware-reservation move -i 8404b73c-d18f-4190-8c49-20bb17501f88 -p 278bca90-f6b2-4659-b1a4-1bdffa0d80b7`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
header := []string{"ID", "Facility", "Plan", "Created"}
Expand Down
2 changes: 1 addition & 1 deletion internal/hardware/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (c *Client) Retrieve() *cobra.Command {

# Retrieve the details of a specific hardware reservation:
metal hardware-reservations get -i 8404b73c-d18f-4190-8c49-20bb17501f88`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
projectID, _ := cmd.Flags().GetString("project-id")
hardwareReservationID, _ := cmd.Flags().GetString("id")
Expand Down
1 change: 1 addition & 0 deletions internal/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (c *Client) NewCommand() *cobra.Command {
organization-id: 253e9cf1-5b3d-41f5-a4fa-839c130c8c1d`,

DisableFlagsInUseLine: true,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
cmd.SilenceUsage = true
Expand Down
12 changes: 6 additions & 6 deletions internal/interconnections/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (c *Client) Create() *cobra.Command {
var interconn *metal.Interconnection
var err error

if err := validInputArgs(projectID, organizationID, connType, vlans, vrfs, svcTokenType); err != nil {
if err := validInputArgs(connType, vlans, vrfs, svcTokenType); err != nil {
return err
}

Expand Down Expand Up @@ -96,6 +96,10 @@ func (c *Client) Create() *cobra.Command {
_ = createInterconnectionsCmd.MarkFlagRequired("metro")
_ = createInterconnectionsCmd.MarkFlagRequired("redundancy")
_ = createInterconnectionsCmd.MarkFlagRequired("type")

createInterconnectionsCmd.MarkFlagsOneRequired("organization-id", "project-id")
createInterconnectionsCmd.Args = cobra.NoArgs

return createInterconnectionsCmd
}

Expand Down Expand Up @@ -125,11 +129,7 @@ func (c *Client) handleCreate(projectID, organizationID string,
return interconn, err
}

func validInputArgs(projectID, organizationID, connType string, vlans []int32, vrfs []string, svcTokenType string) error {
if projectID == "" && organizationID == "" {
return errors.New("could you provide at least either of projectID OR organizationID")
}

func validInputArgs(connType string, vlans []int32, vrfs []string, svcTokenType string) error {
if (vlanFabricVcCreate(connType, vlans) || vrfsFabricVcCreate(connType, vrfs)) && svcTokenType == "" {
return errors.New("flag 'service-token-type' is required for vlan or vrfs fabric VC create")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/interconnections/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (c *Client) Delete() *cobra.Command {
>
✔ Are you sure you want to delete device 7ec86e23-8dcf-48ed-bd9b-c25c20958277 [Y/n]: Y
`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

Expand Down
1 change: 1 addition & 0 deletions internal/interconnections/interconnections.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"conn"},
Short: "interconnections operations: create, get, update, delete",
Long: "Get information on Metro locations. For more information on https://deploy.equinix.com/developers/docs/metal/interconnections.",
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/interconnections/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *Client) Retrieve() *cobra.Command {

# Retrieve all interconnection of a project:
metal interconnections get -p 1867ee8f-6a11-470a-9505-952d6a324040 `,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
var interConns []metal.Interconnection
Expand Down
2 changes: 1 addition & 1 deletion internal/interconnections/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *Client) Update() *cobra.Command {
Long: "Updates a specified connection.",
Example: ` # Updates a specified connection.:
metal interconnections update --id 30c15082-a06e-4c43-bfc3-252616b46eba -n [<name>] -d [<description>] -r [<'redundant'|'primary'>]-m [<standard|tunnel>] -e [<E-mail>] --tags="tag1,tag2"`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
intInput := metal.NewInterconnectionUpdateInput()
Expand Down
2 changes: 1 addition & 1 deletion internal/ips/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *Client) Assign() *cobra.Command {
Long: "Assigns an IP address and subnet to a specified device. Returns an assignment ID.",
Example: ` # Assigns an IP address to a server:
metal ip assign -d 060d1626-2481-475a-9789-c6f4bb927303 -a 198.51.100.3/31`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
IPAssignmentInput := metal.NewIPAssignmentInput(address)
Expand Down
Loading
Loading