Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Docs for status_page resource
Browse files Browse the repository at this point in the history
  • Loading branch information
louy committed Jun 3, 2018
1 parent d9f987c commit dd4cfbb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
14 changes: 6 additions & 8 deletions uptimerobot/resource_uptimerobot_status_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ func resourceStatusPage() *schema.Resource {
Default: "a-z",
},
"status": &schema.Schema{
Type: schema.TypeString,
Computed: true,
// ValidateFunc: validation.StringInSlice(mapKeys(statusPageStatus), false),
// Optional: true,
// Default: "active",
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice(mapKeys(statusPageStatus), false),
Default: "active",
},
"monitors": &schema.Schema{
Type: schema.TypeList,
Expand Down Expand Up @@ -107,7 +106,7 @@ func resourceStatusPageCreate(d *schema.ResourceData, m interface{}) error {
}
// log.Printf("[DEBUG] Sort: %s %d", d.Get("sort").(string), statusPageSort[d.Get("sort").(string)])
data.Add("sort", fmt.Sprintf("%d", statusPageSort[d.Get("sort").(string)]))
// data.Add("status", fmt.Sprintf("%d", statusPageStatus[d.Get("status").(string)]))
data.Add("status", fmt.Sprintf("%d", statusPageStatus[d.Get("status").(string)]))

body, err := uptimerobotAPICall(
m.(UptimeRobotConfig).apiKey,
Expand All @@ -119,7 +118,6 @@ func resourceStatusPageCreate(d *schema.ResourceData, m interface{}) error {
}
psp := body["psp"].(map[string]interface{})
d.SetId(fmt.Sprintf("%d", int(psp["id"].(float64))))
d.Set("status", "active")
d.Set("standard_url", psp["standard_url"].(string))
if psp["custom_url"] != nil {
d.Set("custom_url", psp["custom_url"].(string))
Expand Down Expand Up @@ -188,7 +186,7 @@ func resourceStatusPageUpdate(d *schema.ResourceData, m interface{}) error {
data.Add("monitors", strings.Join(strMonitors, "-"))
}
data.Add("sort", fmt.Sprintf("%d", statusPageSort[d.Get("sort").(string)]))
// data.Add("status", fmt.Sprintf("%d", statusPageStatus[d.Get("status").(string)]))
data.Add("status", fmt.Sprintf("%d", statusPageStatus[d.Get("status").(string)]))

_, err := uptimerobotAPICall(
m.(UptimeRobotConfig).apiKey,
Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/alert_contact.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Use this resource to create an alert contact
## Example Usage

```hcl
- resource `uptimerobot_alert_contact` `slack` {
- friendly_name = `Slack Alert`
- type = `slack`
- webhook_url = `https://hooks.slack.com/services/XXXXXXX`
resource `uptimerobot_alert_contact` `slack` {
friendly_name = `Slack Alert`
type = `slack`
webhook_url = `https://hooks.slack.com/services/XXXXXXX`
}
```

Expand Down
16 changes: 14 additions & 2 deletions website/docs/r/status_page.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,21 @@ resource "uptimerobot_status_page" "my_status_page" {

## Arguments Reference

TODO
* `friendly_name` - friendly name of the monitor (for making it easier to distinguish from others).
* `monitors` - The monitors to be displayed. Use `[0]` for all monitors (default).
* `custom_domain` - (optional) the domain or subdomain that the status page will run on.
* `password` - (optional) the password for the status page.
* `sort` - (optional) the sorting of the status page. Can be one of the following:
- `a-z`
- `z-a`
- `up-down-paused`
- `down-up-paused`
* `status` - the status of the status page (`paused` or `active`). Defaults to `active`
<!-- * `hide_url_links` - (optional) for hiding the Uptime Robot links and only available in the Pro Plan -->

## Attributes Reference

* `id` - the ID of the status page
* `status` - the status of the status page (`paused` or `active`)
* `dns_address` - the dns address that you need to point your custom domain to (`stats.uptimerobot.com`)
* `standard_url` - the full url of the page on uptimerobot.com
* `custom_url` - the full url of the page (only if `custom_domain` is set)

0 comments on commit dd4cfbb

Please sign in to comment.