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 1 commit
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
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
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
2 changes: 1 addition & 1 deletion internal/ips/available.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *Client) Available() *cobra.Command {
Long: "Lists available IP addresses in a specified reservation for the desired subnet size.",
Example: ` # Lists available IP addresses in a reservation for a /31 subnet:
metal ip available --reservation-id da1bb048-ea6e-4911-8ab9-b95635ca127a --cidr 31`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
Cidr := metal.FindIPAvailabilitiesCidrParameter(strconv.Itoa(cidr))
Expand Down
2 changes: 1 addition & 1 deletion internal/ips/ip.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{"ips", "ip-addresses", "ip-address"},
Short: "IP address, reservations, and assignment operations: assign, unassign, remove, available, request and get.",
Long: "IP address and subnet operations, including requesting IPv4 and IPv6 addresses, assigning and removing IPs to servers, and getting information about subnets and their usage. For more information is available on https://deploy.equinix.com/developers/docs/metal/networking/ip-addresses/.",

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/ips/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *Client) Remove() *cobra.Command {
Long: "Removes an IP address reservation from a project. Any subnets and IP addresses in the reservation will no longer be able to be used by your devices.",
Example: ` # Removes an IP address reservation:
metal ip remove --id a9dfc9d5-ba1a-4d11-8cfc-6e30b9630876`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
_, err := c.IPService.DeleteIPAddress(context.Background(), reservationID).Execute()
Expand Down
2 changes: 1 addition & 1 deletion internal/ips/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *Client) Request() *cobra.Command {
metal ip request -p $METAL_PROJECT_ID -t public_ipv4 -q 4 -m da

metal ip request -v df18fbd8-2919-4104-a042-5d42a05b8eed -t vrf --cidr 24 -n 172.89.1.0 --tags foo --tags bar --customdata '{"my":"goodness"}' --details "i don't think VRF users need this or will see it after submitting the request"`,

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

# Gets the IP addresses from a reservation ID:
metal ip get -r da1bb048-ea6e-4911-8ab9-b95635ca127a`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if assignmentID != "" && reservationID != "" {
return fmt.Errorf("either assignment-id or reservation-id can be set")
Expand Down
2 changes: 1 addition & 1 deletion internal/ips/unassign.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *Client) Unassign() *cobra.Command {
Long: "Unassigns an subnet and IP address assignment from a device by its assignment ID. ",
Example: ` # Unassigns an IP address assignment:
metal ip unassign --id abd8674b-96c4-4271-92f5-2eaf5944c86f`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
_, err := c.IPService.DeleteIPAddress(context.Background(), assignmentID).Execute()
Expand Down
1 change: 1 addition & 0 deletions internal/metros/metro.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *Client) NewCommand() *cobra.Command {
Aliases: []string{"metro"},
Short: "Metro operations: get.",
Long: "Get information on Metro locations. For more information on https://deploy.equinix.com/developers/docs/metal/locations/metros/.",
Args: cobra.NoArgs,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if root := cmd.Root(); root != nil {
if root.PersistentPreRun != nil {
Expand Down
Loading
Loading