Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

Add New Relic Infrastructure API support #15

Merged
merged 3 commits into from
May 21, 2018

Conversation

paul91
Copy link
Contributor

@paul91 paul91 commented May 16, 2018

As requested by @smithclay in https://github.com/terraform-providers/terraform-provider-newrelic/pull/30

Let me know if this is what you had in mind. This adds New Relic Infrastructure API support.

Copy link
Contributor

@smithclay smithclay left a comment

Choose a reason for hiding this comment

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

First review for the project, but this looks good to me.

@paultyng—would appreciate a quick spot check too since it's my first PR review in this repo :)

@petewilcock
Copy link

@paultyng Gentle ping here, just as I'm very keen to see these changes downstream in the NewRelic Terraform provider :)

Copy link
Owner

@paultyng paultyng left a comment

Choose a reason for hiding this comment

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

One minor change (rename i), but otherwise looks good to me. I would like there to be more assertions in the test coverage if possible, but not going to hold it up for that.

@@ -14,6 +14,20 @@ type Client struct {
RestyClient *resty.Client
}

// InfraClient represents the client state for the Infrastructure API
type InfraClient struct {
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not as familiar with this part of the New Relic API, so Infra is an entirely separate API (including a separate endpoint) I take it?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's correct—separate endpoint.

"strconv"
)

func (i *InfraClient) queryAlertInfraConditions(policyID int) ([]AlertInfraCondition, error) {
Copy link
Owner

Choose a reason for hiding this comment

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

i is probably a bad name for this due to its more idiomatic usage, looping, etc, maybe just c or cli or something that evokes client?

@paul91
Copy link
Contributor Author

paul91 commented May 21, 2018

Thanks for the feedback, I will address this later today.

@paul91
Copy link
Contributor Author

paul91 commented May 21, 2018

@paultyng updated the InfraClient variable name to be more consistent with the rest of the project.

@paultyng paultyng merged commit 2b3dc48 into paultyng:master May 21, 2018
@paultyng
Copy link
Owner

Released as v1.6.0

ianrayns pushed a commit to ianrayns/go-newrelic that referenced this pull request May 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants