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

[dashboards] Support getting dashboards by string id #225

Merged
merged 5 commits into from
Apr 15, 2019

Conversation

enbashi
Copy link
Contributor

@enbashi enbashi commented Mar 19, 2019

Add the ability to use the new dashboard string ID format in GetScreenboard() and GetDashboard().
Used in https:/terraform-providers/terraform-provider-datadog/pull/165

helpers.go Outdated
@@ -79,3 +83,18 @@ func GetPrecision(v *PrecisionT) (PrecisionT, bool) {

return PrecisionT(""), false
}

// GetStringId is a helper routine that allows screenboards and timebaords to be retrieved
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo: timebaords -> timeboards

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

if err != nil {
t.Fatalf("Retrieving a dashboard failed when it shouldn't. (%s)", err)
}
assertDashboardEquals(t, actual, expected)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could also test that Id and NewId are the same (between the 2 objects returned by CreateDashboard).

Copy link
Contributor

@MLaureB MLaureB left a comment

Choose a reason for hiding this comment

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

Left minor nits, otherwise this changes look good to me

integration/dashboards_test.go Outdated Show resolved Hide resolved
integration/dashboards_test.go Show resolved Hide resolved
@bkabrda
Copy link
Collaborator

bkabrda commented Apr 15, 2019

LGTM 👍. @enbashi are you ok with me squashing all the commits when merging?

@enbashi
Copy link
Contributor Author

enbashi commented Apr 15, 2019

LGTM 👍. @enbashi are you ok with me squashing all the commits when merging?

@bkabrda absolutely!

@bkabrda
Copy link
Collaborator

bkabrda commented Apr 15, 2019

Cool, thank you very much! Merging.

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.

3 participants