Skip to content

Commit

Permalink
feat: update generated cli
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed Aug 13, 2020
1 parent f9b4547 commit 8834767
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 73 deletions.
3 changes: 2 additions & 1 deletion cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ USAGE:
ARGS:
hub-id Hub ID
[name] Hub name (up to 255 characters)
[disable-events] Disable events
[product-plan] Hub feature set (plan_unknown | plan_shared | plan_dedicated | plan_ha)
[disable-events] Disable Hub events
[events-topic-prefix] Hub events topic prefix
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

Expand Down
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-lbip-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ USAGE:
scw lb ip create [arg=value ...]

ARGS:
project-id Assign the resource to a project ID
[reverse] Reverse domain name
[organization-id] Organization ID to use. If none is passed will use default organization ID from the config
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
Expand Down
3 changes: 2 additions & 1 deletion cmd/scw/testdata/test-all-usage-lbip-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ USAGE:

ARGS:
[ip-address] Use this to search by IP address
[organization-id]
[project-id] Filter IPs by project ID
[organization-id] Filter IPs by organization id
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
Expand Down
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-lblb-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ USAGE:
scw lb lb create [arg=value ...]

ARGS:
project-id Assign the resource to a project ID
name=<generated> Resource names
[description] Resource description
[ip-id] Just like for compute instances, when you destroy a load balancer, you can keep its highly available IP address and reuse it for another load balancer later
Expand Down
3 changes: 2 additions & 1 deletion cmd/scw/testdata/test-all-usage-lblb-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ USAGE:
ARGS:
[name] Use this to search by name
[order-by] (created_at_asc | created_at_desc | name_asc | name_desc)
[organization-id]
[project-id] Filter LBs by project ID
[organization-id] Filter LBs by organization ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARGS:
[order-by] Field by which to order the display of Images (created_at_asc | created_at_desc | name_asc | name_desc)
[namespace-id] Filter by the Namespace ID
[name] Filter by the Image name (exact match)
[project-id] Filter by Project ID
[organization-id] Filter by Organization ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ USAGE:
ARGS:
name Define a namespace name
[description] Define a description
[project-id] Assign the namespace to a project ID
[is-public] Define the default visibility policy
[organization-id] Organization ID to use. If none is passed will use default organization ID from the config
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ USAGE:

