Skip to content

Commit 4d7ed73

Browse files
committed
Add templates and update documentation for RMON resources
Added new templates for various RMON resources including agent, user, group, and server. Updated documentation to provide clear examples and usage guidelines, reflecting the latest schema and import features for Terraform v1.7.0 and later.
1 parent b3067ce commit 4d7ed73

26 files changed

+860
-56
lines changed

Diff for: docs/data-sources/group.md

+28-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,41 @@
33
page_title: "rmon_group Data Source - rmon"
44
subcategory: ""
55
description: |-
6-
Represent roxy-wi group. All servers managed via RMON can be included in groups. A group is a user-defined pool of servers. By default, all your servers are included in the common group named Default.
6+
Represent RMON group. All servers managed via RMON can be included in groups. A group is a user-defined pool of servers. By default, all your servers are included in the common group named Default.
77
---
88

99
# rmon_group (Data Source)
1010

11-
Represent roxy-wi group. All servers managed via RMON can be included in groups. A group is a user-defined pool of servers. By default, all your servers are included in the common group named Default.
11+
Represent RMON group. All servers managed via RMON can be included in groups. A group is a user-defined pool of servers. By default, all your servers are included in the common group named Default.
1212

13+
## Example Usage
1314

15+
```terraform
16+
provider "rmon" {
17+
base_url = "https://..."
18+
login = "test"
19+
password = "testpass"
20+
}
21+
22+
data "rmon_group" "example_id" {
23+
id = "4"
24+
}
25+
26+
output "view" {
27+
value = data.rmon_group.example_id
28+
}
29+
30+
// ------------------------------------
31+
32+
data "rmon_group" "example_name" {
33+
name = "test"
34+
}
35+
36+
output "data" {
37+
value = data.rmon_group.example_name
38+
}
39+
```
1440

15-
<!-- schema generated by tfplugindocs -->
1641
## Schema
1742

1843
### Optional

Diff for: docs/data-sources/user_role.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ description: |-
1010

1111
The data source allows you to retrieve information about user roles in RMON. This data source fetches a list of roles, providing details about each role's ID, name, and description.
1212

13+
## Example Usage
1314

15+
```terraform
16+
provider "rmon" {
17+
base_url = "https://..."
18+
login = "test"
19+
password = "testpass"
20+
}
21+
22+
data "rmon_user_role" "example" {}
23+
24+
output "test" {
25+
value = data.rmon_user_role.example.roles
26+
}
27+
```
1428

15-
<!-- schema generated by tfplugindocs -->
1629
## Schema
1730

