mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/pagerduty: Allow timeouts to be disabled (pagerduty_service) (#11483)
* Vendor update * Add exists check * Update test * Update documentation
This commit is contained in:
parent
b5e8d62b14
commit
5f94b51eb0
@ -117,6 +117,10 @@ func resourcePagerDutyServiceRead(d *schema.ResourceData, meta interface{}) erro
|
||||
service, err := client.GetService(d.Id(), o)
|
||||
|
||||
if err != nil {
|
||||
if isNotFound(err) {
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,9 @@ func TestAccPagerDutyService_Basic(t *testing.T) {
|
||||
resource.TestCheckResourceAttr(
|
||||
"pagerduty_service.foo", "description", "bar"),
|
||||
resource.TestCheckResourceAttr(
|
||||
"pagerduty_service.foo", "auto_resolve_timeout", "3600"),
|
||||
"pagerduty_service.foo", "auto_resolve_timeout", "0"),
|
||||
resource.TestCheckResourceAttr(
|
||||
"pagerduty_service.foo", "acknowledgement_timeout", "3600"),
|
||||
"pagerduty_service.foo", "acknowledgement_timeout", "0"),
|
||||
),
|
||||
},
|
||||
},
|
||||
@ -149,10 +149,8 @@ resource "pagerduty_escalation_policy" "foo" {
|
||||
}
|
||||
|
||||
resource "pagerduty_service" "foo" {
|
||||
name = "bar"
|
||||
description = "bar"
|
||||
auto_resolve_timeout = 3600
|
||||
acknowledgement_timeout = 3600
|
||||
escalation_policy = "${pagerduty_escalation_policy.foo.id}"
|
||||
name = "bar"
|
||||
description = "bar"
|
||||
escalation_policy = "${pagerduty_escalation_policy.foo.id}"
|
||||
}
|
||||
`
|
||||
|
7
vendor/github.com/PagerDuty/go-pagerduty/service.go
generated
vendored
7
vendor/github.com/PagerDuty/go-pagerduty/service.go
generated
vendored
@ -2,8 +2,9 @@ package pagerduty
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/google/go-querystring/query"
|
||||
"net/http"
|
||||
|
||||
"github.com/google/go-querystring/query"
|
||||
)
|
||||
|
||||
// Integration is an endpoint (like Nagios, email, or an API call) that generates events, which are normalized and de-duplicated by PagerDuty to create incidents.
|
||||
@ -59,8 +60,8 @@ type Service struct {
|
||||
APIObject
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
AutoResolveTimeout *uint `json:"auto_resolve_timeout,omitempty"`
|
||||
AcknowledgementTimeout *uint `json:"acknowledgement_timeout,omitempty"`
|
||||
AutoResolveTimeout *uint `json:"auto_resolve_timeout"`
|
||||
AcknowledgementTimeout *uint `json:"acknowledgement_timeout"`
|
||||
CreateAt string `json:"created_at,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
LastIncidentTimestamp string `json:"last_incident_timestamp,omitempty"`
|
||||
|
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
@ -376,10 +376,10 @@
|
||||
"revisionTime": "2016-11-03T18:56:17Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "wzzdybMOEWsQ/crdkpTLneeob2U=",
|
||||
"checksumSHA1": "trj+UY2oSzP0O1WJKz8auncslVs=",
|
||||
"path": "github.com/PagerDuty/go-pagerduty",
|
||||
"revision": "317bca1364fc322f4d6f8eeb276e931b6667b43b",
|
||||
"revisionTime": "2016-12-20T22:05:08Z"
|
||||
"revision": "fad777c9c72ec7c62aeec0194f01684d6a2efd0e",
|
||||
"revisionTime": "2017-01-28T02:14:22Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "ly9VLPE9GKo2U7mnbZyjb2LDQ3w=",
|
||||
|
@ -49,8 +49,8 @@ The following arguments are supported:
|
||||
* `name` - (Required) The name of the service.
|
||||
* `description` - (Optional) A human-friendly description of the escalation policy.
|
||||
If not set, a placeholder of "Managed by Terraform" will be set.
|
||||
* `auto_resolve_timeout` - (Optional) Time in seconds that an incident is automatically resolved if left open for that long.
|
||||
* `acknowledgement_timeout` - (Optional) Time in seconds that an incident changes to the Triggered State after being Acknowledged.
|
||||
* `auto_resolve_timeout` - (Optional) Time in seconds that an incident is automatically resolved if left open for that long. Disabled if not set.
|
||||
* `acknowledgement_timeout` - (Optional) Time in seconds that an incident changes to the Triggered State after being Acknowledged. Disabled if not set.
|
||||
* `escalation_policy` - (Required) The escalation policy used by this service.
|
||||
|
||||
## Attributes Reference
|
||||
|
Loading…
Reference in New Issue
Block a user