cloudmesh / cloudmesh-cloud

Multicloud Cloudmesh Plugins for cloudmesh cmd5 CMD
https://cloudmesh.github.io/cloudmesh-manual
Apache License 2.0
2 stars 27 forks source link

Feature/aws flavors api #292

Closed AlexAxthelm closed 4 years ago

AlexAxthelm commented 4 years ago

Updated aws flavor (and flavor --refresh) command to accept queries, and limit overall number of results returned, for quicker testing.

All tests pass, and the new test suite takes ~15 seconds, rather than ~1000 seconds for the old suite.

AlexAxthelm commented 4 years ago

@laszewsk This is my Submission PR. If you have any questions, please contact me on slack.

laszewsk commented 4 years ago

please ony submit a pull request for the AwsFlavor.py file.

The Provider.py integration is done wrong, also as other providers do not need and do not have a query interface the test will also not work. You may need to add a special test_aws_flavor_query.py into tests/aws

A comment on top of the AwsFlavor should be provided on how you suggest the integration so we can assign it to a future student to provide a portable way for it.

Thanks

AlexAxthelm commented 4 years ago

@laszewsk , I've added the note, and removed the external effects of my changes. The one line that is changed in Provider.py is absolutely critical for the changes to work, because the provider needs to pass the boto3 session to the AwsFlavors class, in order for boto3 to authenticate and use the pricing API. Because this is restricted inside the flavors command, there shouldn't be any effects on other commands in the provider.