Skip to content

Commit 848400e

Browse files
authored
Implement YAML output format (#298)
* initial implementation yamlOutputFormal * sort imports * change yaml library * add yaml output format * tidy up imports * tidy up imports * update docs * add yaml output for project and organization role lists * extend contribution.md * change yaml library
1 parent 3908cf1 commit 848400e

File tree

337 files changed

+1218
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+1218
-256
lines changed

CONTRIBUTION.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat string, res
173173
}
174174
p.Outputln(string(details))
175175
return nil
176+
case print.YAMLOutputFormat:
177+
details, err := yaml.Marshal(resources)
178+
if err != nil {
179+
return fmt.Errorf("marshal resource list: %w", err)
180+
}
181+
p.Outputln(string(details))
182+
return nil
176183
default:
177184
table := tables.NewTable()
178185
table.SetHeader("ID", "NAME", "STATE")

docs/stackit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ stackit [flags]
1818
-y, --assume-yes If set, skips all confirmation prompts
1919
--async If set, runs the command asynchronously
2020
-h, --help Help for "stackit"
21-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
21+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
2222
-p, --project-id string Project ID
2323
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
2424
-v, --version Show "stackit" version

docs/stackit_argus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ stackit argus [flags]
2121
```
2222
-y, --assume-yes If set, skips all confirmation prompts
2323
--async If set, runs the command asynchronously
24-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
2525
-p, --project-id string Project ID
2626
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
2727
```

docs/stackit_argus_credentials.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ stackit argus credentials [flags]
2121
```
2222
-y, --assume-yes If set, skips all confirmation prompts
2323
--async If set, runs the command asynchronously
24-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
2525
-p, --project-id string Project ID
2626
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
2727
```

docs/stackit_argus_credentials_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ stackit argus credentials create [flags]
3030
```
3131
-y, --assume-yes If set, skips all confirmation prompts
3232
--async If set, runs the command asynchronously
33-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
33+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
3434
-p, --project-id string Project ID
3535
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
3636
```

docs/stackit_argus_credentials_delete.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ stackit argus credentials delete USERNAME [flags]
2929
```
3030
-y, --assume-yes If set, skips all confirmation prompts
3131
--async If set, runs the command asynchronously
32-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
32+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
3333
-p, --project-id string Project ID
3434
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
3535
```

docs/stackit_argus_credentials_list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ stackit argus credentials list [flags]
3636
```
3737
-y, --assume-yes If set, skips all confirmation prompts
3838
--async If set, runs the command asynchronously
39-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
39+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
4040
-p, --project-id string Project ID
4141
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
4242
```

docs/stackit_argus_grafana.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ stackit argus grafana [flags]
2121
```
2222
-y, --assume-yes If set, skips all confirmation prompts
2323
--async If set, runs the command asynchronously
24-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
2525
-p, --project-id string Project ID
2626
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
2727
```

docs/stackit_argus_grafana_describe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ stackit argus grafana describe INSTANCE_ID [flags]
3737
```
3838
-y, --assume-yes If set, skips all confirmation prompts
3939
--async If set, runs the command asynchronously
40-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
40+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
4141
-p, --project-id string Project ID
4242
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
4343
```

docs/stackit_argus_grafana_public-read-access.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ stackit argus grafana public-read-access [flags]
2222
```
2323
-y, --assume-yes If set, skips all confirmation prompts
2424
--async If set, runs the command asynchronously
25-
-o, --output-format string Output format, one of ["json" "pretty" "none"]
25+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
2626
-p, --project-id string Project ID
2727
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
2828
```

0 commit comments

Comments
 (0)