-
Notifications
You must be signed in to change notification settings - Fork 158
Adding external plugin for ACLP-MR service #823
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,91 @@ | ||||||
| #!/usr/bin/env python3 | ||||||
| from argparse import ArgumentParser | ||||||
| from linodecli.help_formatter import SortingHelpFormatter | ||||||
| import requests | ||||||
| from linodecli.helpers import register_debug_arg | ||||||
| import json | ||||||
| import sys | ||||||
|
|
||||||
| PLUGIN_BASE = "linode-cli monitor-metrics-get" | ||||||
| MANDATORY_HEADER = ["Authorization"] | ||||||
| MANDATORY_DATA = ["metrics","time_granularity"] | ||||||
|
|
||||||
| def get_metadata_parser(): | ||||||
| """ | ||||||
| Builds argparser for Metadata plug-in | ||||||
| """ | ||||||
| parser = ArgumentParser( | ||||||
| PLUGIN_BASE, add_help=False, formatter_class=SortingHelpFormatter, description="Python CLI to make HTTP GET requests to ACLP Metric Read Service" | ||||||
| ) | ||||||
|
|
||||||
| register_debug_arg(parser) | ||||||
|
|
||||||
| parser.add_argument("--url", "-u", required=True, help="URL to request") | ||||||
| parser.add_argument( | ||||||
| "--header", "-H", | ||||||
| action="append", | ||||||
| required=True, | ||||||
| help="Add custom headers (format: Key:Value)", | ||||||
|
vivkumar-akamai marked this conversation as resolved.
Outdated
|
||||||
| default=[] | ||||||
| ) | ||||||
|
|
||||||
| parser.add_argument( | ||||||
| "--cacert", "-c", | ||||||
| type=str, | ||||||
| help="Add ca certificate to validate server", | ||||||
| default=False | ||||||
|
||||||
| default=False | |
| default=None |
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.
Its server validation certs. I don't think it should be concern
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.
@vivkumar-akamai Could you elaborate a bit on this? I'd assume we'd always want to validate the remote certificate unless the user explicitly specifies otherwise but I might just be missing something
Copilot
AI
Nov 24, 2025
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.
[nitpick] The data_parser function is unnecessary as it only returns args.data without any transformation. Consider removing this function and accessing args.data directly on line 77.
Uh oh!
There was an error while loading. Please reload this page.