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,
Optional: true,
},
"escalation_rule": &schema.Schema{
"rule": &schema.Schema{
Type: schema.TypeList,
Required: true,
Elem: &schema.Resource{
@ -68,7 +68,7 @@ func resourcePagerDutyEscalationPolicy() *schema.Resource {
}
func buildEscalationPolicyStruct(d *schema.ResourceData) *pagerduty.EscalationPolicy {
escalationRules := d.Get("escalation_rule").([]interface{})
escalationRules := d.Get("rule").([]interface{})
policy := pagerduty.EscalationPolicy{
Name: d.Get("name").(string),
@ -119,7 +119,7 @@ func resourcePagerDutyEscalationPolicyRead(d *schema.ResourceData, meta interfac
d.Set("description", e.Description)
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
}

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy"
num_loops = 2
escalation_rule {
rule {
escalation_delay_in_minutes = 10
target {
@ -43,15 +43,17 @@ The following arguments are supported:
* `description` - (Optional) A human-friendly description of the escalation policy.
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.
* `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.
* `targets` - (Required) A target block. Target blocks documented below.
Targets (`target`) supports the following:
* `type` - (Optional) Can be `user`, `schedule`, `user_reference` or `schedule_reference`. Defaults to `user_reference`
* `id` - (Required) A target ID

View File

@ -24,7 +24,7 @@ resource "pagerduty_escalation_policy" "foo" {
name = "Engineering Escalation Policy"
num_loops = 2
escalation_rule {
rule {
escalation_delay_in_minutes = 10
target {
@ -45,6 +45,7 @@ resource "pagerduty_service" "example" {
## Argument Reference
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.

View File

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