Skip to content
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

Add support for the Charts API #48

Merged
merged 4 commits into from
Aug 2, 2018

Conversation

trevrosen
Copy link
Contributor

Fixes #36

What

Support the Charts API as defined in the docs

Why

Working toward full coverage of the REST API in this client

@trevrosen trevrosen requested review from akahn and seubert August 2, 2018 18:57
charts.go Outdated
Metric string `json:"metric,omitempty"`
Composite string `json:"composite,omitempty"`
Type string `json:"type,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add fields here to set:

  • summary_function
  • group_by_function
  • group_by

and the like?

charts.go Outdated
Max float64 `json:"max,omitempty"`
Label string `json:"label,omitempty"`
RelatedSpace int `json:"related_space,omitempty"`
Threshold Threshold `json:"threshold,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

We will also need transform_function here, among others.

@trevrosen
Copy link
Contributor Author

Doh -- thanks for the reminder, @akahn. I picked this work up from where I'd left it a couple months ago and must've just assumed the struct was complete. I'll update.

Copy link
Contributor

@akahn akahn left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

charts.go Outdated
GroupFunction *string `json:"group_function,omitempty"` // valid: average, sum, min, max
GroupBy *string `json:"group_by,omitempty"`
SummaryFunction *string `json:"summary_function,omitempty"` // valid: average, sum, min, max, count
DownsampleFunction *string `json:"downsample_function,omitempty"` // valid: average, min, max, sum, cound
Copy link
Contributor

Choose a reason for hiding this comment

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

count

TransformFunction *string `json:"transform_function,omitempty"`
Period *int `json:"period,omitempty"`
Min *int `json:"min,omitempty"`
Max *int `json:"max,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think one field is still missing here: name:

A display name to use for the stream when generating the tooltip.

@trevrosen trevrosen merged commit 26b62f6 into appoptics:master Aug 2, 2018
@trevrosen trevrosen deleted the feature/36/charts-api branch August 2, 2018 20:40
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