Conversation
d361d6f to
0617f8c
Compare
It spent about 30 seconds until the results came back. Does it take this long because sdpctl is waiting for the server response (i.e. it is a compute-intensive task in the Controller)? |
The API endpoint requires a resolver and resource type be specified. So, the only way to get all of the resources is to try every combination of resolver and resource type. I suspect the O^2 nature of this to be the issue. If you specify a resolver and resource type when running the command it's fast though. I think the most reasonable option to improve the performance would be changing the API to allow a request without any filtering. Although, I guess a problem with changing the API would be backwards compatibility. We'd still need the current approach for backwards compatibility for a long time. There are three possible solutions client side but I don't like any of them:
So, I agree the performance isn't the best but I'm not really sure of a reasonable way to improve it. If I had to pick one I'd go with option 1 I guess. |
mandopaloooza
left a comment
There was a problem hiding this comment.
@torgermiller Thanks for the explanation!
I'm not necessarily looking for the fix in this PR. I think we can ship it as it is and improve later on if we receive feedback that it needs to run faster. I highly doubt anyone would complain about the speed as long as it returns the correct outputs 😄
Add new command to list resource names.
Example uses:
Get all resource names:
sdpctl sites resources [site-id]Get all resource names from resolver esx and resource folders
Get all resource names from resolvers esx and aws and resources folders and lbs
resources [site-id] --resolver "esx&aws" --resource "folders&lbs"Example output: