Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
obs-gh-konstantintikhonov committed Dec 12, 2023
1 parent 671e44a commit c0ce0ab
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 41 deletions.
13 changes: 5 additions & 8 deletions docs/data-sources/dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ Fetches metadata for an existing Observe dataset.
One of `name` or `id` must be set.
- `name` (String) Dataset name. Must be unique within workspace.
One of `name` or `id` must be set. If `name` is provided, `workspace` must be set.
- `stage` (Block List) A stage processes an input according to the provided pipeline. If no
input is provided, a stage will implicitly follow on from the result of
its predecessor. (see [below for nested schema](#nestedblock--stage))
- `workspace` (String) OID of the workspace this object is contained in.

### Read-Only
Expand All @@ -41,15 +38,13 @@ should be used when referring to this object in terraform manifests.
- `path_cost` (Number) Path cost incurred by this dataset when computing graph link. Increasing
this value will reduce the preference for using this dataset when computing
paths between two datasets.
- `stage` (Block List) A stage processes an input according to the provided pipeline. If no
input is provided, a stage will implicitly follow on from the result of
its predecessor. (see [below for nested schema](#nestedblock--stage))

<a id="nestedblock--stage"></a>
### Nested Schema for `stage`

Optional:

- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
a stage preceding the last stage. The last stage is an output stage by default.

Read-Only:

- `alias` (String) The stage alias is the label by which subsequent stages can refer to the
Expand All @@ -58,4 +53,6 @@ results of this stage.
the stage pipeline. It must refer to a label contained in `inputs`, or a
previous stage `alias`. The stage input can be omitted if `inputs`
contains a single element.
- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
a stage preceding the last stage. The last stage is an output stage by default.
- `pipeline` (String) An OPAL snippet defining a transformation on the selected input.
37 changes: 17 additions & 20 deletions docs/data-sources/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ One of `id` or `name` must be provided
- `name` (String) Monitor name. Must be unique within workspace.
One of `name` or `id` must be set. If `name` is provided, `workspace` must be set.
- `rule` (Block List) (see [below for nested schema](#nestedblock--rule))
- `stage` (Block List) A stage processes an input according to the provided pipeline. If no
input is provided, a stage will implicitly follow on from the result of
its predecessor. (see [below for nested schema](#nestedblock--stage))
- `workspace` (String) OID of the workspace this object is contained in.

### Read-Only
Expand All @@ -40,6 +37,9 @@ stage pipelines.
- `notification_spec` (Block List) (see [below for nested schema](#nestedblock--notification_spec))
- `oid` (String) OID (Observe ID) for this object. This is the canonical identifier that
should be used when referring to this object in terraform manifests.
- `stage` (Block List) A stage processes an input according to the provided pipeline. If no
input is provided, a stage will implicitly follow on from the result of
its predecessor. (see [below for nested schema](#nestedblock--stage))

<a id="nestedblock--rule"></a>
### Nested Schema for `rule`
Expand Down Expand Up @@ -126,13 +126,20 @@ Read-Only:



<a id="nestedblock--stage"></a>
### Nested Schema for `stage`
<a id="nestedblock--notification_spec"></a>
### Nested Schema for `notification_spec`

Optional:
Read-Only:

- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
a stage preceding the last stage. The last stage is an output stage by default.
- `importance` (String)
- `merge` (String)
- `notify_on_close` (Boolean)
- `notify_on_reminder` (Boolean)
- `reminder_frequency` (String)


<a id="nestedblock--stage"></a>
### Nested Schema for `stage`

Read-Only:

Expand All @@ -142,16 +149,6 @@ results of this stage.
the stage pipeline. It must refer to a label contained in `inputs`, or a
previous stage `alias`. The stage input can be omitted if `inputs`
contains a single element.
- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
a stage preceding the last stage. The last stage is an output stage by default.
- `pipeline` (String) An OPAL snippet defining a transformation on the selected input.


<a id="nestedblock--notification_spec"></a>
### Nested Schema for `notification_spec`

Read-Only:

- `importance` (String)
- `merge` (String)
- `notify_on_close` (Boolean)
- `notify_on_reminder` (Boolean)
- `reminder_frequency` (String)
6 changes: 3 additions & 3 deletions docs/resources/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ Required:
Optional:

- `compare_values` (List of Number)
- `expression_summary` (String)
- `log_stage_index` (Number)
- `source_log_dataset_id` (String)
- `expression_summary` (String) Short summary or comment of how the data for monitor is queried.
- `log_stage_index` (Number) An index of the stage that is used to generate logs for preview. This is usually a stage before aggregation.
- `source_log_dataset_id` (String) ID of the dataset that contains logs for preview.


<a id="nestedblock--rule--promote"></a>
Expand Down
3 changes: 1 addition & 2 deletions observe/data_source_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ func dataSourceDataset() *schema.Resource {
},
"output_stage": {
Type: schema.TypeBool,
Default: false,
Optional: true,
Computed: true,
Description: descriptions.Get("transform", "schema", "stage", "output_stage"),
},
},
Expand Down
3 changes: 1 addition & 2 deletions observe/data_source_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ func dataSourceMonitor() *schema.Resource {
},
"output_stage": {
Type: schema.TypeBool,
Default: false,
Optional: true,
Computed: true,
Description: descriptions.Get("transform", "schema", "stage", "output_stage"),
},
},
Expand Down
8 changes: 8 additions & 0 deletions observe/descriptions/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ schema:
Whether notification reminders are enabled for this monitor. To enable them, set `reminder_frequency`.
notify_on_close: |
Enables a final update when a monitor notification is closed (no longer triggered).
rule:
log:
expression_summary: |
Short summary or comment of how the data for monitor is queried.
log_stage_index: |
An index of the stage that is used to generate logs for preview. This is usually a stage before aggregation.
source_log_dataset_id: |
ID of the dataset that contains logs for preview.
16 changes: 10 additions & 6 deletions observe/resource_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,20 @@ func resourceMonitor() *schema.Resource {
ValidateDiagFunc: validateTimeDuration,
},
"expression_summary": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
Description: descriptions.Get("monitor", "schema", "rule", "log", "expression_summary"),
},
"log_stage_index": {
Type: schema.TypeInt,
Optional: true,
Type: schema.TypeInt,
Optional: true,
Description: descriptions.Get("monitor", "schema", "rule", "log", "log_stage_index"),
},
"source_log_dataset_id": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
Description: descriptions.Get("monitor", "schema", "rule", "log", "source_log_dataset_id"),
ValidateDiagFunc: validateOID(oid.TypeDataset),
},
},
},
Expand Down

0 comments on commit c0ce0ab

Please sign in to comment.