Skip to content

Commit c0ce0ab

Browse files
Addressed review comments
1 parent 671e44a commit c0ce0ab

File tree

7 files changed

+45
-41
lines changed

7 files changed

+45
-41
lines changed

docs/data-sources/dataset.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ Fetches metadata for an existing Observe dataset.
2222
One of `name` or `id` must be set.
2323
- `name` (String) Dataset name. Must be unique within workspace.
2424
One of `name` or `id` must be set. If `name` is provided, `workspace` must be set.
25-
- `stage` (Block List) A stage processes an input according to the provided pipeline. If no
26-
input is provided, a stage will implicitly follow on from the result of
27-
its predecessor. (see [below for nested schema](#nestedblock--stage))
2825
- `workspace` (String) OID of the workspace this object is contained in.
2926

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

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

48-
Optional:
49-
50-
- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
51-
a stage preceding the last stage. The last stage is an output stage by default.
52-
5348
Read-Only:
5449

5550
- `alias` (String) The stage alias is the label by which subsequent stages can refer to the
@@ -58,4 +53,6 @@ results of this stage.
5853
the stage pipeline. It must refer to a label contained in `inputs`, or a
5954
previous stage `alias`. The stage input can be omitted if `inputs`
6055
contains a single element.
56+
- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
57+
a stage preceding the last stage. The last stage is an output stage by default.
6158
- `pipeline` (String) An OPAL snippet defining a transformation on the selected input.

docs/data-sources/monitor.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ One of `id` or `name` must be provided
2222
- `name` (String) Monitor name. Must be unique within workspace.
2323
One of `name` or `id` must be set. If `name` is provided, `workspace` must be set.
2424
- `rule` (Block List) (see [below for nested schema](#nestedblock--rule))
25-
- `stage` (Block List) A stage processes an input according to the provided pipeline. If no
26-
input is provided, a stage will implicitly follow on from the result of
27-
its predecessor. (see [below for nested schema](#nestedblock--stage))
2825
- `workspace` (String) OID of the workspace this object is contained in.
2926

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

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

127127

128128

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

132-
Optional:
132+
Read-Only:
133133

134-
- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
135-
a stage preceding the last stage. The last stage is an output stage by default.
134+
- `importance` (String)
135+
- `merge` (String)
136+
- `notify_on_close` (Boolean)
137+
- `notify_on_reminder` (Boolean)
138+
- `reminder_frequency` (String)
139+
140+
141+
<a id="nestedblock--stage"></a>
142+
### Nested Schema for `stage`
136143

137144
Read-Only:
138145

@@ -142,16 +149,6 @@ results of this stage.
142149
the stage pipeline. It must refer to a label contained in `inputs`, or a
143150
previous stage `alias`. The stage input can be omitted if `inputs`
144151
contains a single element.
152+
- `output_stage` (Boolean) A boolean flag used to specify the output stage. Should be used only for
153+
a stage preceding the last stage. The last stage is an output stage by default.
145154
- `pipeline` (String) An OPAL snippet defining a transformation on the selected input.
146-
147-
148-
<a id="nestedblock--notification_spec"></a>
149-
### Nested Schema for `notification_spec`
150-
151-
Read-Only:
152-
153-
- `importance` (String)
154-
- `merge` (String)
155-
- `notify_on_close` (Boolean)
156-
- `notify_on_reminder` (Boolean)
157-
- `reminder_frequency` (String)

docs/resources/monitor.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ Required:
121121
Optional:
122122

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

128128

129129
<a id="nestedblock--rule--promote"></a>

observe/data_source_dataset.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ func dataSourceDataset() *schema.Resource {
107107
},
108108
"output_stage": {
109109
Type: schema.TypeBool,
110-
Default: false,
111-
Optional: true,
110+
Computed: true,
112111
Description: descriptions.Get("transform", "schema", "stage", "output_stage"),
113112
},
114113
},

observe/data_source_monitor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ func dataSourceMonitor() *schema.Resource {
105105
},
106106
"output_stage": {
107107
Type: schema.TypeBool,
108-
Default: false,
109-
Optional: true,
108+
Computed: true,
110109
Description: descriptions.Get("transform", "schema", "stage", "output_stage"),
111110
},
112111
},

observe/descriptions/monitor.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ schema:
2626
Whether notification reminders are enabled for this monitor. To enable them, set `reminder_frequency`.
2727
notify_on_close: |
2828
Enables a final update when a monitor notification is closed (no longer triggered).
29+
rule:
30+
log:
31+
expression_summary: |
32+
Short summary or comment of how the data for monitor is queried.
33+
log_stage_index: |
34+
An index of the stage that is used to generate logs for preview. This is usually a stage before aggregation.
35+
source_log_dataset_id: |
36+
ID of the dataset that contains logs for preview.

observe/resource_monitor.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,20 @@ func resourceMonitor() *schema.Resource {
374374
ValidateDiagFunc: validateTimeDuration,
375375
},
376376
"expression_summary": {
377-
Type: schema.TypeString,
378-
Optional: true,
377+
Type: schema.TypeString,
378+
Optional: true,
379+
Description: descriptions.Get("monitor", "schema", "rule", "log", "expression_summary"),
379380
},
380381
"log_stage_index": {
381-
Type: schema.TypeInt,
382-
Optional: true,
382+
Type: schema.TypeInt,
383+
Optional: true,
384+
Description: descriptions.Get("monitor", "schema", "rule", "log", "log_stage_index"),
383385
},
384386
"source_log_dataset_id": {
385-
Type: schema.TypeString,
386-
Optional: true,
387+
Type: schema.TypeString,
388+
Optional: true,
389+
Description: descriptions.Get("monitor", "schema", "rule", "log", "source_log_dataset_id"),
390+
ValidateDiagFunc: validateOID(oid.TypeDataset),
387391
},
388392
},
389393
},

0 commit comments

Comments
 (0)