From 7b5cbaabbe7b49732a668cb959874fce2494d4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 17 Apr 2023 15:41:42 +0200 Subject: [PATCH] Fix --- ...ge-vpc-private-network-create-usage.golden | 8 +- ...ge-vpc-private-network-delete-usage.golden | 4 +- ...usage-vpc-private-network-get-usage.golden | 4 +- ...sage-vpc-private-network-list-usage.golden | 16 ++-- ...ge-vpc-private-network-update-usage.golden | 10 +-- ...all-usage-vpc-private-network-usage.golden | 21 +++--- docs/commands/vpc.md | 73 +++++++++---------- internal/namespaces/vpc/v1/vpc_cli.go | 63 ++++++++-------- 8 files changed, 95 insertions(+), 104 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-vpc-private-network-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-private-network-create-usage.golden index 61a2868e4a..784667efd3 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-private-network-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-private-network-create-usage.golden @@ -1,15 +1,15 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Create a private network. +Create a new Private Network. Once created, you can attach Scaleway resources in the same Availability Zone. USAGE: scw vpc private-network create [arg=value ...] ARGS: - name= The name of the private network + name= Name for the Private Network [project-id] Project ID to use. If none is passed the default project ID will be used - [tags.{index}] The private networks tags - [subnets.{index}] Private network subnets CIDR + [tags.{index}] Tags for the Private Network + [subnets.{index}] Private Network subnets CIDR [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-vpc-private-network-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-private-network-delete-usage.golden index 9f6e5e1625..0fd219235c 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-private-network-delete-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-private-network-delete-usage.golden @@ -1,12 +1,12 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Delete a private network. +Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it. USAGE: scw vpc private-network delete [arg=value ...] ARGS: - private-network-id The private network ID + private-network-id Private Network ID [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-vpc-private-network-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-private-network-get-usage.golden index 9efdbec341..cb98e4ed0f 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-private-network-get-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-private-network-get-usage.golden @@ -1,12 +1,12 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Get a private network. +Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object. USAGE: scw vpc private-network get [arg=value ...] ARGS: - private-network-id The private network id + private-network-id Private Network ID [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-vpc-private-network-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-private-network-list-usage.golden index 0fb6d2bd26..d00ab4cbb7 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-private-network-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-private-network-list-usage.golden @@ -1,18 +1,18 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -List private networks. +List existing Private Networks in a specified Availability Zone. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. USAGE: scw vpc private-network list [arg=value ...] ARGS: - [order-by] The sort order of the returned private networks (created_at_asc | created_at_desc | name_asc | name_desc) - [name] Filter private networks with names containing this string - [tags.{index}] Filter private networks with one or more matching tags - [project-id] The project ID on which to filter the returned private networks - [private-network-ids.{index}] The PrivateNetwork IDs on which to filter the returned private networks - [include-regional] Include regional Private Networks - [organization-id] The organization ID on which to filter the returned private networks + [order-by] Sort order of the returned Private Networks (created_at_asc | created_at_desc | name_asc | name_desc) + [name] Name to filter for. Only Private Networks with names containing this string will be returned + [tags.{index}] Tags to filter for. Only Private Networks with one or more matching tags will be returned + [project-id] Project ID to filter for. Only Private Networks belonging to this Project will be returned + [private-network-ids.{index}] Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned + [include-regional] Defines whether to include regional Private Networks in the response + [organization-id] Organization ID to filter for. Only Private Networks belonging to this Organization will be returned [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2 | all) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-vpc-private-network-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-private-network-update-usage.golden index ffdcd3af64..19bc9fe24e 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-private-network-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-private-network-update-usage.golden @@ -1,18 +1,18 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Update private network. +Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID. USAGE: scw vpc private-network update [arg=value ...] ARGS: - private-network-id The private network ID - [name] The name of the private network - [tags.{index}] The private networks tags + private-network-id Private Network ID + [name] Name of the private network + [tags.{index}] Tags for the Private Network [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2) DEPRECATED ARGS: - [subnets.{index}] Private network subnets CIDR (deprecated) + [subnets.{index}] Private Network subnets CIDR (deprecated) FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-vpc-private-network-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-private-network-usage.golden index 400357a313..adae154276 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-private-network-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-private-network-usage.golden @@ -1,22 +1,19 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -A private network allows interconnecting your instances in an -isolated and private network. The network reachability is limited -to the instances that are on the same private network. Network -Interface Controllers (NICs) are available on the instance and can -be freely managed (adding IP addresses, shutdown interface...) - -Note that an instance can be a part of multiple private networks. +A Private Network allows you to interconnect your Scaleway resources in an +isolated and private network. Network reachability is limited +to resources that are on the same Private Network. Note that a resource can +be part of multiple Private Networks. USAGE: scw vpc private-network AVAILABLE COMMANDS: - create Create a private network - delete Delete a private network - get Get a private network - list List private networks - update Update private network + create Create a Private Network + delete Delete a Private Network + get Get a Private Network + list List Private Networks + update Update Private Network FLAGS: -h, --help help for private-network diff --git a/docs/commands/vpc.md b/docs/commands/vpc.md index 5e7575854f..5ca6b078e1 100644 --- a/docs/commands/vpc.md +++ b/docs/commands/vpc.md @@ -3,28 +3,25 @@ VPC API. - [Private network management command](#private-network-management-command) - - [Create a private network](#create-a-private-network) - - [Delete a private network](#delete-a-private-network) - - [Get a private network](#get-a-private-network) - - [List private networks](#list-private-networks) - - [Update private network](#update-private-network) + - [Create a Private Network](#create-a-private-network) + - [Delete a Private Network](#delete-a-private-network) + - [Get a Private Network](#get-a-private-network) + - [List Private Networks](#list-private-networks) + - [Update Private Network](#update-private-network) ## Private network management command -A private network allows interconnecting your instances in an -isolated and private network. The network reachability is limited -to the instances that are on the same private network. Network -Interface Controllers (NICs) are available on the instance and can -be freely managed (adding IP addresses, shutdown interface...) +A Private Network allows you to interconnect your Scaleway resources in an +isolated and private network. Network reachability is limited +to resources that are on the same Private Network. Note that a resource can +be part of multiple Private Networks. -Note that an instance can be a part of multiple private networks. +### Create a Private Network -### Create a private network - -Create a private network. +Create a new Private Network. Once created, you can attach Scaleway resources in the same Availability Zone. **Usage:** @@ -37,17 +34,17 @@ scw vpc private-network create [arg=value ...] | Name | | Description | |------|---|-------------| -| name | Required
Default: `` | The name of the private network | +| name | Required
Default: `` | Name for the Private Network | | project-id | | Project ID to use. If none is passed the default project ID will be used | -| tags.{index} | | The private networks tags | -| subnets.{index} | | Private network subnets CIDR | +| tags.{index} | | Tags for the Private Network | +| subnets.{index} | | Private Network subnets CIDR | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | -### Delete a private network +### Delete a Private Network -Delete a private network. +Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it. **Usage:** @@ -60,14 +57,14 @@ scw vpc private-network delete [arg=value ...] | Name | | Description | |------|---|-------------| -| private-network-id | Required | The private network ID | +| private-network-id | Required | Private Network ID | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | -### Get a private network +### Get a Private Network -Get a private network. +Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object. **Usage:** @@ -80,14 +77,14 @@ scw vpc private-network get [arg=value ...] | Name | | Description | |------|---|-------------| -| private-network-id | Required | The private network id | +| private-network-id | Required | Private Network ID | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | -### List private networks +### List Private Networks -List private networks. +List existing Private Networks in a specified Availability Zone. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. **Usage:** @@ -100,20 +97,20 @@ scw vpc private-network list [arg=value ...] | Name | | Description | |------|---|-------------| -| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | The sort order of the returned private networks | -| name | | Filter private networks with names containing this string | -| tags.{index} | | Filter private networks with one or more matching tags | -| project-id | | The project ID on which to filter the returned private networks | -| private-network-ids.{index} | | The PrivateNetwork IDs on which to filter the returned private networks | -| include-regional | | Include regional Private Networks | -| organization-id | | The organization ID on which to filter the returned private networks | +| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Sort order of the returned Private Networks | +| name | | Name to filter for. Only Private Networks with names containing this string will be returned | +| tags.{index} | | Tags to filter for. Only Private Networks with one or more matching tags will be returned | +| project-id | | Project ID to filter for. Only Private Networks belonging to this Project will be returned | +| private-network-ids.{index} | | Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned | +| include-regional | | Defines whether to include regional Private Networks in the response | +| organization-id | | Organization ID to filter for. Only Private Networks belonging to this Organization will be returned | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2`, `all` | Zone to target. If none is passed will use default zone from the config | -### Update private network +### Update Private Network -Update private network. +Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID. **Usage:** @@ -126,10 +123,10 @@ scw vpc private-network update [arg=value ...] | Name | | Description | |------|---|-------------| -| private-network-id | Required | The private network ID | -| name | | The name of the private network | -| tags.{index} | | The private networks tags | -| ~~subnets.{index}~~ | Deprecated | Private network subnets CIDR (deprecated) | +| private-network-id | Required | Private Network ID | +| name | | Name of the private network | +| tags.{index} | | Tags for the Private Network | +| ~~subnets.{index}~~ | Deprecated | Private Network subnets CIDR (deprecated) | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | diff --git a/internal/namespaces/vpc/v1/vpc_cli.go b/internal/namespaces/vpc/v1/vpc_cli.go index 7ae67ba058..b88257f4bc 100644 --- a/internal/namespaces/vpc/v1/vpc_cli.go +++ b/internal/namespaces/vpc/v1/vpc_cli.go @@ -39,13 +39,10 @@ func vpcRoot() *core.Command { func vpcPrivateNetwork() *core.Command { return &core.Command{ Short: `Private network management command`, - Long: `A private network allows interconnecting your instances in an -isolated and private network. The network reachability is limited -to the instances that are on the same private network. Network -Interface Controllers (NICs) are available on the instance and can -be freely managed (adding IP addresses, shutdown interface...) - -Note that an instance can be a part of multiple private networks. + Long: `A Private Network allows you to interconnect your Scaleway resources in an +isolated and private network. Network reachability is limited +to resources that are on the same Private Network. Note that a resource can +be part of multiple Private Networks. `, Namespace: "vpc", Resource: "private-network", @@ -54,8 +51,8 @@ Note that an instance can be a part of multiple private networks. func vpcPrivateNetworkList() *core.Command { return &core.Command{ - Short: `List private networks`, - Long: `List private networks.`, + Short: `List Private Networks`, + Long: `List existing Private Networks in a specified Availability Zone. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.`, Namespace: "vpc", Resource: "private-network", Verb: "list", @@ -64,7 +61,7 @@ func vpcPrivateNetworkList() *core.Command { ArgSpecs: core.ArgSpecs{ { Name: "order-by", - Short: `The sort order of the returned private networks`, + Short: `Sort order of the returned Private Networks`, Required: false, Deprecated: false, Positional: false, @@ -72,42 +69,42 @@ func vpcPrivateNetworkList() *core.Command { }, { Name: "name", - Short: `Filter private networks with names containing this string`, + Short: `Name to filter for. Only Private Networks with names containing this string will be returned`, Required: false, Deprecated: false, Positional: false, }, { Name: "tags.{index}", - Short: `Filter private networks with one or more matching tags`, + Short: `Tags to filter for. Only Private Networks with one or more matching tags will be returned`, Required: false, Deprecated: false, Positional: false, }, { Name: "project-id", - Short: `The project ID on which to filter the returned private networks`, + Short: `Project ID to filter for. Only Private Networks belonging to this Project will be returned`, Required: false, Deprecated: false, Positional: false, }, { Name: "private-network-ids.{index}", - Short: `The PrivateNetwork IDs on which to filter the returned private networks`, + Short: `Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned`, Required: false, Deprecated: false, Positional: false, }, { Name: "include-regional", - Short: `Include regional Private Networks`, + Short: `Defines whether to include regional Private Networks in the response`, Required: false, Deprecated: false, Positional: false, }, { Name: "organization-id", - Short: `The organization ID on which to filter the returned private networks`, + Short: `Organization ID to filter for. Only Private Networks belonging to this Organization will be returned`, Required: false, Deprecated: false, Positional: false, @@ -136,8 +133,8 @@ func vpcPrivateNetworkList() *core.Command { func vpcPrivateNetworkCreate() *core.Command { return &core.Command{ - Short: `Create a private network`, - Long: `Create a private network.`, + Short: `Create a Private Network`, + Long: `Create a new Private Network. Once created, you can attach Scaleway resources in the same Availability Zone.`, Namespace: "vpc", Resource: "private-network", Verb: "create", @@ -146,7 +143,7 @@ func vpcPrivateNetworkCreate() *core.Command { ArgSpecs: core.ArgSpecs{ { Name: "name", - Short: `The name of the private network`, + Short: `Name for the Private Network`, Required: true, Deprecated: false, Positional: false, @@ -155,14 +152,14 @@ func vpcPrivateNetworkCreate() *core.Command { core.ProjectIDArgSpec(), { Name: "tags.{index}", - Short: `The private networks tags`, + Short: `Tags for the Private Network`, Required: false, Deprecated: false, Positional: false, }, { Name: "subnets.{index}", - Short: `Private network subnets CIDR`, + Short: `Private Network subnets CIDR`, Required: false, Deprecated: false, Positional: false, @@ -182,8 +179,8 @@ func vpcPrivateNetworkCreate() *core.Command { func vpcPrivateNetworkGet() *core.Command { return &core.Command{ - Short: `Get a private network`, - Long: `Get a private network.`, + Short: `Get a Private Network`, + Long: `Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object.`, Namespace: "vpc", Resource: "private-network", Verb: "get", @@ -192,7 +189,7 @@ func vpcPrivateNetworkGet() *core.Command { ArgSpecs: core.ArgSpecs{ { Name: "private-network-id", - Short: `The private network id`, + Short: `Private Network ID`, Required: true, Deprecated: false, Positional: true, @@ -212,8 +209,8 @@ func vpcPrivateNetworkGet() *core.Command { func vpcPrivateNetworkUpdate() *core.Command { return &core.Command{ - Short: `Update private network`, - Long: `Update private network.`, + Short: `Update Private Network`, + Long: `Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.`, Namespace: "vpc", Resource: "private-network", Verb: "update", @@ -222,28 +219,28 @@ func vpcPrivateNetworkUpdate() *core.Command { ArgSpecs: core.ArgSpecs{ { Name: "private-network-id", - Short: `The private network ID`, + Short: `Private Network ID`, Required: true, Deprecated: false, Positional: true, }, { Name: "name", - Short: `The name of the private network`, + Short: `Name of the private network`, Required: false, Deprecated: false, Positional: false, }, { Name: "tags.{index}", - Short: `The private networks tags`, + Short: `Tags for the Private Network`, Required: false, Deprecated: false, Positional: false, }, { Name: "subnets.{index}", - Short: `Private network subnets CIDR (deprecated)`, + Short: `Private Network subnets CIDR (deprecated)`, Required: false, Deprecated: true, Positional: false, @@ -263,8 +260,8 @@ func vpcPrivateNetworkUpdate() *core.Command { func vpcPrivateNetworkDelete() *core.Command { return &core.Command{ - Short: `Delete a private network`, - Long: `Delete a private network.`, + Short: `Delete a Private Network`, + Long: `Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it.`, Namespace: "vpc", Resource: "private-network", Verb: "delete", @@ -273,7 +270,7 @@ func vpcPrivateNetworkDelete() *core.Command { ArgSpecs: core.ArgSpecs{ { Name: "private-network-id", - Short: `The private network ID`, + Short: `Private Network ID`, Required: true, Deprecated: false, Positional: true,