Skip to content

Commit 7c1920f

Browse files
authored
chore(docs): improve docs for image_v2 and machine_type (#977)
* chore(docs): improve docs for image_v2 and machine_type Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud> * review changes Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud> --------- Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>
1 parent 0eaaf75 commit 7c1920f

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

docs/data-sources/image_v2.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ description: |-
2020
}
2121
}
2222
23+
You can also list available images using the STACKIT CLI https://github.com/stackitcloud/stackit-cli:
24+
25+
stackit image list
26+
2327
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
2428
---
2529

@@ -47,6 +51,12 @@ resource "stackit_server" "example" {
4751
}
4852
```
4953

54+
You can also list available images using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):
55+
56+
```bash
57+
stackit image list
58+
```
59+
5060
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
5161

5262
## Example Usage

docs/data-sources/machine_type.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ Examples:
5252
- extraSpecs.cpu == "intel-icelake-generic"
5353
- extraSpecs.cpu == "intel-icelake-generic" && vcpus == 2
5454

55-
See https://expr-lang.org/docs/language-definition for syntax.
55+
Syntax reference: https://expr-lang.org/docs/language-definition
56+
57+
You can also list available machine-types using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):
58+
59+
```bash
60+
stackit server machine-type list
61+
```
5662
- `project_id` (String) STACKIT Project ID.
5763

5864
### Optional

stackit/internal/services/iaas/imagev2/datasource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ func (d *imageDataV2Source) Schema(_ context.Context, _ datasource.SchemaRequest
178178
" ignore_changes = [boot_volume[0].source_id]\n"+
179179
" }\n"+
180180
"}\n"+
181+
"```\n\n"+
182+
"You can also list available images using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n\n"+
183+
"```bash\n"+
184+
"stackit image list\n"+
181185
"```",
182186
), core.Datasource)
183187
resp.Schema = schema.Schema{

stackit/internal/services/iaas/machinetype/datasource.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,17 @@ func (d *machineTypeDataSource) Schema(_ context.Context, _ datasource.SchemaReq
9292
Optional: true,
9393
},
9494
"filter": schema.StringAttribute{
95-
Description: `Expr-lang filter for filtering machine types.
96-
97-
Examples:
98-
- vcpus == 2
99-
- ram >= 2048
100-
- extraSpecs.cpu == "intel-icelake-generic"
101-
- extraSpecs.cpu == "intel-icelake-generic" && vcpus == 2
102-
103-
See https://expr-lang.org/docs/language-definition for syntax.`,
95+
Description: "Expr-lang filter for filtering machine types.\n\n" +
96+
"Examples:\n" +
97+
"- vcpus == 2\n" +
98+
"- ram >= 2048\n" +
99+
"- extraSpecs.cpu == \"intel-icelake-generic\"\n" +
100+
"- extraSpecs.cpu == \"intel-icelake-generic\" && vcpus == 2\n\n" +
101+
"Syntax reference: https://expr-lang.org/docs/language-definition\n\n" +
102+
"You can also list available machine-types using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n\n" +
103+
"```bash\n" +
104+
"stackit server machine-type list\n" +
105+
"```",
104106
Required: true,
105107
},
106108
"description": schema.StringAttribute{

0 commit comments

Comments
 (0)