1831
### Read-Only
@@ -21,10 +34,11 @@ The data source allows you to retrieve information about user roles in RMON. Thi
2134
- `roles` (List of Object) List of roles. (see [below for nested schema](#nestedatt--roles))
2235

2336
<a id="nestedatt--roles"></a>
37+
2438
### Nested Schema for `roles`
2539

2640
Read-Only:
2741

28-
- `description` (String)
29-
- `name` (String)
30-
- `role_id` (String)
42+
- `description` (String) The description of the user role.
43+
- `name` (String) The name of the user role.
44+
- `role_id` (String) The ID of the user role.

Diff for: docs/index.md

+47-3
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,66 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "rmon Provider"
3+
page_title: "RMON Provider"
44
subcategory: ""
55
description: |-
66
77
---
88

9-
# rmon Provider
9+
# RMON Provider
1010

11+
Use the RMON provider to interact with the many resources supported by RMON. You must configure the provider with the proper credentials before you can use it.
1112

13+
Use the navigation to the left to read about the available resources.
1214

15+
To learn the basics of Terraform using this provider, follow the hands-on get started tutorials.
1316

17+
## Example Usage
18+
19+
Terraform 1.7.0 and later:
20+
21+
```terraform
22+
terraform {
23+
required_providers {
24+
rmon = {
25+
source = "Roxy-wi/rmon"
26+
}
27+
}
28+
}
29+
30+
provider "rmon" {
31+
base_url = "https://..."
32+
login = "test"
33+
password = "testpass"
34+
}
35+
```
1436

1537
<!-- schema generated by tfplugindocs -->
38+
39+
### Provider Configuration
40+
41+
!> **Warning:** Hard-coded credentials are not recommended in any Terraform configuration and risks secret leakage should this file ever be committed to a public version control system.
42+
43+
### Environment Variables
44+
45+
Credentials can be provided by using the `RMON_USERNAME`, `RMON_PASSWORD` and url auth `RMON_BASE_URL` environment variables.
46+
47+
For example:
48+
49+
```terraform
50+
provider "rmon" {}
51+
```
52+
53+
```shell
54+
% export RMON_USERNAME="user"
55+
% export RMON_PASSWORD="password"
56+
% export RMON_BASE_URL="https://your_rmon"
57+
% terraform plan
58+
```
59+
1660
## Schema
1761

1862
### Required
1963

20-
- `base_url` (String) URL to connect for RMON.
2164
- `login` (String) Username for RMON.
2265
- `password` (String) Password for RMON.
66+
- `base_url` (String) URL to connect for RMON.

Diff for: docs/resources/agent.md

+39-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,29 @@ description: |-
1010

1111
This resource manages Agents in RMON.
1212

13+
## Example Usage
1314

15+
```terraform
16+
provider "rmon" {
17+
base_url = "https://..."
18+
login = "test"
19+
password = "testpass"
20+
}
1421
15-
<!-- schema generated by tfplugindocs -->
16-
## Schema
22+
resource "rmon_agent" "example" {
23+
server_id = 1
24+
name = "Agent01"
25+
description = "Agent in my DC"
26+
enabled = true
27+
shared = true
28+
port = 5101
29+
region_id = 1
30+
}
31+
```
32+
33+
## Argument Reference
34+
35+
The following arguments are supported:
1736

1837
### Required
1938

@@ -41,3 +60,21 @@ Optional:
4160
- `create` (String)
4261
- `delete` (String)
4362
- `update` (String)
63+
64+
65+
## Import
66+
67+
In Terraform v1.7.0 and later, use an import block to import Agent. For example:
68+
69+
```terraform
70+
import {
71+
to = rmon_agent.example
72+
id = "1"
73+
}
74+
```
75+
76+
Using terraform import, import Agent can be imported using the `id`, e.g. For example:
77+
78+
```shell
79+
% terraform import rmon_agent.example 1
80+
```

Diff for: docs/resources/channel.md

+48-10
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,69 @@ description: |-
1010

1111
Represents a communication channel such as Telegram, Slack, PagerDuty, or Mattermost.
1212

13+
## Example Usage
1314

15+
```terraform
16+
provider "rmon" {
17+
base_url = "https://your_rmon"
18+
login = "testlog"
19+
password = "testpass"
20+
}
1421
15-
<!-- schema generated by tfplugindocs -->
16-
## Schema
22+
resource "rmon_channel" "example" {
23+
receiver = "pd"
24+
channel = "test_my_channel"
25+
group_id = 1
26+
token = "some_token"
27+
}
28+
```
29+
30+
## Argument Reference
31+
32+
The following arguments are supported:
1733

1834
### Required
1935

2036
- `channel` (String) The channel identifier.
2137
- `group_id` (Number) The ID of the group to which the channel belongs.
22-
- `receiver` (String) The type of the receiver. Only `telegram`, `slack`, `pd`, `mm` are allowed.
38+
- `receiver` (String, ForceNew) The type of the receiver. Only `telegram`, `slack`, `pd`, `mm` are allowed.
2339
- `token` (String) The token used for the channel.
2440

2541
### Optional
2642

2743
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
2844

29-
### Read-Only
30-
31-
- `id` (String) The ID of this resource.
32-
3345
<a id="nestedblock--timeouts"></a>
46+
3447
### Nested Schema for `timeouts`
3548

49+
This resource supports the following timeouts:
50+
3651
Optional:
3752

38-
- `create` (String)
39-
- `delete` (String)
40-
- `update` (String)
53+
* `create` - Default is 10 minutes.
54+
* `update` - Default is 10 minutes.
55+
* `delete` - Default is 30 minutes.
56+
57+
## Attribute Reference
58+
59+
The following attributes are exported:
60+
61+
- `id` (String) The ID of this resource.
62+
63+
## Import
64+
65+
In Terraform v1.7.0 and later, use an import block to import Channel. For example:
66+
67+
```terraform
68+
import {
69+
to = rmon_channel.example
70+
id = "1"
71+
}
72+
```
73+
74+
Using terraform import, import Channel can be imported using the `id`, e.g. For example:
75+
76+
```shell
77+
% terraform import rmon_channel.example 1
78+
```

Diff for: docs/resources/group.md

+36-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@ description: |-
1010

1111
Represent roxy-wi group. All servers managed via RMON can be included in groups. A group is a user-defined pool of servers. It is up to you decide how you will group your servers. You can create groups because of their type, purpose, etc. By default, all your servers are included in the common group named Default. All other groups are created within this group.
1212

13+
## Example Usage
1314

15+
```terraform
16+
provider "rmon" {
17+
base_url = "https://..."
18+
login = "test"
19+
password = "testpass"
20+
}
21+
22+
resource "rmon_group" "example" {
23+
name = "example_group2"
24+
description = "test terraform group2"
25+
}
26+
```
1427

15-
<!-- schema generated by tfplugindocs -->
1628
## Schema
1729

1830
### Required
@@ -29,10 +41,30 @@ Represent roxy-wi group. All servers managed via RMON can be included in groups.
2941
- `id` (String) The ID of this resource.
3042

3143
<a id="nestedblock--timeouts"></a>
44+
3245
### Nested Schema for `timeouts`
3346

47+
This resource supports the following timeouts:
48+
3449
Optional:
3550

36-
- `create` (String)
37-
- `delete` (String)
38-
- `update` (String)
51+
* `create` - Default is 10 minutes.
52+
* `update` - Default is 10 minutes.
53+
* `delete` - Default is 30 minutes.
54+
55+
## Import
56+
57+
In Terraform v1.7.0 and later, use an import block to import Group. For example:
58+
59+
```terraform
60+
import {
61+
to = rmon_group.example
62+
id = "1"
63+
}
64+
```
65+
66+
Using terraform import, import Group can be imported using the `id`, e.g. For example:
67+
68+
```shell
69+
% terraform import rmon_group.example 1
70+
```

0 commit comments

Comments
 (0)