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

feat: metal gateway get -i <id> #481

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

displague
Copy link
Member

@displague displague commented Aug 13, 2024

Adds metal gateway get -i:

$ go run ./cmd/metal/ gateways get  -i $METAL_GATEWAY_ID                   
+--------------------------------------+-------+-------+------------------+--------+-------------------------------+-------------------+
|                  ID                  | METRO | VXLAN |    ADDRESSES     | STATE  |            CREATED            |        VRF        |
+--------------------------------------+-------+-------+------------------+--------+-------------------------------+-------------------+
| bd3162f4-4162-408b-8670-f70782fe763e | am    | 1002  | 192.168.100.2/22 | active | 2024-08-02 18:16:23 +0000 UTC | nutanix-vrf-bRkYc |
+--------------------------------------+-------+-------+------------------+--------+-------------------------------+-------------------+
$ go run ./cmd/metal/ gateways get  -p $METAL_PROJECT_ID 
+--------------------------------------+-------+-------+------------------+--------+-------------------------------+-------------------+
|                  ID                  | METRO | VXLAN |    ADDRESSES     | STATE  |            CREATED            |        VRF        |
+--------------------------------------+-------+-------+------------------+--------+-------------------------------+-------------------+
| bd3162f4-4162-408b-8670-f70782fe763e | am    | 1002  | 192.168.100.2/22 | active | 2024-08-02 18:16:23 +0000 UTC | nutanix-vrf-bRkYc |
+--------------------------------------+-------+-------+------------------+--------+-------------------------------+-------------------+

After unsettling project id in ~/.config/equinix/metal.yaml:

$ go run ./cmd/metal/ gateways get 
Error: either id or project-id should be set
Usage:
  metal gateway get [-p <project_UUID>] [-i <gateway_UUID>] [flags]

Aliases:
  get, list

Examples:

  # Lists Metal Gateways for project 3b0795ba-ec9a-4a9e-83a7-043e7e11407c:
  metal gateways get -p 3b0795ba-ec9a-4a9e-83a7-043e7e11407c
  
  # Gets a Metal Gateway with ID 8404b73c-d18f-4190-8c49-20bb17501f88:
  metal gateways get -i 8404b73c-d18f-4190-8c49-20bb17501f88

Flags:
  -h, --help                help for get
  -i, --id string           The UUID of a gateway.
  -p, --project-id string   The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.

Global Flags:
...

Signed-off-by: Marques Johansson <[email protected]>
}

gways := gwayList.GetMetalGateways()
cmd.SilenceUsage = true
includes := []string{"virtual_network", "ip_reservation", "vrf"}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting the relevance to equinix/equinix-sdk-go#64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant