Skip to content

Commit

Permalink
Implementation of integration actions for API/Email (#138)
Browse files Browse the repository at this point in the history
* [IntegrationActions] Adding new model for actions

Changed:
* Modeling resource_opsgenie_integration_action
* go.mod updted go-sdk
* Added to Provider.go

* [IntegrationAction] Implemented code for CRUD actions, possible issue with Go SDK not honoring filter types properly. DRY code to be refactored

* [SDK] Update to fix bug in integration actions

Changed:
* go.mod and vendor dir updated for latest opsgenie-go-sdk-v2
* Adding close/ack/addnote action types - schema and flatten/expand logic

* Refactors, dropped unnecessary fields, added tests

* Also, removed debug logging statements

* Added documentation page, sane values in test case

* Update docs page

* Extensive acceptance tests - more actions, fields and similar examples reflected in documentation page.

* Example in documentation updated to match features that have passed in acceptance tests.

* Replace specific flattenAction()s with generic one

* Change possible if upstream patches are accepted in SDK
  that allow for this, else commit will have to be reverted
* TODO: Update module and vendor for updated go-sdk-v2

* Dependency update and expanded test case to include email_integration
  • Loading branch information
rohit-h authored Jul 28, 2020
1 parent d4833d9 commit 7a50ac5
Show file tree
Hide file tree
Showing 11 changed files with 1,174 additions and 31 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ go 1.12
require (
github.com/hashicorp/go-retryablehttp v0.5.2
github.com/hashicorp/terraform-plugin-sdk v1.0.0
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200713133143-9a54f60eab8d
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200728120710-9ec24baa3544
github.com/pkg/errors v0.8.1
)
20 changes: 2 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.3 h1:XAqJ0IIb/Q/mss3OMrXInA6KOQzGOrZRtJIY7qWpSxQ=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.3/go.mod h1:f0ezb0R/mrB9Hpm5RrIS6EX3ydjsR2nAB88nYYXZcNY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.4-0.20191118113006-8251c4baf730 h1:Mzaem+i8WSQef9YY4xrqh8utl76v1PsDS3wxqmXMivM=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.4-0.20191118113006-8251c4baf730/go.mod h1:f0ezb0R/mrB9Hpm5RrIS6EX3ydjsR2nAB88nYYXZcNY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.4-0.20191122083021-56efea3bc5d9 h1:fP5KNV/Ltp6C7gmAhHS+cyC3HWKxMsxeEtpdkmvFbnU=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.4-0.20191122083021-56efea3bc5d9/go.mod h1:f0ezb0R/mrB9Hpm5RrIS6EX3ydjsR2nAB88nYYXZcNY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.5 h1:AnS8ZCC5dle8P4X4FZ+IOlX9v0jAkCMiZDIzRnYwBbs=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.5/go.mod h1:f0ezb0R/mrB9Hpm5RrIS6EX3ydjsR2nAB88nYYXZcNY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.6 h1:jbPcx0GlwyDkFqFPVQQ5SXCHMVmftLo3gTLGJJM4GZg=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.6/go.mod h1:f0ezb0R/mrB9Hpm5RrIS6EX3ydjsR2nAB88nYYXZcNY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.7-0.20200406122459-ce3f70f22ab7 h1:+cTGQp1QRUWH+YGgh2b4sO/Y5g86PTpVEIpVFnEor6E=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.7-0.20200406122459-ce3f70f22ab7/go.mod h1:VOkJ7STzYj+nXRhMcBTcmt8uZZ17KZKJdZtJpgHLbT8=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.1 h1:0y6RTB5SNcf0lhdVyJFPU/bTagUlToKpW4AGWMB7ZBw=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200629074417-0567d19c5adb h1:XhJdPBhWWn/+91KS4eZhPM031oV3kyfYvaIOnx8W/X0=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200629074417-0567d19c5adb/go.mod h1:VOkJ7STzYj+nXRhMcBTcmt8uZZ17KZKJdZtJpgHLbT8=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200713133143-9a54f60eab8d h1:i9avt8C9OBwkaTR10PQaEK8Kt5baQ6XJiR1b7/jJ+IU=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200713133143-9a54f60eab8d/go.mod h1:VOkJ7STzYj+nXRhMcBTcmt8uZZ17KZKJdZtJpgHLbT8=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200728120710-9ec24baa3544 h1:CcYQ/JYODbXvSyVwc7CDh8OhK0rGMrxcxqJkTvR8KA4=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.1.2-0.20200728120710-9ec24baa3544/go.mod h1:VOkJ7STzYj+nXRhMcBTcmt8uZZ17KZKJdZtJpgHLbT8=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -263,7 +248,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
1 change: 1 addition & 0 deletions opsgenie/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Provider() terraform.ResourceProvider {
"opsgenie_escalation": resourceOpsgenieEscalation(),
"opsgenie_api_integration": resourceOpsgenieApiIntegration(),
"opsgenie_email_integration": resourceOpsgenieEmailIntegration(),
"opsgenie_integration_action": resourceOpsgenieIntegrationAction(),
"opsgenie_service": resourceOpsGenieService(),
"opsgenie_schedule": resourceOpsgenieSchedule(),
"opsgenie_schedule_rotation": resourceOpsgenieScheduleRotation(),
Expand Down
Loading

0 comments on commit 7a50ac5

Please sign in to comment.