Skip to content

Commit 6558661

Browse files
Add missing attributes to services and status_pages
1 parent 58499de commit 6558661

16 files changed

+393
-96
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes of the StatusPal Terraform provider will be documented in th
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.6] - 2024-07-10
9+
10+
### Added
11+
12+
- `webhook_monitoring_service`, `webhook_custom_jsonpath_settings`, `inbound_email_address` and `incoming_webhook_url` attributes to the service resource and services data source.
13+
- `webhook` type to the service `monitoring` attribute
14+
- `bg_image`, `logo` and `favicon` readonly attributes to the status_page resource and status_pages data source.
15+
- Validators to the service resource attributes where it was needed.
16+
17+
### Changed
18+
19+
- Polished the documentation.
20+
821
## [0.2.5] - 2024-06-14
922

1023
### Changed

docs/data-sources/services.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,22 @@ Read-Only:
4949
- `display_response_time_chart` (Boolean) Display response time chart?
5050
- `display_uptime_graph` (Boolean) Display uptime graph?
5151
- `id` (String) The ID of the service.
52+
- `inbound_email_address` (String) This is field is populated from `inbound_email_id`, if the `monitoring` is set to `3rd_party`.
5253
- `inbound_email_id` (String) The inbound email ID.
5354
- `incident_type` (String) Enum: `"major"` `"minor"`
5455
Sets the incident type to this value when an incident is created via monitoring.
5556
The type of the (current) incident:
5657
- `minor` - A minor incident is currently taking place.
5758
- `major` - A major incident is currently taking place.
59+
- `incoming_webhook_url` (String) This is field is populated from `inbound_email_id`, if the `monitoring` is set to `webhook` and the `webhook_monitoring_service` is set.
5860
- `inserted_at` (String) Datetime at which the service was inserted.
5961
- `is_up` (Boolean) Is the monitored service up?
60-
- `monitoring` (String) Enum: `null` `"internal"` `"3rd_party"`
62+
- `monitoring` (String) Enum: `""` `"internal"` `"3rd_party"` `"webhook"`
6163
Monitoring types:
62-
- empty - No monitoring.
64+
- `""` - No monitoring.
6365
- `internal` - StatusPal monitoring.
6466
- `3rd_party` - 3rd Party monitoring.
67+
- `webhook` - Incoming webhook monitoring.
6568
- `name` (String) The name of the service.
6669
- `order` (Number) Service's position in the service list.
6770
- `parent_id` (String) The service parent ID.
@@ -89,6 +92,15 @@ Read-Only:
8992
```
9093
→ (see [below for nested schema](#nestedatt--services--translations))
9194
- `updated_at` (String) Datetime at which the service was last updated.
95+
- `webhook_custom_jsonpath_settings` (Attributes) The webhook monitoring service custom JSONPath settings.
96+
> **Configure this field only if the `webhook_monitoring_service` is set to `custom-jsonpath`.**
97+
→ (see [below for nested schema](#nestedatt--services--webhook_custom_jsonpath_settings))
98+
- `webhook_monitoring_service` (String) Enum: `"status-cake"` `"uptime-robot"` `"custom-jsonpath"`
99+
> **Configure this field only if the `monitoring` is set to `webhook`.**
100+
Webhook Monitoring types:
101+
- `status-cake` - StatusCake monitoring service.
102+
- `internal` - UptimeRobot monitoring service.
103+
- `3rd_party` - Custom JSONPath.
92104

93105
<a id="nestedatt--services--translations"></a>
94106
### Nested Schema for `services.translations`
@@ -97,3 +109,12 @@ Read-Only:
97109

98110
- `description` (String) The description of the service.
99111
- `name` (String) The name of the service.
112+
113+
114+
<a id="nestedatt--services--webhook_custom_jsonpath_settings"></a>
115+
### Nested Schema for `services.webhook_custom_jsonpath_settings`
116+
117+
Read-Only:
118+
119+
- `expected_result` (String) The expected result in the JSON, e.g. `"up"`
120+
- `jsonpath` (String) The path in the JSON, e.g. `$.status`

docs/data-sources/status_pages.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Read-Only:
5959
- `email_notification_template` (String) Custom email notification template, see the documentation: [Custom email templates](https://docs.statuspal.io/platform/subscriptions-and-notifications/custom-email-templates).
6060
- `email_templates_enabled` (Boolean) The templates won't be used until this is enabled, but you can send test emails.
6161
- `enable_auto_translations` (Boolean) Enable auto translations when creating incidents, maintenances and info notices.
62+
- `favicon` (String) Favicon url of the status page.
6263
- `feed_enabled` (Boolean) Allow your customers to receive updates as RSS and Atom feeds.
6364
- `google_calendar_enabled` (Boolean) Allow your customers to import Google Calendar with Status Pages maintenance (business only).
6465
- `google_chat_notifications_enabled` (Boolean) Allow your customers to receive notifications on Google Chat.
@@ -75,6 +76,7 @@ Read-Only:
7576
- `inserted_at` (String) Datetime at which the status page was inserted.
7677
- `link_color` (String) The links color in the status page.
7778
- `locked_when_maintenance` (Boolean) Lock from adding incidents when under maintenance.
79+
- `logo` (String) Logo url of the status page.
7880
- `maintenance_notification_hours` (Number) Long-running incident notification (Maintenance).
7981
- `major_notification_hours` (Number) Long-running incident notification (Major incident).
8082
- `mattermost_notifications_enabled` (Boolean) Allow your customers to receive notifications on Mattermost.

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ terraform {
1818
required_providers {
1919
statuspal = {
2020
source = "statuspal/statuspal"
21-
version = "0.2.5"
21+
version = "0.2.6"
2222
}
2323
}
2424
}
2525
2626
# Configure the StatusPal provider
2727
provider "statuspal" {
2828
api_key = "uk_aERPQU1kUzUrRmplaXJRMlc2TDEwZz09" // your user or organization api key
29-
region = "US" // can be "US" and "EU"
29+
region = "US" // "US" or "EU"
3030
}
3131
3232
# List all status pages of the organization with ID 1.
@@ -40,7 +40,7 @@ resource "statuspal_status_page" "example" {
4040
status_page = {
4141
name = "Example Terraform Status Page"
4242
url = "example.com"
43-
time_zone = "Europe/Berlin"
43+
time_zone = "America/New_York"
4444
}
4545
}
4646

docs/resources/service.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ Optional:
5757
- `description` (String) The description of the service.
5858
- `display_response_time_chart` (Boolean) Display response time chart?
5959
- `display_uptime_graph` (Boolean) Display uptime graph?
60-
- `monitoring` (String) Enum: `null` `"internal"` `"3rd_party"`
60+
- `monitoring` (String) Enum: `""` `"internal"` `"3rd_party"` `"webhook"`
6161
Monitoring types:
62-
- empty - No monitoring.
62+
- `""` - No monitoring.
6363
- `internal` - StatusPal monitoring.
6464
- `3rd_party` - 3rd Party monitoring.
65+
- `webhook` - Incoming webhook monitoring.
6566
- `order` (Number) Service's position in the service list.
6667
- `parent_id` (String) The service parent ID.
6768
- `pause_monitoring_during_maintenances` (Boolean) Pause the the service monitoring during maintenances?
@@ -82,26 +83,37 @@ Optional:
8283
}
8384
```
8485
→ (see [below for nested schema](#nestedatt--service--translations))
86+
- `webhook_custom_jsonpath_settings` (Attributes) The webhook monitoring service custom JSONPath settings.
87+
> **Configure this field only if the `webhook_monitoring_service` is set to `custom-jsonpath`.**
88+
→ (see [below for nested schema](#nestedatt--service--webhook_custom_jsonpath_settings))
89+
- `webhook_monitoring_service` (String) Enum: `"status-cake"` `"uptime-robot"` `"custom-jsonpath"`
90+
> **Configure this field only if the `monitoring` is set to `webhook`.**
91+
Webhook Monitoring types:
92+
- `status-cake` - StatusCake monitoring service.
93+
- `internal` - UptimeRobot monitoring service.
94+
- `3rd_party` - Custom JSONPath.
8595

8696
Read-Only:
8797

8898
- `children_ids` (List of Number) IDs of the service's children.
89-
- `current_incident_type` (String) Enum: `"major"` `"minor"` `"scheduled"`
99+
- `current_incident_type` (String) Enum: `"minor"` `"major"` `"scheduled"`
90100
The service's current incident type.
91101
The type of the (current) incident:
92102
- `minor` - A minor incident is currently taking place.
93103
- `major` - A major incident is currently taking place.
94104
- `scheduled` - A scheduled maintenance is currently taking place.
95105
- `id` (String) The ID of the service.
106+
- `inbound_email_address` (String) This is field is populated from `inbound_email_id`, if the `monitoring` is set to `3rd_party`.
96107
- `inbound_email_id` (String) The inbound email ID.
97-
- `incident_type` (String) Enum: `"major"` `"minor"`
108+
- `incident_type` (String) Enum: `"minor"` `"major"`
98109
Sets the incident type to this value when an incident is created via monitoring.
99110
The type of the (current) incident:
100111
- `minor` - A minor incident is currently taking place.
101112
- `major` - A major incident is currently taking place.
113+
- `incoming_webhook_url` (String) This is field is populated from `inbound_email_id`, if the `monitoring` is set to `webhook` and the `webhook_monitoring_service` is set.
102114
- `inserted_at` (String) Datetime at which the service was inserted.
103115
- `is_up` (Boolean) Is the monitored service up?
104-
- `parent_incident_type` (String) Enum: `"major"` `"minor"`
116+
- `parent_incident_type` (String) Enum: `"minor"` `"major"`
105117
Sets the parent's service incident type to this value when an incident is created via monitoring.
106118
The type of the (current) incident:
107119
- `minor` - A minor incident is currently taking place.
@@ -116,6 +128,15 @@ Required:
116128
- `description` (String) The description of the service.
117129
- `name` (String) The name of the service.
118130

131+
132+
<a id="nestedatt--service--webhook_custom_jsonpath_settings"></a>
133+
### Nested Schema for `service.webhook_custom_jsonpath_settings`
134+
135+
Required:
136+
137+
- `expected_result` (String) The expected result in the JSON, e.g. `"up"`
138+
- `jsonpath` (String) The path in the JSON, e.g. `$.status`
139+
119140
## Import
120141

121142
Import is supported using the following syntax:

docs/resources/status_page.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Required:
4848
Optional:
4949

5050
- `about` (String) Customize the about information displayed in your status page.
51-
- `bg_image` (String) Background image url of the status page.
5251
- `calendar_enabled` (Boolean) Allow your customers to receive updates via iCalendar feed.
5352
- `captcha_enabled` (Boolean) Enable captchas (this option is only available when the status page is member restricted).
5453
- `current_incidents_position` (String) The incident position displayed in the status page, it can be "below_services" and "above_services".
@@ -131,7 +130,10 @@ Optional:
131130

132131
Read-Only:
133132

133+
- `bg_image` (String) Background image url of the status page.
134+
- `favicon` (String) Favicon url of the status page.
134135
- `inserted_at` (String) Datetime at which the status page was inserted.
136+
- `logo` (String) Logo url of the status page.
135137
- `updated_at` (String) Datetime at which the status page was last updated.
136138

137139
<a id="nestedatt--status_page--theme_configs"></a>

examples/provider/provider.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ terraform {
33
required_providers {
44
statuspal = {
55
source = "statuspal/statuspal"
6-
version = "0.2.5"
6+
version = "0.2.6"
77
}
88
}
99
}
1010

1111
# Configure the StatusPal provider
1212
provider "statuspal" {
1313
api_key = "uk_aERPQU1kUzUrRmplaXJRMlc2TDEwZz09" // your user or organization api key
14-
region = "US" // can be "US" and "EU"
14+
region = "US" // "US" or "EU"
1515
}
1616

1717
# List all status pages of the organization with ID 1.
@@ -25,7 +25,7 @@ resource "statuspal_status_page" "example" {
2525
status_page = {
2626
name = "Example Terraform Status Page"
2727
url = "example.com"
28-
time_zone = "Europe/Berlin"
28+
time_zone = "America/New_York"
2929
}
3030
}
3131

internal/client/models.go

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ type StatusPage struct {
3636
HeaderLogoText string `json:"header_logo_text,omitempty"`
3737
PublicCompanyName string `json:"public_company_name,omitempty"`
3838
BgImage string `json:"bg_image,omitempty"`
39+
Logo string `json:"logo,omitempty"`
40+
Favicon string `json:"favicon,omitempty"`
3941
DisplayUptimeGraph bool `json:"display_uptime_graph,omitempty"`
4042
UptimeGraphDays int64 `json:"uptime_graph_days,omitempty"`
4143
CurrentIncidentsPosition string `json:"current_incidents_position,omitempty"`
@@ -98,29 +100,38 @@ type StatusPageThemeConfigs struct {
98100

99101
// Service struct.
100102
type Service struct {
101-
ID int64 `json:"id,omitempty"`
102-
Name string `json:"name,omitempty"`
103-
Description string `json:"description,omitempty"`
104-
PrivateDescription string `json:"private_description,omitempty"`
105-
ParentID int64 `json:"parent_id,omitempty"`
106-
CurrentIncidentType string `json:"current_incident_type,omitempty"`
107-
Monitoring string `json:"monitoring,omitempty"`
108-
PingUrl string `json:"ping_url,omitempty"`
109-
IncidentType string `json:"incident_type,omitempty"`
110-
ParentIncidentType string `json:"parent_incident_type,omitempty"`
111-
IsUp bool `json:"is_up,omitempty"`
112-
PauseMonitoringDuringMaintenances bool `json:"pause_monitoring_during_maintenances,omitempty"`
113-
InboundEmailID string `json:"inbound_email_id,omitempty"`
114-
AutoIncident bool `json:"auto_incident,omitempty"`
115-
AutoNotify bool `json:"auto_notify,omitempty"`
116-
ChildrenIDs []int64 `json:"children_ids,omitempty"`
117-
Translations ServiceTranslations `json:"translations,omitempty"`
118-
Private bool `json:"private,omitempty"`
119-
DisplayUptimeGraph bool `json:"display_uptime_graph,omitempty"`
120-
DisplayResponseTimeChart bool `json:"display_response_time_chart,omitempty"`
121-
Order int64 `json:"order,omitempty"`
122-
InsertedAt string `json:"inserted_at,omitempty"`
123-
UpdatedAt string `json:"updated_at,omitempty"`
103+
ID int64 `json:"id,omitempty"`
104+
Name string `json:"name,omitempty"`
105+
Description string `json:"description,omitempty"`
106+
PrivateDescription string `json:"private_description,omitempty"`
107+
ParentID int64 `json:"parent_id,omitempty"`
108+
CurrentIncidentType string `json:"current_incident_type,omitempty"`
109+
Monitoring string `json:"monitoring"`
110+
WebhookMonitoringService string `json:"webhook_monitoring_service,omitempty"`
111+
WebhookCustomJsonpathSettings WebhookCustomJsonpathSettings `json:"webhook_custom_jsonpath_settings,omitempty"`
112+
InboundEmailAddress string `json:"inbound_email_address,omitempty"`
113+
IncomingWebhookUrl string `json:"incoming_webhook_url,omitempty"`
114+
PingUrl string `json:"ping_url,omitempty"`
115+
IncidentType string `json:"incident_type,omitempty"`
116+
ParentIncidentType string `json:"parent_incident_type,omitempty"`
117+
IsUp bool `json:"is_up,omitempty"`
118+
PauseMonitoringDuringMaintenances bool `json:"pause_monitoring_during_maintenances,omitempty"`
119+
InboundEmailID string `json:"inbound_email_id,omitempty"`
120+
AutoIncident bool `json:"auto_incident,omitempty"`
121+
AutoNotify bool `json:"auto_notify,omitempty"`
122+
ChildrenIDs []int64 `json:"children_ids,omitempty"`
123+
Translations ServiceTranslations `json:"translations,omitempty"`
124+
Private bool `json:"private,omitempty"`
125+
DisplayUptimeGraph bool `json:"display_uptime_graph,omitempty"`
126+
DisplayResponseTimeChart bool `json:"display_response_time_chart,omitempty"`
127+
Order int64 `json:"order,omitempty"`
128+
InsertedAt string `json:"inserted_at,omitempty"`
129+
UpdatedAt string `json:"updated_at,omitempty"`
130+
}
131+
132+
type WebhookCustomJsonpathSettings struct {
133+
Jsonpath string `json:"jsonpath,omitempty"`
134+
ExpectedResult string `json:"expected_result,omitempty"`
124135
}
125136

126137
type ServiceTranslations map[string]ServiceTranslation

0 commit comments

Comments
 (0)