docs: add schedule and escalation policy documentation
Add Terraform Registry docs and examples for towerops_schedule and towerops_escalation_policy resources. Update provider index and main example to include on-call resources.
This commit is contained in:
parent
9d204a7ba3
commit
e7634da384
6 changed files with 156 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
page_title: "TowerOps Provider"
|
||||
description: |-
|
||||
The TowerOps provider allows you to manage TowerOps resources such as sites and devices.
|
||||
The TowerOps provider allows you to manage TowerOps resources such as sites, devices, on-call schedules, and escalation policies.
|
||||
---
|
||||
|
||||
# TowerOps Provider
|
||||
|
|
@ -101,6 +101,22 @@ resource "towerops_device" "modern_switch" {
|
|||
}
|
||||
```
|
||||
|
||||
### On-Call Schedule and Escalation Policy
|
||||
|
||||
```terraform
|
||||
resource "towerops_schedule" "primary" {
|
||||
name = "Primary On-Call"
|
||||
timezone = "America/Chicago"
|
||||
description = "Main engineering on-call rotation"
|
||||
}
|
||||
|
||||
resource "towerops_escalation_policy" "critical" {
|
||||
name = "Critical Alerts"
|
||||
description = "Escalation for P1 incidents"
|
||||
repeat_count = 5
|
||||
}
|
||||
```
|
||||
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
|
|
|||
53
docs/resources/escalation_policy.md
Normal file
53
docs/resources/escalation_policy.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
page_title: "towerops_escalation_policy Resource - TowerOps"
|
||||
description: |-
|
||||
Manages a TowerOps escalation policy.
|
||||
---
|
||||
|
||||
# towerops_escalation_policy (Resource)
|
||||
|
||||
Manages a TowerOps escalation policy. Escalation policies define how alerts are routed through a series of notification rules when they are not acknowledged.
|
||||
|
||||
## Example Usage
|
||||
|
||||
### Basic Escalation Policy
|
||||
|
||||
```terraform
|
||||
resource "towerops_escalation_policy" "default" {
|
||||
name = "Default Escalation"
|
||||
}
|
||||
```
|
||||
|
||||
### Escalation Policy with Custom Repeat Count
|
||||
|
||||
```terraform
|
||||
resource "towerops_escalation_policy" "critical" {
|
||||
name = "Critical Alerts"
|
||||
description = "Escalation for P1 incidents"
|
||||
repeat_count = 5
|
||||
}
|
||||
```
|
||||
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `name` (String) - The name of the escalation policy.
|
||||
|
||||
### Optional
|
||||
|
||||
- `description` (String) - A description of the escalation policy.
|
||||
- `repeat_count` (Number) - Number of times to repeat the escalation cycle. Defaults to `3`.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) - The unique identifier of the escalation policy.
|
||||
- `inserted_at` (String) - The timestamp when the escalation policy was created.
|
||||
|
||||
## Import
|
||||
|
||||
Escalation policies can be imported using their UUID:
|
||||
|
||||
```shell
|
||||
terraform import towerops_escalation_policy.example 550e8400-e29b-41d4-a716-446655440000
|
||||
```
|
||||
54
docs/resources/schedule.md
Normal file
54
docs/resources/schedule.md
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
page_title: "towerops_schedule Resource - TowerOps"
|
||||
description: |-
|
||||
Manages a TowerOps on-call schedule.
|
||||
---
|
||||
|
||||
# towerops_schedule (Resource)
|
||||
|
||||
Manages a TowerOps on-call schedule. Schedules define rotation layers that determine who is on-call at any given time.
|
||||
|
||||
## Example Usage
|
||||
|
||||
### Basic Schedule
|
||||
|
||||
```terraform
|
||||
resource "towerops_schedule" "primary" {
|
||||
name = "Primary On-Call"
|
||||
timezone = "America/Chicago"
|
||||
}
|
||||
```
|
||||
|
||||
### Schedule with Description
|
||||
|
||||
```terraform
|
||||
resource "towerops_schedule" "after_hours" {
|
||||
name = "After-Hours Rotation"
|
||||
timezone = "America/New_York"
|
||||
description = "Coverage for nights and weekends"
|
||||
}
|
||||
```
|
||||
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `name` (String) - The name of the on-call schedule.
|
||||
- `timezone` (String) - The timezone for the schedule (e.g. `America/Chicago`, `UTC`).
|
||||
|
||||
### Optional
|
||||
|
||||
- `description` (String) - A description of the schedule.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) - The unique identifier of the schedule.
|
||||
- `inserted_at` (String) - The timestamp when the schedule was created.
|
||||
|
||||
## Import
|
||||
|
||||
Schedules can be imported using their UUID:
|
||||
|
||||
```shell
|
||||
terraform import towerops_schedule.example 550e8400-e29b-41d4-a716-446655440000
|
||||
```
|
||||
|
|
@ -50,6 +50,20 @@ resource "towerops_device" "access_switch" {
|
|||
snmp_enabled = true
|
||||
}
|
||||
|
||||
# Create an on-call schedule
|
||||
resource "towerops_schedule" "primary" {
|
||||
name = "Primary On-Call"
|
||||
timezone = "America/Chicago"
|
||||
description = "Main engineering on-call rotation"
|
||||
}
|
||||
|
||||
# Create an escalation policy
|
||||
resource "towerops_escalation_policy" "default" {
|
||||
name = "Default Escalation"
|
||||
description = "Standard escalation for all alerts"
|
||||
repeat_count = 3
|
||||
}
|
||||
|
||||
# Output the site ID
|
||||
output "site_id" {
|
||||
value = towerops_site.main_office.id
|
||||
|
|
@ -58,3 +72,11 @@ output "site_id" {
|
|||
output "router_id" {
|
||||
value = towerops_device.core_router.id
|
||||
}
|
||||
|
||||
output "schedule_id" {
|
||||
value = towerops_schedule.primary.id
|
||||
}
|
||||
|
||||
output "escalation_policy_id" {
|
||||
value = towerops_escalation_policy.default.id
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
resource "towerops_escalation_policy" "critical" {
|
||||
name = "Critical Alerts"
|
||||
description = "Escalation for P1 incidents"
|
||||
repeat_count = 5
|
||||
}
|
||||
5
examples/resources/towerops_schedule/resource.tf
Normal file
5
examples/resources/towerops_schedule/resource.tf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
resource "towerops_schedule" "primary" {
|
||||
name = "Primary On-Call"
|
||||
timezone = "America/Chicago"
|
||||
description = "Main engineering on-call rotation"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue