-
Notifications
You must be signed in to change notification settings - Fork 77
Support Monitor Client and Fetch Entity Metrics #569
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
Open
yec-akamai
wants to merge
7
commits into
linode:dev
Choose a base branch
from
yec-akamai:monitor-client
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+430
−139
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comment on lines
-67
to
-102
""" | ||
The main interface to the Linode API. | ||
|
||
:param token: The authentication token to use for communication with the | ||
API. Can be either a Personal Access Token or an OAuth Token. | ||
:type token: str | ||
:param base_url: The base URL for API requests. Generally, you shouldn't | ||
change this. | ||
:type base_url: str | ||
:param user_agent: What to append to the User Agent of all requests made | ||
by this client. Setting this allows Linode's internal | ||
monitoring applications to track the usage of your | ||
application. Setting this is not necessary, but some | ||
applications may desire this behavior. | ||
:type user_agent: str | ||
:param page_size: The default size to request pages at. If not given, | ||
the API's default page size is used. Valid values | ||
can be found in the API docs, but at time of writing | ||
are between 25 and 500. | ||
:type page_size: int | ||
:param retry: Whether API requests should automatically be retries on known | ||
intermittent responses. | ||
:type retry: bool | ||
:param retry_rate_limit_interval: The amount of time to wait between HTTP request | ||
retries. | ||
:type retry_rate_limit_interval: Union[float, int] | ||
:param retry_max: The number of request retries that should be attempted before | ||
raising an API error. | ||
:type retry_max: int | ||
:type retry_statuses: List of int | ||
:param retry_statuses: Additional HTTP response statuses to retry on. | ||
By default, the client will retry on 408, 429, and 502 | ||
responses. | ||
:param ca_path: The path to a CA file to use for API requests in this client. | ||
:type ca_path: str | ||
""" |
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.
Can we keep some doc strings for the BaseClient
as well?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
do-not-merge
PRs that should not be merged until the commented issue is resolved
new-feature
for new features in the changelog.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR introduced a new client MonitorClient, to make calls to a different host monitor-api. Also refactor the LinodeClient and have them share a BaseClient. The endpoint for this client is fetching metrics for a list of entities. Also, updated test suite for the new client and test the fetching metrics endpoint.
✔️ How to Test
Unit test: