Skip to content

Add metric metadata endpoints#181

Merged
yannmh merged 10 commits intomasterfrom
agrant/metrics_metadata
Jan 20, 2017
Merged

Add metric metadata endpoints#181
yannmh merged 10 commits intomasterfrom
agrant/metrics_metadata

Conversation

@flapjack103
Copy link
Copy Markdown
Contributor

@flapjack103 flapjack103 commented Jan 5, 2017

UpdatableAPIResource, ActionAPIResource


class Metadata(GetableAPIResource, CreateableAPIResource, UpdatableAPIResource, ActionAPIResource):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can metadata be created too (c.f. CreatableAPIResource)? If so, could you write an example on how to use it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some clarification in the update docstring. The update request will create the metadata if it doesn't exist.

if not metric_name:
raise KeyError("'metric_name' parameter is required")

return super(Metadata, cls)._trigger_class_action('PUT', 'metrics', metric_name, **params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply do

return super(Metadata, cls).update(id=metric_name, **params)

?

@flapjack103
Copy link
Copy Markdown
Contributor Author

Thanks for the review and fixing the violations. Let me know if the changes are good or if it needs anything else.

@yannmh
Copy link
Copy Markdown

yannmh commented Jan 20, 2017

Looks great, thanks @flapjack103 🙇

@yannmh yannmh merged commit 841bcdd into master Jan 20, 2017
@yannmh yannmh deleted the agrant/metrics_metadata branch January 20, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants