From 848159a91ec551f1fd0bf9f0de6e02ff91f43239 Mon Sep 17 00:00:00 2001 From: Zach Leslie Date: Mon, 4 May 2020 15:44:57 -0700 Subject: [PATCH 1/2] fix(client): update the client for pagination URL fix --- go.mod | 2 +- go.sum | 2 ++ .../newrelic/newrelic-client-go/internal/version/version.go | 2 +- .../newrelic/newrelic-client-go/pkg/alerts/channels.go | 4 ++-- .../newrelic/newrelic-client-go/pkg/alerts/conditions.go | 4 ++-- .../newrelic/newrelic-client-go/pkg/alerts/incidents.go | 4 ++-- .../pkg/alerts/multi_location_synthetics_conditions.go | 5 +++-- .../newrelic-client-go/pkg/alerts/nrql_conditions.go | 4 ++-- .../newrelic-client-go/pkg/alerts/plugins_conditions.go | 4 ++-- .../newrelic-client-go/pkg/alerts/synthetics_conditions.go | 4 ++-- vendor/modules.txt | 2 +- 11 files changed, 20 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index c0e9c1060..eb9eccfab 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,6 @@ require ( github.com/hashicorp/terraform-plugin-sdk v1.8.0 github.com/newrelic/go-agent/v3 v3.4.0 github.com/newrelic/go-insights v1.0.3 - github.com/newrelic/newrelic-client-go v0.23.0 + github.com/newrelic/newrelic-client-go v0.23.1 github.com/stretchr/testify v1.5.1 ) diff --git a/go.sum b/go.sum index 953f9a4d4..9c1af9329 100644 --- a/go.sum +++ b/go.sum @@ -464,6 +464,8 @@ github.com/newrelic/go-insights v1.0.3 h1:zSNp1CEZnXktzSIEsbHJk8v6ZihdPFP2WsO/fz github.com/newrelic/go-insights v1.0.3/go.mod h1:A20BoT8TNkqPGX2nS/Z2fYmKl3Cqa3iKZd4whzedCY4= github.com/newrelic/newrelic-client-go v0.23.0 h1:SNqudEOG0DBmRsBdsWNfWlPF8P6Csfnnhv3+D9XGI24= github.com/newrelic/newrelic-client-go v0.23.0/go.mod h1:Kql4o4D5et8WS8c4O/7ZdH2QcTX6zYtoIrbdlhwg+Oc= +github.com/newrelic/newrelic-client-go v0.23.1 h1:7LEo9zZVy6A51KNb+OVez3dXKMZOSzkkH+iw6av703A= +github.com/newrelic/newrelic-client-go v0.23.1/go.mod h1:Kql4o4D5et8WS8c4O/7ZdH2QcTX6zYtoIrbdlhwg+Oc= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= diff --git a/vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go b/vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go index 1fcf565fb..0b83aed5a 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go +++ b/vendor/github.com/newrelic/newrelic-client-go/internal/version/version.go @@ -1,4 +1,4 @@ package version // Version of this library -const Version string = "0.23.0" +const Version string = "0.23.1" diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go index 7a54fa8e9..7d7be21bb 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/channels.go @@ -76,11 +76,11 @@ type ChannelConfiguration struct { // ListChannels returns all alert channels for a given account. func (a *Alerts) ListChannels() ([]*Channel, error) { alertChannels := []*Channel{} - nextURL := "/alerts_channels.json" + nextURL := a.config.Region().RestURL("/alerts_channels.json") for nextURL != "" { response := alertChannelsResponse{} - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), nil, &response) + resp, err := a.client.Get(nextURL, nil, &response) if err != nil { return nil, err diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go index 941a86150..d991e1d11 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/conditions.go @@ -208,11 +208,11 @@ func (a *Alerts) ListConditions(policyID int) ([]*Condition, error) { PolicyID: policyID, } - nextURL := "/alerts_conditions.json" + nextURL := a.config.Region().RestURL("/alerts_conditions.json") for nextURL != "" { response := alertConditionsResponse{} - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), &queryParams, &response) + resp, err := a.client.Get(nextURL, &queryParams, &response) if err != nil { return nil, err diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go index 6e7847b97..95ac513f4 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/incidents.go @@ -29,11 +29,11 @@ func (a *Alerts) ListIncidents(onlyOpen bool, excludeViolations bool) ([]*Incide ExcludeViolations: excludeViolations, } - nextURL := "/alerts_incidents.json" + nextURL := a.config.Region().RestURL("/alerts_incidents.json") for nextURL != "" { incidentsResponse := alertIncidentsResponse{} - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), queryParams, &incidentsResponse) + resp, err := a.client.Get(nextURL, queryParams, &incidentsResponse) if err != nil { return nil, err diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go index 699b47f1a..ec3147e9e 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/multi_location_synthetics_conditions.go @@ -2,6 +2,7 @@ package alerts import ( "fmt" + "strconv" ) // MultiLocationSyntheticsCondition represents a location-based failure condition. @@ -35,10 +36,10 @@ func (a *Alerts) ListMultiLocationSyntheticsConditions(policyID int) ([]*MultiLo PolicyID: policyID, } - nextURL := fmt.Sprintf("/alerts_location_failure_conditions/policies/%d.json", policyID) + nextURL := a.config.Region().RestURL("/alerts_location_failure_conditions/policies/", strconv.Itoa(policyID)+".json") for nextURL != "" { - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), &queryParams, &response) + resp, err := a.client.Get(nextURL, &queryParams, &response) if err != nil { return nil, err diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go index 0789304df..96c531639 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/nrql_conditions.go @@ -205,11 +205,11 @@ func (a *Alerts) ListNrqlConditions(policyID int) ([]*NrqlCondition, error) { PolicyID: policyID, } - nextURL := "/alerts_nrql_conditions.json" + nextURL := a.config.Region().RestURL("/alerts_nrql_conditions.json") for nextURL != "" { response := nrqlConditionsResponse{} - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), &queryParams, &response) + resp, err := a.client.Get(nextURL, &queryParams, &response) if err != nil { return nil, err diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go index 2487bafc9..f889e8484 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/plugins_conditions.go @@ -33,11 +33,11 @@ func (a *Alerts) ListPluginsConditions(policyID int) ([]*PluginsCondition, error PolicyID: policyID, } - nextURL := "/alerts_plugins_conditions.json" + nextURL := a.config.Region().RestURL("/alerts_plugins_conditions.json") for nextURL != "" { response := pluginsConditionsResponse{} - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), &queryParams, &response) + resp, err := a.client.Get(nextURL, &queryParams, &response) if err != nil { return nil, err diff --git a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go index 0a33fd470..a3cf33e2a 100644 --- a/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go +++ b/vendor/github.com/newrelic/newrelic-client-go/pkg/alerts/synthetics_conditions.go @@ -18,14 +18,14 @@ type SyntheticsCondition struct { // ListSyntheticsConditions returns a list of Synthetics alert conditions for a given policy. func (a *Alerts) ListSyntheticsConditions(policyID int) ([]*SyntheticsCondition, error) { conditions := []*SyntheticsCondition{} - nextURL := "/alerts_synthetics_conditions.json" + nextURL := a.config.Region().RestURL("/alerts_synthetics_conditions.json") queryParams := listSyntheticsConditionsParams{ PolicyID: policyID, } for nextURL != "" { response := syntheticsConditionsResponse{} - resp, err := a.client.Get(a.config.Region().RestURL(nextURL), &queryParams, &response) + resp, err := a.client.Get(nextURL, &queryParams, &response) if err != nil { return nil, err diff --git a/vendor/modules.txt b/vendor/modules.txt index 201aa1fba..b29ff5419 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -469,7 +469,7 @@ github.com/newrelic/go-agent/v3/internal/utilization github.com/newrelic/go-agent/v3/newrelic # github.com/newrelic/go-insights v1.0.3 github.com/newrelic/go-insights/client -# github.com/newrelic/newrelic-client-go v0.23.0 +# github.com/newrelic/newrelic-client-go v0.23.1 github.com/newrelic/newrelic-client-go/internal/http github.com/newrelic/newrelic-client-go/internal/logging github.com/newrelic/newrelic-client-go/internal/serialization From 5a42f56f348003c235cf7bdc4ae3b7266cb73563 Mon Sep 17 00:00:00 2001 From: Zach Leslie Date: Mon, 4 May 2020 15:51:02 -0700 Subject: [PATCH 2/2] doc(changelog): update for release prep --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4cd2a34..af76e2677 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ ## 1.17.1 (Unreleased) + +BUG FIXES: + +* fix(client): update the client for pagination URL fix + ## 1.17.0 (May 01, 2020) IMPROVEMENTS: + * feat(dashboard): add grid_column_count to dashboard schema ([#535](https://github.com/terraform-providers/terraform-provider-newrelic/pull/535)) ## 1.16.0 (March 24, 2020)