-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* π improve terraform * π improve terraform
- Loading branch information
1 parent
8dd864c
commit e3bcc46
Showing
8 changed files
with
166 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
|
||
hreq "github.com/imroc/req/v3" | ||
) | ||
|
||
func DeleteMonitor(ctx context.Context, c *hreq.Client, id string) *error { | ||
|
||
req := c.Delete("monitor/" + id).Do() | ||
|
||
if req.Err != nil { | ||
return &req.Err | ||
|
||
} | ||
return nil | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
|
||
hreq "github.com/imroc/req/v3" | ||
) | ||
|
||
func GetMonitor(ctx context.Context, c *hreq.Client, id string) (*MonitorRequest, error) { | ||
|
||
request := c.Get("monitor/" + id).Do() | ||
|
||
if request.Err != nil { | ||
return nil, request.Err | ||
} | ||
var monitor MonitorRequest | ||
if err := json.NewDecoder(request.Body).Decode(&monitor); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &monitor, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "openstatus Provider" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# openstatus Provider | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `openstatus_api_token` (String) openstatus.dev api token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "openstatus_monitor Resource - terraform-provider-openstatus" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# openstatus_monitor (Resource) | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `periodicity` (String) How often the monitor should run | ||
- `regions` (List of String) The regions to use | ||
- `url` (String) The url to monitor | ||
|
||
### Optional | ||
|
||
- `active` (Boolean) If the monitor is active | ||
- `body` (String) The body | ||
- `description` (String) The description of your monitor | ||
- `headers` (Attributes List) The headers of your request (see [below for nested schema](#nestedatt--headers)) | ||
- `method` (String) | ||
- `name` (String) The name of the monitor | ||
|
||
### Read-Only | ||
|
||
- `id` (Number) The id of the monitor | ||
|
||
<a id="nestedatt--headers"></a> | ||
### Nested Schema for `headers` | ||
|
||
Required: | ||
|
||
- `key` (String) | ||
- `value` (String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters