-
Notifications
You must be signed in to change notification settings - Fork 154
plugin for MR #845
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
base: dev
Are you sure you want to change the base?
plugin for MR #845
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yec-akamai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command looks not quite right in regards to the url call. Can you make changes according to the comments?
| from linodecli.help_formatter import SortingHelpFormatter | ||
| from linodecli.helpers import register_debug_arg | ||
|
|
||
| PLUGIN_BASE = "linode-cli get_metrics" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion the plugin base should be more generic, and allow the commend to be a specific operation, i.e.
PLUGIN_BASE = "linode-cli monitor-api"
and implement a command get-metrics
| PLUGIN_BASE = "linode-cli get_metrics" | ||
|
|
||
| # API Configuration | ||
| API_BASE_URL = "https://monitor-api.linode.com/v2/monitor/services" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base url should be just
https://monitor-api.linode.com
so you can allow to specify the api version. And in each command, i.e. get-metrics, you can build the specific url.
📝 Description
A CLI plugin for the ACLP metric-read-api
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
linode-cli get_metrics dbaas --entity-ids 123 --duration 15 --duration-unit min --metrics cpu_usage:avg --filters 'node_type:in:primary,secondary'
the help command prints the list of sample commands. A JWE token is required to be set to make these calls.
details on generating JWE token https://techdocs.akamai.com/linode-api/reference/post-get-token
API details: https://techdocs.akamai.com/linode-api/reference/post-read-metric
How do I run the relevant unit/integration tests?
python -m pytest tests/unit/test_plugin_get_metrics.py -v
for integration set, set a JWE_TOKEN env var for service type objectstorage
python -m pytest tests/integration/monitor/test_plugin_get_metrics.py -v