Conversation
yannmh
reviewed
Jan 12, 2017
datadog/api/metadata.py
Outdated
| UpdatableAPIResource, ActionAPIResource | ||
|
|
||
|
|
||
| class Metadata(GetableAPIResource, CreateableAPIResource, UpdatableAPIResource, ActionAPIResource): |
There was a problem hiding this comment.
Can metadata be created too (c.f. CreatableAPIResource)? If so, could you write an example on how to use it?
Contributor
Author
There was a problem hiding this comment.
I added some clarification in the update docstring. The update request will create the metadata if it doesn't exist.
datadog/api/metadata.py
Outdated
| if not metric_name: | ||
| raise KeyError("'metric_name' parameter is required") | ||
|
|
||
| return super(Metadata, cls)._trigger_class_action('PUT', 'metrics', metric_name, **params) |
There was a problem hiding this comment.
Can we simply do
return super(Metadata, cls).update(id=metric_name, **params)
?
…y into agrant/metrics_metadata
Contributor
Author
|
Thanks for the review and fixing the violations. Let me know if the changes are good or if it needs anything else. |
|
Looks great, thanks @flapjack103 🙇 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
metricsormetadata?