Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 53735a9

Browse files
author
Lucas Kacher
authored
Merge pull request #9 from promiseofcake/ljk/board-string
Allow string based dashboard IDs
2 parents f28f7f3 + 38f6ff3 commit 53735a9

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
vendor/
2+
datadog-fetch-hcl

client/datadog.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func NewDataDog(apiKey, appKey string) *DataDogClient {
2424
}
2525
}
2626

27-
func (d *DataDogClient) FetchJSON(id int) ([]byte, error) {
27+
func (d *DataDogClient) FetchJSON(id string) ([]byte, error) {
2828
url := fmt.Sprintf(
29-
"%s/%d?api_key=%s&application_key=%s",
29+
"%s/%s?api_key=%s&application_key=%s",
3030
ddDashboardAPIUrl,
3131
id,
3232
d.apiKey,

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func main() {
2828
}
2929
dd := client.NewDataDog(apiKey, appKey)
3030

31-
id := flag.Int("id", 0, "Dashboard ID to retrieve")
31+
id := flag.String("id", "0", "Dashboard ID to retrieve")
3232
title := flag.String("title", "", "Dashboard Title for TF definition")
3333
debug := flag.Bool("debug", false, "Debug Datadog API Output to stderr")
3434
flag.Parse()

script/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [ "$FMT_ERRS" -gt "0" ]; then
1515
fi
1616
echo "ok gofmt"
1717

18-
VET_ERRS=$(go tool vet -shadow -all $pkgs 2>&1 | tee /dev/tty | wc -l)
18+
VET_ERRS=$(go vet -all $pkgs 2>&1 | tee /dev/tty | wc -l)
1919
if [ "$VET_ERRS" -gt "0" ]; then
2020
echo "$VET_ERRS Vet error(s) found above."
2121
exit 1

0 commit comments

Comments
 (0)