mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Adding status, created_at & last_incident_timestamp for service
This commit is contained in:
parent
ec10e031ee
commit
fff166dca7
@ -30,6 +30,18 @@ func resourcePagerDutyService() *schema.Resource {
|
|||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
"last_incident_timestamp": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"created_at": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
"status": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
"acknowledgement_timeout": &schema.Schema{
|
"acknowledgement_timeout": &schema.Schema{
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
@ -44,7 +56,8 @@ func resourcePagerDutyService() *schema.Resource {
|
|||||||
|
|
||||||
func buildServiceStruct(d *schema.ResourceData) *pagerduty.Service {
|
func buildServiceStruct(d *schema.ResourceData) *pagerduty.Service {
|
||||||
service := pagerduty.Service{
|
service := pagerduty.Service{
|
||||||
Name: d.Get("name").(string),
|
Name: d.Get("name").(string),
|
||||||
|
Status: d.Get("status").(string),
|
||||||
APIObject: pagerduty.APIObject{
|
APIObject: pagerduty.APIObject{
|
||||||
ID: d.Id(),
|
ID: d.Id(),
|
||||||
},
|
},
|
||||||
@ -106,9 +119,12 @@ func resourcePagerDutyServiceRead(d *schema.ResourceData, meta interface{}) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
d.Set("name", s.Name)
|
d.Set("name", s.Name)
|
||||||
|
d.Set("status", s.Status)
|
||||||
|
d.Set("created_at", s.CreateAt)
|
||||||
d.Set("escalation_policy", s.EscalationPolicy.ID)
|
d.Set("escalation_policy", s.EscalationPolicy.ID)
|
||||||
d.Set("description", s.Description)
|
d.Set("description", s.Description)
|
||||||
d.Set("auto_resolve_timeout", s.AutoResolveTimeout)
|
d.Set("auto_resolve_timeout", s.AutoResolveTimeout)
|
||||||
|
d.Set("last_incident_timestamp", s.LastIncidentTimestamp)
|
||||||
d.Set("acknowledgement_timeout", s.AcknowledgementTimeout)
|
d.Set("acknowledgement_timeout", s.AcknowledgementTimeout)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user