From ca09e09aa216b10eb6a0613444d429040cbc1131 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Mon, 4 Nov 2024 17:28:19 +0000 Subject: [PATCH] feat: update generated APIs --- ...ge-cockpit-data-source-create-usage.golden | 9 +++-- ...sage-cockpit-data-source-list-usage.golden | 2 +- ...ge-cockpit-data-source-update-usage.golden | 7 ++-- ...st-all-usage-cockpit-plan-get-usage.golden | 1 + ...t-all-usage-cockpit-plan-list-usage.golden | 1 + ...all-usage-cockpit-plan-select-usage.golden | 1 + docs/commands/cockpit.md | 9 ++++- go.mod | 2 +- go.sum | 4 +- internal/namespaces/cockpit/v1/cockpit_cli.go | 39 +++++++++++++------ .../testdata/test-create-simple.golden | 1 + 11 files changed, 52 insertions(+), 24 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-cockpit-data-source-create-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-data-source-create-usage.golden index 7e3b496cf7..158494b0f4 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-data-source-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-data-source-create-usage.golden @@ -10,10 +10,11 @@ USAGE: scw cockpit data-source create [arg=value ...] ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used - [name] Data source name - [type] Data source type (unknown_type | metrics | logs | traces | alerts) - [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) + [project-id] Project ID to use. If none is passed the default project ID will be used + [name] Data source name + [type] Data source type (unknown_type | metrics | logs | traces) + [retention-days] BETA - Duration for which the data will be retained in the data source + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-cockpit-data-source-list-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-data-source-list-usage.golden index 9eaba9f547..702bf5fa89 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-data-source-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-data-source-list-usage.golden @@ -10,7 +10,7 @@ ARGS: [order-by] Sort order for data sources in the response (created_at_asc | created_at_desc | name_asc | name_desc | type_asc | type_desc) [project-id] Project ID to use. If none is passed the default project ID will be used [origin] Origin to filter for, only data sources with matching origin will be returned (unknown_origin | scaleway | external) - [types.{index}] Types to filter for, only data sources with matching types will be returned (unknown_type | metrics | logs | traces | alerts) + [types.{index}] Types to filter for, only data sources with matching types will be returned (unknown_type | metrics | logs | traces) [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-cockpit-data-source-update-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-data-source-update-usage.golden index 13fdd2c718..2996d60e03 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-data-source-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-data-source-update-usage.golden @@ -6,9 +6,10 @@ USAGE: scw cockpit data-source update [arg=value ...] ARGS: - data-source-id ID of the data source to update - [name] Updated name of the data source - [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) + data-source-id ID of the data source to update + [name] Updated name of the data source + [retention-days] BETA - Duration for which the data will be retained in the data source + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-cockpit-plan-get-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-plan-get-usage.golden index 168767fab3..27e932d688 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-plan-get-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-plan-get-usage.golden @@ -1,6 +1,7 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ Retrieve a pricing plan for the given Project, specified by the ID of the Project. +Deprecated, retention is now managed at the data source level. USAGE: scw cockpit plan get [arg=value ...] diff --git a/cmd/scw/testdata/test-all-usage-cockpit-plan-list-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-plan-list-usage.golden index 486416e387..4181e0d680 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-plan-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-plan-list-usage.golden @@ -1,6 +1,7 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ Retrieve a list of available pricing plan types. +Deprecated, retention is now managed at the data source level. USAGE: scw cockpit plan list [arg=value ...] diff --git a/cmd/scw/testdata/test-all-usage-cockpit-plan-select-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-plan-select-usage.golden index 740d12af70..c2b037efdc 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-plan-select-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-plan-select-usage.golden @@ -1,6 +1,7 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply. +Deprecated, retention is now managed at the data source level. USAGE: scw cockpit plan select [arg=value ...] diff --git a/docs/commands/cockpit.md b/docs/commands/cockpit.md index 6d6f5418d2..cfdb031b85 100644 --- a/docs/commands/cockpit.md +++ b/docs/commands/cockpit.md @@ -206,7 +206,8 @@ scw cockpit data-source create [arg=value ...] |------|---|-------------| | project-id | | Project ID to use. If none is passed the default project ID will be used | | name | | Data source name | -| type | One of: `unknown_type`, `metrics`, `logs`, `traces`, `alerts` | Data source type | +| type | One of: `unknown_type`, `metrics`, `logs`, `traces` | Data source type | +| retention-days | | BETA - Duration for which the data will be retained in the data source | | region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | @@ -270,7 +271,7 @@ scw cockpit data-source list [arg=value ...] | order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `type_asc`, `type_desc` | Sort order for data sources in the response | | project-id | | Project ID to use. If none is passed the default project ID will be used | | origin | One of: `unknown_origin`, `scaleway`, `external` | Origin to filter for, only data sources with matching origin will be returned | -| types.{index} | One of: `unknown_type`, `metrics`, `logs`, `traces`, `alerts` | Types to filter for, only data sources with matching types will be returned | +| types.{index} | One of: `unknown_type`, `metrics`, `logs`, `traces` | Types to filter for, only data sources with matching types will be returned | | region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | @@ -292,6 +293,7 @@ scw cockpit data-source update [arg=value ...] |------|---|-------------| | data-source-id | Required | ID of the data source to update | | name | | Updated name of the data source | +| retention-days | | BETA - Duration for which the data will be retained in the data source | | region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | @@ -481,6 +483,7 @@ Pricing plans management commands. ### Get current plan Retrieve a pricing plan for the given Project, specified by the ID of the Project. +Deprecated, retention is now managed at the data source level. **Usage:** @@ -500,6 +503,7 @@ scw cockpit plan get [arg=value ...] ### List plan types Retrieve a list of available pricing plan types. +Deprecated, retention is now managed at the data source level. **Usage:** @@ -519,6 +523,7 @@ scw cockpit plan list [arg=value ...] ### Apply a pricing plan Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply. +Deprecated, retention is now managed at the data source level. **Usage:** diff --git a/go.mod b/go.mod index 496b10d708..e36fc7f444 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/mattn/go-isatty v0.0.20 github.com/moby/buildkit v0.13.2 github.com/opencontainers/go-digest v1.0.0 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241029155651-7d2e04989bb6 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241031163826-ea7169024163 github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index ab6cbcfbed..f37d175289 100644 --- a/go.sum +++ b/go.sum @@ -465,8 +465,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241029155651-7d2e04989bb6 h1:wTLtvVjR/V+Rz34qp0JDMTkkPUZPY0NkiywtdqwGcPs= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241029155651-7d2e04989bb6/go.mod h1:3jrRJM7638J+P33hKy9MBvfOBxNo8pEGNQQoIv65Ihg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241031163826-ea7169024163 h1:yO+2+sW3nnl8VIAvBXo0NJgUQRJpJkuG4MsMGoAGmW8= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241031163826-ea7169024163/go.mod h1:3jrRJM7638J+P33hKy9MBvfOBxNo8pEGNQQoIv65Ihg= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= diff --git a/internal/namespaces/cockpit/v1/cockpit_cli.go b/internal/namespaces/cockpit/v1/cockpit_cli.go index e5ce333a0d..fb44d7c75f 100644 --- a/internal/namespaces/cockpit/v1/cockpit_cli.go +++ b/internal/namespaces/cockpit/v1/cockpit_cli.go @@ -432,12 +432,13 @@ func cockpitProductDashboardsGet() *core.Command { func cockpitPlanList() *core.Command { return &core.Command{ - Short: `List plan types`, - Long: `Retrieve a list of available pricing plan types.`, + Short: `List plan types`, + Long: `Retrieve a list of available pricing plan types. +Deprecated, retention is now managed at the data source level.`, Namespace: "cockpit", Resource: "plan", Verb: "list", - // Deprecated: false, + // Deprecated: true, ArgsType: reflect.TypeOf(cockpit.GlobalAPIListPlansRequest{}), ArgSpecs: core.ArgSpecs{ { @@ -466,12 +467,13 @@ func cockpitPlanList() *core.Command { func cockpitPlanSelect() *core.Command { return &core.Command{ - Short: `Apply a pricing plan`, - Long: `Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.`, + Short: `Apply a pricing plan`, + Long: `Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply. +Deprecated, retention is now managed at the data source level.`, Namespace: "cockpit", Resource: "plan", Verb: "select", - // Deprecated: false, + // Deprecated: true, ArgsType: reflect.TypeOf(cockpit.GlobalAPISelectPlanRequest{}), ArgSpecs: core.ArgSpecs{ core.ProjectIDArgSpec(), @@ -497,12 +499,13 @@ func cockpitPlanSelect() *core.Command { func cockpitPlanGet() *core.Command { return &core.Command{ - Short: `Get current plan`, - Long: `Retrieve a pricing plan for the given Project, specified by the ID of the Project.`, + Short: `Get current plan`, + Long: `Retrieve a pricing plan for the given Project, specified by the ID of the Project. +Deprecated, retention is now managed at the data source level.`, Namespace: "cockpit", Resource: "plan", Verb: "get", - // Deprecated: false, + // Deprecated: true, ArgsType: reflect.TypeOf(cockpit.GlobalAPIGetCurrentPlanRequest{}), ArgSpecs: core.ArgSpecs{ core.ProjectIDArgSpec(), @@ -546,7 +549,14 @@ The name of the data source will then be used as reference to name the associate Required: false, Deprecated: false, Positional: false, - EnumValues: []string{"unknown_type", "metrics", "logs", "traces", "alerts"}, + EnumValues: []string{"unknown_type", "metrics", "logs", "traces"}, + }, + { + Name: "retention-days", + Short: `BETA - Duration for which the data will be retained in the data source`, + Required: false, + Deprecated: false, + Positional: false, }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), }, @@ -661,7 +671,7 @@ You can list data sources by Project, type and origin.`, Required: false, Deprecated: false, Positional: false, - EnumValues: []string{"unknown_type", "metrics", "logs", "traces", "alerts"}, + EnumValues: []string{"unknown_type", "metrics", "logs", "traces"}, }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)), }, @@ -709,6 +719,13 @@ func cockpitDataSourceUpdate() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "retention-days", + Short: `BETA - Duration for which the data will be retained in the data source`, + Required: false, + Deprecated: false, + Positional: false, + }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { diff --git a/internal/namespaces/container/v1beta1/testdata/test-create-simple.golden b/internal/namespaces/container/v1beta1/testdata/test-create-simple.golden index 9a766d2f3a..456b401974 100644 --- a/internal/namespaces/container/v1beta1/testdata/test-create-simple.golden +++ b/internal/namespaces/container/v1beta1/testdata/test-create-simple.golden @@ -45,6 +45,7 @@ Region fr-par "sandbox": "unknown_sandbox", "local_storage_limit": 0, "scaling_option": null, + "health_check": null, "created_at": null, "updated_at": null, "ready_at": null,