Skip to content

Commit 119c5fb

Browse files
committed
Change "Key Pair" to lowercase
- Add key-pair command to `README` - Uniform commands
1 parent e4a2a81 commit 119c5fb

File tree

7 files changed

+49
-49
lines changed

7 files changed

+49
-49
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Below you can find a list of the STACKIT services already available in the CLI (
6868
| Service | CLI Commands | Status |
6969
| ---------------------------------- |----------------------------------------------------------------------------------------------------------------------| ------------------------- |
7070
| Observability | `observability` | :white_check_mark: |
71-
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface` <br/> `beta public-ip` | :white_check_mark: (beta) |
71+
| Infrastructure as a Service (IaaS) | `beta network-area` <br/> `beta network` <br/> `beta volume` <br/> `beta network-interface` <br/> `beta public-ip` <br/> `beta key-pair` | :white_check_mark: (beta) |
7272
| Authorization | `project`, `organization` | :white_check_mark: |
7373
| DNS | `dns` | :white_check_mark: |
7474
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |

internal/cmd/beta/key-pair/create/create.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,24 @@ type inputModel struct {
3333
func NewCmd(p *print.Printer) *cobra.Command {
3434
cmd := &cobra.Command{
3535
Use: "create",
36-
Short: "Create a Key Pair",
37-
Long: "Create a Key Pair.",
36+
Short: "Creates a key pair",
37+
Long: "Creates a key pair.",
3838
Args: cobra.NoArgs,
3939
Example: examples.Build(
4040
examples.NewExample(
41-
`Create a new Key Pair with public-key "ssh-rsa xxx"`,
41+
`Create a new key pair with public-key "ssh-rsa xxx"`,
4242
"$ stackit beta key-pair create --public-key `ssh-rsa xxx`",
4343
),
4444
examples.NewExample(
45-
`Create a new Key Pair with public-key from file "/Users/username/.ssh/id_rsa.pub"`,
45+
`Create a new key pair with public-key from file "/Users/username/.ssh/id_rsa.pub"`,
4646
"$ stackit beta key-pair create --public-key `@/Users/username/.ssh/id_rsa.pub`",
4747
),
4848
examples.NewExample(
49-
`Create a new Key Pair with name "KEY_PAIR_NAME" and public-key "ssh-rsa yyy"`,
49+
`Create a new key pair with name "KEY_PAIR_NAME" and public-key "ssh-rsa yyy"`,
5050
"$ stackit beta key-pair create --name KEY_PAIR_NAME --public-key `ssh-rsa yyy`",
5151
),
5252
examples.NewExample(
53-
`Create a new Key Pair with public-key "ssh-rsa xxx" and labels "key=value,key1=value1"`,
53+
`Create a new key pair with public-key "ssh-rsa xxx" and labels "key=value,key1=value1"`,
5454
"$ stackit beta key-pair create --public-key `ssh-rsa xxx` --labels key=value,key1=value1",
5555
),
5656
),
@@ -68,7 +68,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
6868
}
6969

7070
if !model.AssumeYes {
71-
prompt := "Are your sure you want to create a Key Pair?"
71+
prompt := "Are your sure you want to create a key pair?"
7272
err = p.PromptForConfirmation(prompt)
7373
if err != nil {
7474
return err
@@ -79,7 +79,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
7979
req := buildRequest(ctx, model, apiClient)
8080
resp, err := req.Execute()
8181
if err != nil {
82-
return fmt.Errorf("create Key Pair: %w", err)
82+
return fmt.Errorf("create key pair: %w", err)
8383
}
8484

8585
return outputResult(p, model, resp)
@@ -90,9 +90,9 @@ func NewCmd(p *print.Printer) *cobra.Command {
9090
}
9191

9292
func configureFlags(cmd *cobra.Command) {
93-
cmd.Flags().String(nameFlag, "", "Key Pair name")
93+
cmd.Flags().String(nameFlag, "", "key pair name")
9494
cmd.Flags().Var(flags.ReadFromFileFlag(), publicKeyFlag, "Public key to be imported (format: ssh-rsa|ssh-ed25519)")
95-
cmd.Flags().StringToString(labelFlag, nil, "Labels are key-value string pairs which can be attached to a Key Pair. E.g. '--labels key1=value1,key2=value2,...'")
95+
cmd.Flags().StringToString(labelFlag, nil, "Labels are key-value string pairs which can be attached to a key pair. E.g. '--labels key1=value1,key2=value2,...'")
9696

9797
err := cmd.MarkFlagRequired(publicKeyFlag)
9898
cobra.CheckErr(err)
@@ -146,17 +146,17 @@ func outputResult(p *print.Printer, model *inputModel, item *iaas.Keypair) error
146146
case print.JSONOutputFormat:
147147
details, err := json.MarshalIndent(item, "", " ")
148148
if err != nil {
149-
return fmt.Errorf("marshal Key Pair: %w", err)
149+
return fmt.Errorf("marshal key pair: %w", err)
150150
}
151151
p.Outputln(string(details))
152152
case print.YAMLOutputFormat:
153153
details, err := yaml.MarshalWithOptions(item, yaml.IndentSequence(true))
154154
if err != nil {
155-
return fmt.Errorf("marshal Key Pair: %w", err)
155+
return fmt.Errorf("marshal key pair: %w", err)
156156
}
157157
p.Outputln(string(details))
158158
default:
159-
p.Outputf("Created Key Pair %q.\nKey Pair Fingerprint: %q\n", *item.Name, *item.Fingerprint)
159+
p.Outputf("Created key pair %q.\nkey pair Fingerprint: %q\n", *item.Name, *item.Fingerprint)
160160
}
161161
return nil
162162
}

internal/cmd/beta/key-pair/delete/delete.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ type inputModel struct {
2626
func NewCmd(p *print.Printer) *cobra.Command {
2727
cmd := &cobra.Command{
2828
Use: "delete",
29-
Short: "Delete a Key Pair",
30-
Long: "Delete a Key Pair.",
29+
Short: "Deletes a key pair",
30+
Long: "Deletes a key pair.",
3131
Args: args.SingleArg(keyPairNameArg, nil),
3232
Example: examples.Build(
3333
examples.NewExample(
34-
`Delete Key Pair with name "KEY_PAIR_NAME"`,
34+
`Delete key pair with name "KEY_PAIR_NAME"`,
3535
"$ stackit beta key-pair delete KEY_PAIR_NAME",
3636
),
3737
),
@@ -49,7 +49,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
4949
}
5050

5151
if !model.AssumeYes {
52-
prompt := fmt.Sprintf("Are you sure you want to delete Key Pair %q?", model.KeyPairName)
52+
prompt := fmt.Sprintf("Are you sure you want to delete key pair %q?", model.KeyPairName)
5353
err = p.PromptForConfirmation(prompt)
5454
if err != nil {
5555
return err
@@ -60,10 +60,10 @@ func NewCmd(p *print.Printer) *cobra.Command {
6060
req := buildRequest(ctx, model, apiClient)
6161
err = req.Execute()
6262
if err != nil {
63-
return fmt.Errorf("delete Key Pair: %w", err)
63+
return fmt.Errorf("delete key pair: %w", err)
6464
}
6565

66-
p.Info("Deleted Key Pair %q\n", model.KeyPairName)
66+
p.Info("Deleted key pair %q\n", model.KeyPairName)
6767

6868
return nil
6969
},

internal/cmd/beta/key-pair/describe/describe.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ type inputModel struct {
3636
func NewCmd(p *print.Printer) *cobra.Command {
3737
cmd := &cobra.Command{
3838
Use: "describe",
39-
Short: "Describe a Key Pair",
40-
Long: "Describe a Key Pair.",
39+
Short: "Describes a key pair",
40+
Long: "Describes a key pair.",
4141
Args: args.SingleArg(keyPairNameArg, nil),
4242
Example: examples.Build(
4343
examples.NewExample(
44-
`Get details about a Key Pair with name "KEY_PAIR_NAME"`,
44+
`Get details about a key pair with name "KEY_PAIR_NAME"`,
4545
"$ stackit beta key-pair describe KEY_PAIR_NAME",
4646
),
4747
examples.NewExample(
48-
`Get only the SSH public key of a Key Pair with name "KEY_PAIR_NAME"`,
48+
`Get only the SSH public key of a key pair with name "KEY_PAIR_NAME"`,
4949
"$ stackit beta key-pair describe KEY_PAIR_NAME --public-key",
5050
),
5151
),
@@ -66,7 +66,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
6666
req := buildRequest(ctx, model, apiClient)
6767
resp, err := req.Execute()
6868
if err != nil {
69-
return fmt.Errorf("read Key Pair: %w", err)
69+
return fmt.Errorf("read key pair: %w", err)
7070
}
7171

7272
return outputResult(p, model.OutputFormat, model.PublicKey, resp)
@@ -119,7 +119,7 @@ func outputResult(p *print.Printer, outputFormat string, showOnlyPublicKey bool,
119119
}
120120

121121
if err != nil {
122-
return fmt.Errorf("marshal Key Pair: %w", err)
122+
return fmt.Errorf("marshal key pair: %w", err)
123123
}
124124
p.Outputln(string(details))
125125

@@ -134,7 +134,7 @@ func outputResult(p *print.Printer, outputFormat string, showOnlyPublicKey bool,
134134
}
135135

136136
if err != nil {
137-
return fmt.Errorf("marshal Key Pair: %w", err)
137+
return fmt.Errorf("marshal key pair: %w", err)
138138
}
139139
p.Outputln(string(details))
140140

internal/cmd/beta/key-pair/key-pair.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
func NewCmd(p *print.Printer) *cobra.Command {
1616
cmd := &cobra.Command{
1717
Use: "key-pair",
18-
Short: "Provides functionality for SSH Key Pairs",
19-
Long: "Provides functionality for SSH Key Pairs",
18+
Short: "Provides functionality for SSH key pairs",
19+
Long: "Provides functionality for SSH key pairs",
2020
Args: cobra.NoArgs,
2121
Run: utils.CmdHelp,
2222
}

internal/cmd/beta/key-pair/list/list.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ type inputModel struct {
3434
func NewCmd(p *print.Printer) *cobra.Command {
3535
cmd := &cobra.Command{
3636
Use: "list",
37-
Short: "Lists all Key Pairs",
38-
Long: "Lists all Key Pairs.",
37+
Short: "Lists all key pairs",
38+
Long: "Lists all key pairs.",
3939
Args: args.NoArgs,
4040
Example: examples.Build(
4141
examples.NewExample(
42-
`Lists all Key Pairs`,
42+
`Lists all key pairs`,
4343
"$ stackit beta key-pair list",
4444
),
4545
examples.NewExample(
46-
`Lists all Key Pairs which contains the label xxx`,
46+
`Lists all key pairs which contains the label xxx`,
4747
"$ stackit beta key-pair list --label-selector xxx",
4848
),
4949
examples.NewExample(
50-
`Lists all Key Pairs in JSON format`,
50+
`Lists all key pairs in JSON format`,
5151
"$ stackit beta key-pair list --output-format json",
5252
),
5353
examples.NewExample(
54-
`Lists up to 10 Key Pairs`,
54+
`Lists up to 10 key pairs`,
5555
"$ stackit beta key-pair list --limit 10",
5656
),
5757
),
@@ -72,11 +72,11 @@ func NewCmd(p *print.Printer) *cobra.Command {
7272
req := buildRequest(ctx, model, apiClient)
7373
resp, err := req.Execute()
7474
if err != nil {
75-
return fmt.Errorf("list Key Pairs: %w", err)
75+
return fmt.Errorf("list key pairs: %w", err)
7676
}
7777

7878
if resp.Items == nil || len(*resp.Items) == 0 {
79-
p.Info("No Key Pairs found\n")
79+
p.Info("No key pairs found\n")
8080
return nil
8181
}
8282

@@ -93,7 +93,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
9393
}
9494

9595
func configureFlags(cmd *cobra.Command) {
96-
cmd.Flags().Int64(limitFlag, 0, "Number of Key Pairs to list")
96+
cmd.Flags().Int64(limitFlag, 0, "Number of key pairs to list")
9797
cmd.Flags().String(labelSelectorFlag, "", "Filter by label")
9898
}
9999

@@ -139,14 +139,14 @@ func outputResult(p *print.Printer, outputFormat string, keyPairs []iaas.Keypair
139139
case print.JSONOutputFormat:
140140
details, err := json.MarshalIndent(keyPairs, "", " ")
141141
if err != nil {
142-
return fmt.Errorf("marshal Key Pairs: %w", err)
142+
return fmt.Errorf("marshal key pairs: %w", err)
143143
}
144144
p.Outputln(string(details))
145145

146146
case print.YAMLOutputFormat:
147147
details, err := yaml.MarshalWithOptions(keyPairs, yaml.IndentSequence(true))
148148
if err != nil {
149-
return fmt.Errorf("marshal Key Pairs: %w", err)
149+
return fmt.Errorf("marshal key pairs: %w", err)
150150
}
151151
p.Outputln(string(details))
152152

internal/cmd/beta/key-pair/update/update.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ type inputModel struct {
3232
func NewCmd(p *print.Printer) *cobra.Command {
3333
cmd := &cobra.Command{
3434
Use: "update",
35-
Short: "Update Key Pair",
36-
Long: "Update Key Pair.",
35+
Short: "Updates a key pair",
36+
Long: "Updates a key pair.",
3737
Args: args.SingleArg(keyPairNameArg, nil),
3838
Example: examples.Build(
3939
examples.NewExample(
40-
`Update the labels of a Key Pair KEY_PAIR_NAME with "key=value,key1=value1"`,
40+
`Update the labels of a key pair with name "KEY_PAIR_NAME" with "key=value,key1=value1"`,
4141
"$ stackit beta key-pair update KEY_PAIR_NAME --labels key=value,key1=value1",
4242
),
4343
),
@@ -55,18 +55,18 @@ func NewCmd(p *print.Printer) *cobra.Command {
5555
}
5656

5757
if !model.AssumeYes {
58-
prompt := fmt.Sprintf("Are you sure you want to update Key Pair %q?", *model.KeyPairName)
58+
prompt := fmt.Sprintf("Are you sure you want to update key pair %q?", *model.KeyPairName)
5959
err = p.PromptForConfirmation(prompt)
6060
if err != nil {
61-
return fmt.Errorf("update Key Pair: %w", err)
61+
return fmt.Errorf("update key pair: %w", err)
6262
}
6363
}
6464

6565
// Call API
6666
req := buildRequest(ctx, model, apiClient)
6767
resp, err := req.Execute()
6868
if err != nil {
69-
return fmt.Errorf("update Key Pair: %w", err)
69+
return fmt.Errorf("update key pair: %w", err)
7070
}
7171

7272
return outputResult(p, model, resp)
@@ -127,17 +127,17 @@ func outputResult(p *print.Printer, model *inputModel, keyPair *iaas.Keypair) er
127127
case print.JSONOutputFormat:
128128
details, err := json.MarshalIndent(keyPair, "", " ")
129129
if err != nil {
130-
return fmt.Errorf("marshal Key Pair: %w", err)
130+
return fmt.Errorf("marshal key pair: %w", err)
131131
}
132132
p.Outputln(string(details))
133133
case print.YAMLOutputFormat:
134134
details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true))
135135
if err != nil {
136-
return fmt.Errorf("marshal Key Pair: %w", err)
136+
return fmt.Errorf("marshal key pair: %w", err)
137137
}
138138
p.Outputln(string(details))
139139
default:
140-
p.Outputf("Updated labels of Key Pair %q\n", *model.KeyPairName)
140+
p.Outputf("Updated labels of key pair %q\n", *model.KeyPairName)
141141
}
142142
return nil
143143
}

0 commit comments

Comments
 (0)