From 030ee5984e9b2d3149655175d3bbbb56b3655f3c Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 14 Aug 2020 08:49:24 +0000 Subject: [PATCH 1/2] feat(k8s): add projects --- ...test-all-usage-iot-hub-update-usage.golden | 3 +- ...-all-usage-k8s-cluster-create-usage.golden | 1 + ...st-all-usage-k8s-cluster-list-usage.golden | 1 + .../test-all-usage-lbip-create-usage.golden | 1 + .../test-all-usage-lbip-list-usage.golden | 3 +- .../test-all-usage-lblb-create-usage.golden | 1 + .../test-all-usage-lblb-list-usage.golden | 3 +- ...all-usage-registry-image-list-usage.golden | 1 + ...age-registry-namespace-create-usage.golden | 1 + ...usage-registry-namespace-list-usage.golden | 3 +- internal/namespaces/iot/v1beta1/iot_cli.go | 9 ++- internal/namespaces/k8s/v1/k8s_cli.go | 14 +++- internal/namespaces/lb/v1/lb_cli.go | 26 +++++++ .../v1/testdata/test-create-lb-simple.golden | 73 ++----------------- .../namespaces/registry/v1/registry_cli.go | 23 +++++- 15 files changed, 89 insertions(+), 74 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden b/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden index b54ec9ca3e..3171742b31 100644 --- a/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden @@ -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) diff --git a/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden index e17c1ebadf..5841f50758 100644 --- a/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden @@ -13,6 +13,7 @@ EXAMPLES: scw k8s cluster create name=bar version=1.17.4 tags.0=tag1 tags.1=tag2 cni=cilium pools.0.size=2 pools.0.node-type=RENDER-S pools.0.min-size=1 pools.0.max-size=10 pools.0.autohealing=true pools.0.autoscaling=true pools.0.tags.0=pooltag1 pools.0.tags.1=pooltag2 pools.0.name=default ARGS: + [project-id] The project ID where the cluster will be created name The name of the cluster [description] The description of the cluster [tags.{index}] The tags associated with the cluster diff --git a/cmd/scw/testdata/test-all-usage-k8s-cluster-list-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-cluster-list-usage.golden index cca801512a..b3f5903110 100644 --- a/cmd/scw/testdata/test-all-usage-k8s-cluster-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-k8s-cluster-list-usage.golden @@ -16,6 +16,7 @@ EXAMPLES: scw k8s cluster list region=fr-par name=cluster1 ARGS: + [project-id] The project ID on which to filter the returned clusters [order-by] The sort order of the returned clusters (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | name_asc | name_desc | status_asc | status_desc | version_asc | version_desc) [name] The name on which to filter the returned clusters [status] The status on which to filter the returned clusters (unknown | creating | ready | deleting | deleted | updating | locked | pool_required) diff --git a/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden b/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden index eb6e8d129b..d015072e43 100644 --- a/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden @@ -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) diff --git a/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden b/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden index 741d69a352..99b0a07c77 100644 --- a/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden @@ -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: diff --git a/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden b/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden index 2d248862c6..9e7009ef41 100644 --- a/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden @@ -6,6 +6,7 @@ USAGE: scw lb lb create [arg=value ...] ARGS: + project-id Assign the resource to a project ID name= 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 diff --git a/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden b/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden index 48dca4b0af..ba60e6d8b5 100644 --- a/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden @@ -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: diff --git a/cmd/scw/testdata/test-all-usage-registry-image-list-usage.golden b/cmd/scw/testdata/test-all-usage-registry-image-list-usage.golden index 195dc6eb7b..58fc3fc4db 100644 --- a/cmd/scw/testdata/test-all-usage-registry-image-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-registry-image-list-usage.golden @@ -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) diff --git a/cmd/scw/testdata/test-all-usage-registry-namespace-create-usage.golden b/cmd/scw/testdata/test-all-usage-registry-namespace-create-usage.golden index 561e81702d..90c26969ca 100644 --- a/cmd/scw/testdata/test-all-usage-registry-namespace-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-registry-namespace-create-usage.golden @@ -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) diff --git a/cmd/scw/testdata/test-all-usage-registry-namespace-list-usage.golden b/cmd/scw/testdata/test-all-usage-registry-namespace-list-usage.golden index fa926db05f..5dcfc410fd 100644 --- a/cmd/scw/testdata/test-all-usage-registry-namespace-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-registry-namespace-list-usage.golden @@ -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: diff --git a/internal/namespaces/iot/v1beta1/iot_cli.go b/internal/namespaces/iot/v1beta1/iot_cli.go index 64966cbad0..b498a3b14a 100644 --- a/internal/namespaces/iot/v1beta1/iot_cli.go +++ b/internal/namespaces/iot/v1beta1/iot_cli.go @@ -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, }, diff --git a/internal/namespaces/k8s/v1/k8s_cli.go b/internal/namespaces/k8s/v1/k8s_cli.go index ec4c996026..913c7d5797 100644 --- a/internal/namespaces/k8s/v1/k8s_cli.go +++ b/internal/namespaces/k8s/v1/k8s_cli.go @@ -113,6 +113,12 @@ func k8sClusterList() *core.Command { Verb: "list", ArgsType: reflect.TypeOf(k8s.ListClustersRequest{}), ArgSpecs: core.ArgSpecs{ + { + Name: "project-id", + Short: `The project ID on which to filter the returned clusters`, + Required: false, + Positional: false, + }, { Name: "order-by", Short: `The sort order of the returned clusters`, @@ -184,7 +190,7 @@ func k8sClusterList() *core.Command { FieldName: "Region", }, { - FieldName: "OrganizationID", + FieldName: "ProjectID", }, { FieldName: "Tags", @@ -217,6 +223,12 @@ func k8sClusterCreate() *core.Command { Verb: "create", ArgsType: reflect.TypeOf(k8s.CreateClusterRequest{}), ArgSpecs: core.ArgSpecs{ + { + Name: "project-id", + Short: `The project ID where the cluster will be created`, + Required: false, + Positional: false, + }, { Name: "name", Short: `The name of the cluster`, diff --git a/internal/namespaces/lb/v1/lb_cli.go b/internal/namespaces/lb/v1/lb_cli.go index 0080d80592..c611464e7c 100644 --- a/internal/namespaces/lb/v1/lb_cli.go +++ b/internal/namespaces/lb/v1/lb_cli.go @@ -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, }, @@ -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`, @@ -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, }, @@ -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`, diff --git a/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden b/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden index 2280158220..66b26247bb 100644 --- a/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden +++ b/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden @@ -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": {} } diff --git a/internal/namespaces/registry/v1/registry_cli.go b/internal/namespaces/registry/v1/registry_cli.go index e0cd4c643a..0029fd435e 100644 --- a/internal/namespaces/registry/v1/registry_cli.go +++ b/internal/namespaces/registry/v1/registry_cli.go @@ -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)`, @@ -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, }, @@ -154,6 +160,9 @@ func registryNamespaceList() *core.Command { { FieldName: "OrganizationID", }, + { + FieldName: "ProjectID", + }, { FieldName: "Status", }, @@ -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`, @@ -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`, From 12676db076e45cd6d0b3ca0d0bf4a039370a1773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 24 Aug 2020 14:23:05 +0200 Subject: [PATCH 2/2] Fix --- ...test-all-usage-iot-hub-update-usage.golden | 3 +- .../test-all-usage-lbip-create-usage.golden | 1 - .../test-all-usage-lbip-list-usage.golden | 3 +- .../test-all-usage-lblb-create-usage.golden | 1 - .../test-all-usage-lblb-list-usage.golden | 3 +- internal/namespaces/iot/v1beta1/iot_cli.go | 9 +-- internal/namespaces/lb/v1/lb_cli.go | 26 ------- .../v1/testdata/test-create-lb-simple.golden | 73 +++++++++++++++++-- 8 files changed, 71 insertions(+), 48 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden b/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden index 3171742b31..b54ec9ca3e 100644 --- a/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-iot-hub-update-usage.golden @@ -8,8 +8,7 @@ USAGE: ARGS: hub-id Hub ID [name] Hub name (up to 255 characters) - [product-plan] Hub feature set (plan_unknown | plan_shared | plan_dedicated | plan_ha) - [disable-events] Disable Hub events + [disable-events] Disable 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) diff --git a/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden b/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden index d015072e43..eb6e8d129b 100644 --- a/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lbip-create-usage.golden @@ -6,7 +6,6 @@ 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) diff --git a/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden b/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden index 99b0a07c77..741d69a352 100644 --- a/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lbip-list-usage.golden @@ -7,8 +7,7 @@ USAGE: ARGS: [ip-address] Use this to search by IP address - [project-id] Filter IPs by project ID - [organization-id] Filter IPs by organization id + [organization-id] [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden b/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden index 9e7009ef41..2d248862c6 100644 --- a/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lblb-create-usage.golden @@ -6,7 +6,6 @@ USAGE: scw lb lb create [arg=value ...] ARGS: - project-id Assign the resource to a project ID name= 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 diff --git a/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden b/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden index ba60e6d8b5..48dca4b0af 100644 --- a/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lblb-list-usage.golden @@ -8,8 +8,7 @@ USAGE: ARGS: [name] Use this to search by name [order-by] (created_at_asc | created_at_desc | name_asc | name_desc) - [project-id] Filter LBs by project ID - [organization-id] Filter LBs by organization ID + [organization-id] [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams) FLAGS: diff --git a/internal/namespaces/iot/v1beta1/iot_cli.go b/internal/namespaces/iot/v1beta1/iot_cli.go index b498a3b14a..64966cbad0 100644 --- a/internal/namespaces/iot/v1beta1/iot_cli.go +++ b/internal/namespaces/iot/v1beta1/iot_cli.go @@ -232,16 +232,9 @@ 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 Hub events`, + Short: `Disable events`, Required: false, Positional: false, }, diff --git a/internal/namespaces/lb/v1/lb_cli.go b/internal/namespaces/lb/v1/lb_cli.go index c611464e7c..0080d80592 100644 --- a/internal/namespaces/lb/v1/lb_cli.go +++ b/internal/namespaces/lb/v1/lb_cli.go @@ -158,15 +158,8 @@ 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, }, @@ -196,12 +189,6 @@ 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`, @@ -422,15 +409,8 @@ 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, }, @@ -460,12 +440,6 @@ 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`, diff --git a/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden b/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden index 66b26247bb..2280158220 100644 --- a/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden +++ b/internal/namespaces/lb/v1/testdata/test-create-lb-simple.golden @@ -1,8 +1,69 @@ -🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Missing required argument 'project-id' -πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯ +🎲🎲🎲 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 🟩🟩🟩 { - "message": "missing required argument 'project-id'", - "error": {} + "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" }