-
Notifications
You must be signed in to change notification settings - Fork 156
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 AWS Integration #162
Add AWS Integration #162
Conversation
integrations.go
Outdated
|
||
var awsIntegrations []IntegrationAWSAccount | ||
|
||
for _, account := range response.Accounts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the loop here necessary? Couldn't we just return the response object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT
line 174 until 178 can be replaced with:
return &response.Accounts, nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been updated @ojongerius 👍
The code in I did experiment to see if it was possible to perform a GET request for a specific AWS integration; however, it looks like that's not exposed. |
I opened a support ticket to Datadog and confirmed that the API for the AWS integration does not yet support a PUT update action. So we're good on that. |
@yfronto Can you provide some feedback on this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the feedback on line 174 in integrations.go
and we are good to go AFAIAC!
integrations.go
Outdated
|
||
var awsIntegrations []IntegrationAWSAccount | ||
|
||
for _, account := range response.Accounts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT
line 174 until 178 can be replaced with:
return &response.Accounts, nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
Released in v2.11.0 |
PR Details
Notes:
Update
function.Questions:
{'external_id': '123456789'}
. I am currently marshalling this to theIntegrationAWSAccountCreateResponse
struct. It appearsexternal_id
is never needed again in further API calls so perhaps I should just return anerror
from theCreateIntegrationAWS
function and delete this struct?GetIntegrationAWSByAccount
or similar function to prevent a consumer of the client having to loop through the results of theGetIntegrationAWS
function?