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

can't filter capacity list by metro or facility #158

Open
displague opened this issue Nov 30, 2021 · 3 comments · Fixed by #161
Open

can't filter capacity list by metro or facility #158

displague opened this issue Nov 30, 2021 · 3 comments · Fixed by #161
Labels
bug Something isn't working
Milestone

Comments

@displague
Copy link
Member

What happened?

Capacity filtering by metro or facility does not work as documented:
metal capacity get -m DA should return a only plans in that metro. All metros are returned instead.

The same problem occurs when filtering by facility.

How can we reproduce it?

metal capacity get -m DA | grep SV

CLI version (metal --version):

@displague
Copy link
Member Author

Reopening as this does not appear to be working in 0.7.0

$ ( cd; go install github.com/equinix/metal-cli/cmd/[email protected])
$ which -a metal
/Users/marques/.local/share/go/bin/metal

The request does not include a metro filter:

$ PACKNGO_DEBUG=1 metal capacity get -m DA
2022/01/12 09:17:21
=======[REQUEST]=============
GET /metal/v1/capacity/metros HTTP/1.1
Host: api.equinix.com
User-Agent: metal-cli/v0.7.0 packngo/v0.20.0
Connection: close
Accept: application/json
Content-Type: application/json
X-Auth-Token: **REDACTED**
X-Consumer-Token: Equinix Metal CLI
Accept-Encoding: gzip

The results are not client-side filtered either.

+-------+------------------------+-------------+
| METRO |          PLAN          |    LEVEL    |
+-------+------------------------+-------------+
| sy    | c3.medium.x86          | normal      |
| pa    | c3.medium.x86          | normal      |
| tr    | c3.small.x86           | limited     |
| ch    | c3.small.x86           | limited     |
...

@displague displague reopened this Jan 12, 2022
@cprivitere
Copy link
Contributor

#161 fixes metal capacity check, not metal capacity get.

@displague
Copy link
Member Author

Semi-related issue: metal capacity check --plans c3.small.x86 -q 50 --metros ny,sv,da will combine the command line args plans and metros with the plan and metro found in the ~/.config/equinix/metal.yaml file.

The lists should be unique'd. The lists arguments, when set, should override the defaults from the config file.
We may need a generic way to request the command line argument rather than anything found in the config file. We have this recurring problem #153

@displague displague modified the milestones: 0.7, 0.13 Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants