escalation_rule -> rule

This commit is contained in:
Alexander Hellbom 2016-10-19 07:53:19 +02:00
parent a6abce7e60
commit b40ba1042f
7 changed files with 18 additions and 15 deletions

View File

@ -30,7 +30,7 @@ func resourcePagerDutyEscalationPolicy() *schema.Resource {
Type: schema.TypeInt, Type: schema.TypeInt,
Optional: true, Optional: true,
}, },
"escalation_rule": &schema.Schema{ "rule": &schema.Schema{
Type: schema.TypeList, Type: schema.TypeList,
Required: true, Required: true,
Elem: &schema.Resource{ Elem: &schema.Resource{
@ -68,7 +68,7 @@ func resourcePagerDutyEscalationPolicy() *schema.Resource {
} }
func buildEscalationPolicyStruct(d *schema.ResourceData) *pagerduty.EscalationPolicy { func buildEscalationPolicyStruct(d *schema.ResourceData) *pagerduty.EscalationPolicy {
escalationRules := d.Get("escalation_rule").([]interface{}) escalationRules := d.Get("rule").([]interface{})
policy := pagerduty.EscalationPolicy{ policy := pagerduty.EscalationPolicy{
Name: d.Get("name").(string), Name: d.Get("name").(string),
@ -119,7 +119,7 @@ func resourcePagerDutyEscalationPolicyRead(d *schema.ResourceData, meta interfac
d.Set("description", e.Description) d.Set("description", e.Description)
d.Set("num_loops", e.NumLoops) d.Set("num_loops", e.NumLoops)
if err := d.Set("escalation_rule", flattenRules(e.EscalationRules)); err != nil { if err := d.Set("rule", flattenRules(e.EscalationRules)); err != nil {
return err return err
} }

View File

@ -100,7 +100,7 @@ resource "pagerduty_escalation_policy" "foo" {
description = "foo" description = "foo"
num_loops = 1 num_loops = 1
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {
@ -126,7 +126,7 @@ resource "pagerduty_escalation_policy" "foo" {
description = "bar" description = "bar"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {
@ -135,7 +135,7 @@ resource "pagerduty_escalation_policy" "foo" {
} }
} }
escalation_rule { rule {
escalation_delay_in_minutes = 20 escalation_delay_in_minutes = 20
target { target {

View File

@ -102,7 +102,7 @@ resource "pagerduty_escalation_policy" "foo" {
description = "foo" description = "foo"
num_loops = 1 num_loops = 1
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {
@ -142,7 +142,7 @@ resource "pagerduty_escalation_policy" "foo" {
description = "bar" description = "bar"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {

View File

@ -104,7 +104,7 @@ resource "pagerduty_escalation_policy" "foo" {
description = "bar" description = "bar"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {
@ -138,7 +138,7 @@ resource "pagerduty_escalation_policy" "foo" {
description = "bar" description = "bar"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {

View File

@ -24,7 +24,7 @@ resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy" name = "Engineering Escalation Policy"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {
@ -43,15 +43,17 @@ The following arguments are supported:
* `description` - (Optional) A human-friendly description of the escalation policy. * `description` - (Optional) A human-friendly description of the escalation policy.
If not set, a placeholder of "Managed by Terraform" will be set. If not set, a placeholder of "Managed by Terraform" will be set.
* `num_loops` - (Optional) The number of times the escalation policy will repeat after reaching the end of its escalation. * `num_loops` - (Optional) The number of times the escalation policy will repeat after reaching the end of its escalation.
* `escalation_rule` - (Required) An Escalation rule block. Escalation rules documented below. * `rule` - (Required) An Escalation rule block. Escalation rules documented below.
Escalation rules (`escalation_rule`) supports the following: Escalation rules (`rule`) supports the following:
* `escalation_delay_in_minutes` - (Required) The number of minutes before an unacknowledged incident escalates away from this rule. * `escalation_delay_in_minutes` - (Required) The number of minutes before an unacknowledged incident escalates away from this rule.
* `targets` - (Required) A target block. Target blocks documented below. * `targets` - (Required) A target block. Target blocks documented below.
Targets (`target`) supports the following: Targets (`target`) supports the following:
* `type` - (Optional) Can be `user`, `schedule`, `user_reference` or `schedule_reference`. Defaults to `user_reference` * `type` - (Optional) Can be `user`, `schedule`, `user_reference` or `schedule_reference`. Defaults to `user_reference`
* `id` - (Required) A target ID * `id` - (Required) A target ID

View File

@ -24,7 +24,7 @@ resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy" name = "Engineering Escalation Policy"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {
@ -45,6 +45,7 @@ resource "pagerduty_service" "example" {
## Argument Reference ## Argument Reference
The following arguments are supported: The following arguments are supported:
* `name` - (Required) The name of the service. * `name` - (Required) The name of the service.
* `description` - (Optional) A human-friendly description of the escalation policy. * `description` - (Optional) A human-friendly description of the escalation policy.
If not set, a placeholder of "Managed by Terraform" will be set. If not set, a placeholder of "Managed by Terraform" will be set.

View File

@ -24,7 +24,7 @@ resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy" name = "Engineering Escalation Policy"
num_loops = 2 num_loops = 2
escalation_rule { rule {
escalation_delay_in_minutes = 10 escalation_delay_in_minutes = 10
target { target {