Skip to content

Commit 5eca6cb

Browse files
committed
change label to labels
1 parent 0245259 commit 5eca6cb

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

docs/stackit_beta_volume_create.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ stackit beta volume create [flags]
1616
Create a volume with availability zone "eu01-1" and size 64 GB
1717
$ stackit beta volume create --availability-zone eu01-1 --size 64
1818
19-
Create a volume with name "volume-1", source id "xxx" and type "image"
19+
Create a volume with availability zone "eu01-1", size 64 GB and labels
20+
$ stackit beta volume create --availability-zone eu01-1 --size 64 --labels key=value,foo=bar
21+
22+
Create a volume with name "volume-1", from a source image with ID "xxx"
2023
$ stackit beta volume create --availability-zone eu01-1 --name volume-1 --source-id xxx --source-type image
2124
2225
Create a volume with availability zone "eu01-1", performance class "storage_premium_perf1" and size 64 GB
@@ -29,7 +32,7 @@ stackit beta volume create [flags]
2932
--availability-zone string Availability zone
3033
--description string Volume description
3134
-h, --help Help for "stackit beta volume create"
32-
--label stringToString Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value and the flag can be used multiple times to provide a list of labels (default [])
35+
--labels stringToString Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value. To provide a list of labels, key=value pairs must be seperated by commas(,) e.g. --labels key=value,foo=bar. (default [])
3336
-n, --name string Volume name
3437
--performance-class string Performance class
3538
--size int Volume size (GB). Either 'size' or the 'source-id' and 'source-type' flags must be given

docs/stackit_beta_volume_update.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ stackit beta volume update [flags]
1818
1919
Update volume with ID "xxx" with new name "volume-1-new" and new description "volume-1-desc-new"
2020
$ stackit beta volume update xxx --name volume-1-new --description volume-1-desc-new
21+
22+
Update volume with ID "xxx" with new name "volume-1-new", new description "volume-1-desc-new" and label(s)
23+
$ stackit beta volume update xxx --name volume-1-new --description volume-1-desc-new --labels key=value,foo=bar
2124
```
2225

2326
### Options
2427

2528
```
26-
--description string Volume description
27-
-h, --help Help for "stackit beta volume update"
28-
--label stringToString Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value and the flag can be used multiple times to provide a list of labels (default [])
29-
-n, --name string Volume name
29+
--description string Volume description
30+
-h, --help Help for "stackit beta volume update"
31+
--labels stringToString Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value. To provide a list of labels, key=value pairs must be seperated by commas(,) e.g. --labels key=value,foo=bar. (default [])
32+
-n, --name string Volume name
3033
```
3134

3235
### Options inherited from parent commands

internal/cmd/beta/volume/create/create.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const (
2626
availabilityZoneFlag = "availability-zone"
2727
nameFlag = "name"
2828
descriptionFlag = "description"
29-
labelFlag = "label"
29+
labelFlag = "labels"
3030
performanceClassFlag = "performance-class"
3131
sizeFlag = "size"
3232
sourceIdFlag = "source-id"
@@ -56,6 +56,10 @@ func NewCmd(p *print.Printer) *cobra.Command {
5656
`Create a volume with availability zone "eu01-1" and size 64 GB`,
5757
`$ stackit beta volume create --availability-zone eu01-1 --size 64`,
5858
),
59+
examples.NewExample(
60+
`Create a volume with availability zone "eu01-1", size 64 GB and labels`,
61+
`$ stackit beta volume create --availability-zone eu01-1 --size 64 --labels key=value,foo=bar`,
62+
),
5963
examples.NewExample(
6064
`Create a volume with name "volume-1", from a source image with ID "xxx"`,
6165
`$ stackit beta volume create --availability-zone eu01-1 --name volume-1 --source-id xxx --source-type image`,
@@ -122,7 +126,7 @@ func configureFlags(cmd *cobra.Command) {
122126
cmd.Flags().String(availabilityZoneFlag, "", "Availability zone")
123127
cmd.Flags().StringP(nameFlag, "n", "", "Volume name")
124128
cmd.Flags().String(descriptionFlag, "", "Volume description")
125-
cmd.Flags().StringToString(labelFlag, nil, "Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value and the flag can be used multiple times to provide a list of labels")
129+
cmd.Flags().StringToString(labelFlag, nil, "Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value. To provide a list of labels, key=value pairs must be seperated by commas(,) e.g. --labels key=value,foo=bar.")
126130
cmd.Flags().String(performanceClassFlag, "", "Performance class")
127131
cmd.Flags().Int64(sizeFlag, 0, "Volume size (GB). Either 'size' or the 'source-id' and 'source-type' flags must be given")
128132
cmd.Flags().String(sourceIdFlag, "", "ID of the source object of volume. Either 'size' or the 'source-id' and 'source-type' flags must be given")

internal/cmd/beta/volume/update/update.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const (
2525

2626
nameFlag = "name"
2727
descriptionFlag = "description"
28-
labelFlag = "label"
28+
labelFlag = "labels"
2929
)
3030

3131
type inputModel struct {
@@ -51,6 +51,10 @@ func NewCmd(p *print.Printer) *cobra.Command {
5151
`Update volume with ID "xxx" with new name "volume-1-new" and new description "volume-1-desc-new"`,
5252
`$ stackit beta volume update xxx --name volume-1-new --description volume-1-desc-new`,
5353
),
54+
examples.NewExample(
55+
`Update volume with ID "xxx" with new name "volume-1-new", new description "volume-1-desc-new" and label(s)`,
56+
`$ stackit beta volume update xxx --name volume-1-new --description volume-1-desc-new --labels key=value,foo=bar`,
57+
),
5458
),
5559
RunE: func(cmd *cobra.Command, args []string) error {
5660
ctx := context.Background()
@@ -96,7 +100,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
96100
func configureFlags(cmd *cobra.Command) {
97101
cmd.Flags().StringP(nameFlag, "n", "", "Volume name")
98102
cmd.Flags().String(descriptionFlag, "", "Volume description")
99-
cmd.Flags().StringToString(labelFlag, nil, "Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value and the flag can be used multiple times to provide a list of labels")
103+
cmd.Flags().StringToString(labelFlag, nil, "Labels are key-value string pairs which can be attached to a volume. A label can be provided with the format key=value. To provide a list of labels, key=value pairs must be seperated by commas(,) e.g. --labels key=value,foo=bar.")
100104
}
101105

102106
func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) {

0 commit comments

Comments
 (0)