Skip to content

Commit

Permalink
feat: Add rspec generator for documentation in Hashicorp Registry (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeiminds committed Apr 21, 2023
1 parent bca9a9a commit a0a1cd6
Show file tree
Hide file tree
Showing 36 changed files with 1,328 additions and 439 deletions.
51 changes: 0 additions & 51 deletions docs/data-sources/functions.md

This file was deleted.

158 changes: 151 additions & 7 deletions docs/resources/alertpolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,93 @@
page_title: "guance_alertpolicy Resource - guance"
subcategory: ""
description: |-
Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data sources, and set up alert targets to receive alerts.
Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find problems, and solve problems.
Alert Policy
Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data
sources, and set up alert targets to receive alerts.
Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or
group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find
problems, and solve problems.
Relationships:
```mermaid
graph LR
A[Monitor] --> B[Alert Policy] --> C[Notification]
```
Notes:
When a monitor is created, an alert policy must be selected, and the default is selected by default;When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified into the default.
When a monitor is created, an alert policy must be selected, and the default is selected by default;When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified
into the default.
Create
The first let me create a resource. We will send the create operation to the resource management service
```terraform
variable "dingtalkwebhook" {
type = string
}
variable "dingtalksecret" {
type = string
}
variable "email" {
type = string
}
data "guance_members" "demo" {
filter = [
{
name = "email"
values = [var.email]
}
]
}
resource "guancemembergroup" "demo" {
name = "oac-demo"
memberids = data.guance_members.demo.items[*].id
}
resource "guancenotification" "demo" {
name = "oac-demo"
type = "dingtalkrobot"
dingtalkrobot = {
webhook = var.dingtalkwebhook
secret = var.dingtalk_secret
}
}
resource "guancealertpolicy" "demo" {
name = "oac-demo"
silenttimeout = "1h"
statuses = [
"critical",
"error",
"warning",
"info",
"ok",
"nodata",
"nodataok",
"nodataas_ok",
]
alerttargets = [
{
type = "membergroup"
membergroup = {
id = guancemembergroup.demo.id
}
},
{
type = "notification"
notification = {
id = guance_notification.demo.id
}
}
]
}
```
---

# guance_alertpolicy (Resource)

Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data sources, and set up alert targets to receive alerts.
# Alert Policy

Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data
sources, and set up alert targets to receive alerts.

Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find problems, and solve problems.
Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or
group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find
problems, and solve problems.

Relationships:

Expand All @@ -31,7 +102,80 @@ A[Monitor] --> B[Alert Policy] --> C[Notification]
Notes:

1. When a monitor is created, an alert policy must be selected, and the default is selected by default;
2. When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified into the default.
2. When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified
into the default.

## Create

The first let me create a resource. We will send the create operation to the resource management service

```terraform
variable "ding_talk_webhook" {
type = string
}
variable "ding_talk_secret" {
type = string
}
variable "email" {
type = string
}
data "guance_members" "demo" {
filter = [
{
name = "email"
values = [var.email]
}
]
}
resource "guance_membergroup" "demo" {
name = "oac-demo"
member_ids = data.guance_members.demo.items[*].id
}
resource "guance_notification" "demo" {
name = "oac-demo"
type = "ding_talk_robot"
ding_talk_robot = {
webhook = var.ding_talk_webhook
secret = var.ding_talk_secret
}
}
resource "guance_alertpolicy" "demo" {
name = "oac-demo"
silent_timeout = "1h"
statuses = [
"critical",
"error",
"warning",
"info",
"ok",
"nodata",
"nodata_ok",
"nodata_as_ok",
]
alert_targets = [
{
type = "member_group"
member_group = {
id = guance_membergroup.demo.id
}
},
{
type = "notification"
notification = {
id = guance_notification.demo.id
}
}
]
}
```



Expand All @@ -46,7 +190,7 @@ Notes:
### Optional

- `alert_targets` (Attributes List) Alert Action (see [below for nested schema](#nestedatt--alert_targets))
- `silent_timeout` (Number) Silent timeout timestamp
- `silent_timeout` (String) Silent timeout timestamp

### Read-Only

Expand Down
23 changes: 21 additions & 2 deletions docs/resources/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,41 @@
page_title: "guance_dashboard Resource - guance"
subcategory: ""
description: |-
WORKING IN PROGRESS!
Dashboard
WORKING IN PROGRESS
A dashboard is a collection of visualizations that you can use to monitor the health of your systems and applications. Dashboards are made up of one or more panels, which are the visualizations themselves. Each panel displays a single metric or a single aggregation of metrics.
Dashboards are a great way to visualize your data and monitor your systems. You can use them to track metrics over time, and to quickly see how your systems are performing. You can also use them to compare metrics from different systems and applications.
Guance Cloud's dashboard is used to clearly show the range in which the metric data values are located. It is suitable for slicing messy data into points.
Create
The first let me create a resource. We will send the create operation to the resource management service
terraform
resource "guance_dashboard" "demo" {
name = "oac-demo"
}
---

# guance_dashboard (Resource)

**WORKING IN PROGRESS!**
# Dashboard

**WORKING IN PROGRESS**

A dashboard is a collection of visualizations that you can use to monitor the health of your systems and applications. Dashboards are made up of one or more panels, which are the visualizations themselves. Each panel displays a single metric or a single aggregation of metrics.

Dashboards are a great way to visualize your data and monitor your systems. You can use them to track metrics over time, and to quickly see how your systems are performing. You can also use them to compare metrics from different systems and applications.

Guance Cloud's dashboard is used to clearly show the range in which the metric data values are located. It is suitable for slicing messy data into points.

## Create

The first let me create a resource. We will send the create operation to the resource management service

```terraform
resource "guance_dashboard" "demo" {
name = "oac-demo"
}
```



<!-- schema generated by tfplugindocs -->
Expand Down
58 changes: 54 additions & 4 deletions docs/resources/membergroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,47 @@
page_title: "guance_membergroup Resource - guance"
subcategory: ""
description: |-
Member group is a collection of members in a workspace, and member groups can be authorized to access the resources in the workspace.
Member group is an abstract concept, it can be a team, or a department, it can help us build a reasonable organizational structure, optimize the management efficiency and user experience of the observability platform.
Member Group
Member group is a collection of members in a workspace, and member groups can be authorized to access the resources in
the workspace.
Member group is an abstract concept, it can be a team, or a department, it can help us build a reasonable organizational
structure, optimize the management efficiency and user experience of the observability platform.
Relationships:
```mermaid
graph LR
A[Workspace] --> B[Member]
A --> C[MemberGroup]
```
Create
The first let me create a resource. We will send the create operation to the resource management service
```terraform
variable "email" {
type = string
}
data "guance_members" "demo" {
filter = [
{
name = "email"
values = [var.email]
}
]
}
resource "guancemembergroup" "demo" {
name = "oac-demo"
memberids = data.guance_members.demo.items[*].id
}
```
---

# guance_membergroup (Resource)

Member group is a collection of members in a workspace, and member groups can be authorized to access the resources in the workspace.
# Member Group

Member group is a collection of members in a workspace, and member groups can be authorized to access the resources in
the workspace.

Member group is an abstract concept, it can be a team, or a department, it can help us build a reasonable organizational structure, optimize the management efficiency and user experience of the observability platform.
Member group is an abstract concept, it can be a team, or a department, it can help us build a reasonable organizational
structure, optimize the management efficiency and user experience of the observability platform.

Relationships:

Expand All @@ -28,6 +54,30 @@ A[Workspace] --> B[Member]
A --> C[MemberGroup]
```

## Create

The first let me create a resource. We will send the create operation to the resource management service

```terraform
variable "email" {
type = string
}
data "guance_members" "demo" {
filter = [
{
name = "email"
values = [var.email]
}
]
}
resource "guance_membergroup" "demo" {
name = "oac-demo"
member_ids = data.guance_members.demo.items[*].id
}
```



<!-- schema generated by tfplugindocs -->
Expand Down
Loading

0 comments on commit a0a1cd6

Please sign in to comment.