ARGS:
[order-by] Field by which to order the display of Images (created_at_asc | created_at_desc | description_asc | description_desc | name_asc | name_desc)
[project-id] Filter by Project ID
[name] Filter by the namespace name (exact match)
[organization-id] Filter by the namespace owner
[organization-id] Filter by Organization ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
Expand Down
9 changes: 8 additions & 1 deletion internal/namespaces/iot/v1beta1/iot_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,16 @@ func iotHubUpdate() *core.Command {
Required: false,
Positional: false,
},
{
Name: "product-plan",
Short: `Hub feature set`,
Required: false,
Positional: false,
EnumValues: []string{"plan_unknown", "plan_shared", "plan_dedicated", "plan_ha"},
},
{
Name: "disable-events",
Short: `Disable events`,
Short: `Disable Hub events`,
Required: false,
Positional: false,
},
Expand Down
26 changes: 26 additions & 0 deletions internal/namespaces/lb/v1/lb_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,15 @@ func lbLBList() *core.Command {
Positional: false,
EnumValues: []string{"created_at_asc", "created_at_desc", "name_asc", "name_desc"},
},
{
Name: "project-id",
Short: `Filter LBs by project ID`,
Required: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Filter LBs by organization ID`,
Required: false,
Positional: false,
},
Expand Down Expand Up @@ -189,6 +196,12 @@ func lbLBCreate() *core.Command {
Verb: "create",
ArgsType: reflect.TypeOf(lb.CreateLBRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "project-id",
Short: `Assign the resource to a project ID`,
Required: true,
Positional: false,
},
{
Name: "name",
Short: `Resource names`,
Expand Down Expand Up @@ -409,8 +422,15 @@ func lbIPList() *core.Command {
Required: false,
Positional: false,
},
{
Name: "project-id",
Short: `Filter IPs by project ID`,
Required: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Filter IPs by organization id`,
Required: false,
Positional: false,
},
Expand Down Expand Up @@ -440,6 +460,12 @@ func lbIPCreate() *core.Command {
Verb: "create",
ArgsType: reflect.TypeOf(lb.CreateIPRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "project-id",
Short: `Assign the resource to a project ID`,
Required: true,
Positional: false,
},
{
Name: "reverse",
Short: `Reverse domain name`,
Expand Down
73 changes: 6 additions & 67 deletions internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden
Original file line number Diff line number Diff line change
@@ -1,69 +1,8 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
ID df47ea4e-7585-42ce-bcbf-3b5f704f1ef4
Name foobar
Description foobar
Status ready
Instances.0.ID 9d2d8441-8172-45e8-9d77-35f6432424c8
Instances.0.Status ready
Instances.0.IPAddress 10.68.206.111
Instances.0.Region fr-par
Instances.1.ID e821e381-295d-4f45-8986-0f03953cd737
Instances.1.Status ready
Instances.1.IPAddress 10.70.38.9
Instances.1.Region fr-par
OrganizationID 951df375-e094-4d26-97c1-ba548eeb9c42
IP.0.ID 733a3c45-f975-42ef-b4ca-28419312f932
IP.0.IPAddress 195.154.68.106
IP.0.OrganizationID 951df375-e094-4d26-97c1-ba548eeb9c42
IP.0.LBID df47ea4e-7585-42ce-bcbf-3b5f704f1ef4
IP.0.Reverse 195-154-68-106.lb.fr-par.scw.cloud
IP.0.ProjectID 951df375-e094-4d26-97c1-ba548eeb9c42
IP.0.Region fr-par
FrontendCount 0
BackendCount 0
Type lb-s
SslCompatibilityLevel ssl_compatibility_level_intermediate
ProjectID 951df375-e094-4d26-97c1-ba548eeb9c42
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Missing required argument 'project-id'
🟥🟥🟥 JSON STDERR 🟥🟥🟥
{
"id": "df47ea4e-7585-42ce-bcbf-3b5f704f1ef4",
"name": "foobar",
"description": "foobar",
"status": "ready",
"instances": [
{
"id": "9d2d8441-8172-45e8-9d77-35f6432424c8",
"status": "ready",
"ip_address": "10.68.206.111",
"region": "fr-par"
},
{
"id": "e821e381-295d-4f45-8986-0f03953cd737",
"status": "ready",
"ip_address": "10.70.38.9",
"region": "fr-par"
}
],
"organization_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
"ip": [
{
"id": "733a3c45-f975-42ef-b4ca-28419312f932",
"ip_address": "195.154.68.106",
"organization_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
"lb_id": "df47ea4e-7585-42ce-bcbf-3b5f704f1ef4",
"reverse": "195-154-68-106.lb.fr-par.scw.cloud",
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
"region": "fr-par"
}
],
"tags": [],
"frontend_count": 0,
"backend_count": 0,
"type": "lb-s",
"subscriber": null,
"ssl_compatibility_level": "ssl_compatibility_level_intermediate",
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
"region": "fr-par"
"message": "missing required argument 'project-id'",
"error": {}
}
23 changes: 22 additions & 1 deletion internal/namespaces/registry/v1/registry_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ func registryNamespaceList() *core.Command {
Positional: false,
EnumValues: []string{"created_at_asc", "created_at_desc", "description_asc", "description_desc", "name_asc", "name_desc"},
},
{
Name: "project-id",
Short: `Filter by Project ID`,
Required: false,
Positional: false,
},
{
Name: "name",
Short: `Filter by the namespace name (exact match)`,
Expand All @@ -111,7 +117,7 @@ func registryNamespaceList() *core.Command {
},
{
Name: "organization-id",
Short: `Filter by the namespace owner`,
Short: `Filter by Organization ID`,
Required: false,
Positional: false,
},
Expand Down Expand Up @@ -154,6 +160,9 @@ func registryNamespaceList() *core.Command {
{
FieldName: "OrganizationID",
},
{
FieldName: "ProjectID",
},
{
FieldName: "Status",
},
Expand Down Expand Up @@ -222,6 +231,12 @@ func registryNamespaceCreate() *core.Command {
Required: false,
Positional: false,
},
{
Name: "project-id",
Short: `Assign the namespace to a project ID`,
Required: false,
Positional: false,
},
{
Name: "is-public",
Short: `Define the default visibility policy`,
Expand Down Expand Up @@ -338,6 +353,12 @@ func registryImageList() *core.Command {
Required: false,
Positional: false,
},
{
Name: "project-id",
Short: `Filter by Project ID`,
Required: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Filter by Organization ID`,
Expand Down

0 comments on commit 8834767

Please sign in to comment.