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

Add integrations/pagerduty API Support #144

Merged
merged 7 commits into from
Mar 13, 2018

Conversation

rlhh
Copy link
Contributor

@rlhh rlhh commented Mar 10, 2018

Datadog has recently introduced APIs to support CRUD operations for integrations(https://docs.datadoghq.com/api/?lang=bash#integrations).

This PR adds support for CRUD operations on the Pagerduty Integration https://docs.datadoghq.com/api/?lang=bash#pagerduty.

Things to note:

  1. The request and response body does not match 1:1. For the request, the "service" object has "service_name" and "service_key" but for the response, we get "service" and "key".
  2. The integration tests only compare the service names because
  • The service key is returned as ****
  • The schedules are verified so we cannot put in fake data during creation
  • The API key is returned as ****

@rlhh rlhh changed the title Add Integrations/Pagerduty API Support Add integrations/pagerduty API Support Mar 10, 2018
integrations.go Outdated
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please update the year to 2018?

Schedules []string `json:"schedules"`
APIToken *string `json:"api_token"`
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add comments? See https://blog.golang.org/godoc-documenting-go-code

integrations.go Outdated
return &out, nil
}

// DeleteIntegrationPD remove the PD Integration from the system.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"removes"

@ojongerius
Copy link
Collaborator

Thanks for this!

the request and response body does not match 1:1. For the request, the "service" object has "service_name" and "service_key" but for the response, we get "service" and "key".

Would you be willing to raise an issue at Datadog, possibly linking this PR in, that looks like a bug to me.

@rlhh
Copy link
Contributor Author

rlhh commented Mar 12, 2018

Thanks for the review!

I'm not sure what's the best place to raise this issue so I've raised it at datadog/documentation. It should at minimum be documented on Datadog itself.

@rlhh
Copy link
Contributor Author

rlhh commented Mar 13, 2018

@ojongerius @yfronto What would be the next steps for this PR?

@ojongerius ojongerius merged commit fa40c76 into zorkian:master Mar 13, 2018
@ojongerius
Copy link
Collaborator

Thanks @rlhh! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants