Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.

USAGE:
scw product-catalog product list [arg=value ...]

ARGS:
[product-types.{index}] The list of filtered product categories. (unknown_product_type | instance | apple_silicon | elastic_metal | dedibox | block_storage | object_storage | managed_inference | generative_apis | load_balancer | secret_manager | key_manager | managed_redis_database | kubernetes | managed_relational_database | managed_mongodb)
[global] Filter global products.
[region] Filter products by region.
[zone] Filter products by zone.
[datacenter] Filter products by datacenter.
[status.{index}] The lists of filtered product status, if empty only products with status public_beta, general_availability, preview, end_of_new_features, end_of_growth, end_of_deployment, end_of_support, end_of_sale, end_of_life or retired will be returned. (unknown_status | public_beta | preview | general_availability | end_of_new_features | end_of_growth | end_of_deployment | end_of_support | end_of_sale | end_of_life | retired)

FLAGS:
-h, --help help for list
--list-sub-commands List all subcommands

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Scaleway's Product Catalog is an extensive list of the Scaleway products.
The catalog includes details about each product including: description,
locations, prices and properties.

USAGE:
scw product-catalog product <command>

AVAILABLE COMMANDS:
list List all available products

FLAGS:
-h, --help help for product
--list-sub-commands List all subcommands

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw product-catalog product [command] --help" for more information about a command.
21 changes: 21 additions & 0 deletions cmd/scw/testdata/test-all-usage-product-catalog-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Product Catalog API

USAGE:
scw product-catalog <command>

AVAILABLE COMMANDS:
product Scaleway Product Catalog API

FLAGS:
-h, --help help for product-catalog
--list-sub-commands List all subcommands

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw product-catalog [command] --help" for more information about a command.
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-main-usage-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AVAILABLE COMMANDS:
datalab Data Lab API for Apache Spark™
domain Domains and DNS - Registrar API
environmental-footprint Access and download impact reports and impact data for your Scaleway projects. Our API provides key metrics such as estimated carbon emissions and water usage to help monitor your environmental footprint.
product-catalog Product Catalog API

BAREMETAL COMMANDS:
apple-silicon Apple silicon API
Expand Down
2 changes: 2 additions & 0 deletions commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
mongodb "github.com/scaleway/scaleway-cli/v2/internal/namespaces/mongodb/v1alpha1"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/object/v1"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/partner/v1"
product_catalog "github.com/scaleway/scaleway-cli/v2/internal/namespaces/product_catalog/v2alpha1"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/redis/v1"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/registry/v1"
Expand Down Expand Up @@ -122,6 +123,7 @@ func GetCommands() *core.Commands {
datawarehouse.GetCommands(),
partner.GetCommands(),
environmental_footprint.GetCommands(),
product_catalog.GetCommands(),
)

if beta {
Expand Down
39 changes: 39 additions & 0 deletions docs/commands/product-catalog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
# Documentation for `scw product-catalog`
Product Catalog API

- [Scaleway Product Catalog API](#scaleway-product-catalog-api)
- [List all available products](#list-all-available-products)


## Scaleway Product Catalog API

Scaleway's Product Catalog is an extensive list of the Scaleway products.
The catalog includes details about each product including: description,
locations, prices and properties.


### List all available products

List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.

**Usage:**

```
scw product-catalog product list [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| product-types.{index} | One of: `unknown_product_type`, `instance`, `apple_silicon`, `elastic_metal`, `dedibox`, `block_storage`, `object_storage`, `managed_inference`, `generative_apis`, `load_balancer`, `secret_manager`, `key_manager`, `managed_redis_database`, `kubernetes`, `managed_relational_database`, `managed_mongodb` | The list of filtered product categories. |
| global | | Filter global products. |
| region | | Filter products by region. |
| zone | | Filter products by zone. |
| datacenter | | Filter products by datacenter. |
| status.{index} | One of: `unknown_status`, `public_beta`, `preview`, `general_availability`, `end_of_new_features`, `end_of_growth`, `end_of_deployment`, `end_of_support`, `end_of_sale`, `end_of_life`, `retired` | The lists of filtered product status, if empty only products with status public_beta, general_availability, preview, end_of_new_features, end_of_growth, end_of_deployment, end_of_support, end_of_sale, end_of_life or retired will be returned. |



9 changes: 9 additions & 0 deletions internal/namespaces/product_catalog/v2alpha1/custom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package product_catalog

import "github.com/scaleway/scaleway-cli/v2/core"

func GetCommands() *core.Commands {
cmds := GetGeneratedCommands()

return cmds
}
147 changes: 147 additions & 0 deletions internal/namespaces/product_catalog/v2alpha1/product_catalog_cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.

package product_catalog

import (
"context"
"reflect"

"github.com/scaleway/scaleway-cli/v2/core"
product_catalog "github.com/scaleway/scaleway-sdk-go/api/product_catalog/v2alpha1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

// always import dependencies
var (
_ = scw.RegionFrPar
)

func GetGeneratedCommands() *core.Commands {
return core.NewCommands(
productCatalogRoot(),
productCatalogProduct(),
productCatalogProductList(),
)
}

func productCatalogRoot() *core.Command {
return &core.Command{
Short: `Product Catalog API`,
Long: ``,
Namespace: "product-catalog",
}
}

func productCatalogProduct() *core.Command {
return &core.Command{
Short: `Scaleway Product Catalog API`,
Long: `Scaleway's Product Catalog is an extensive list of the Scaleway products.
The catalog includes details about each product including: description,
locations, prices and properties.`,
Namespace: "product-catalog",
Resource: "product",
}
}

func productCatalogProductList() *core.Command {
return &core.Command{
Short: `List all available products`,
Long: `List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the ` + "`" + `page` + "`" + ` number and ` + "`" + `page_size` + "`" + ` for your query in the request.`,
Namespace: "product-catalog",
Resource: "product",
Verb: "list",
// Deprecated: false,
ArgsType: reflect.TypeOf(
product_catalog.PublicCatalogAPIListPublicCatalogProductsRequest{},
),
ArgSpecs: core.ArgSpecs{
{
Name: "product-types.{index}",
Short: `The list of filtered product categories.`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{
"unknown_product_type",
"instance",
"apple_silicon",
"elastic_metal",
"dedibox",
"block_storage",
"object_storage",
"managed_inference",
"generative_apis",
"load_balancer",
"secret_manager",
"key_manager",
"managed_redis_database",
"kubernetes",
"managed_relational_database",
"managed_mongodb",
},
},
{
Name: "global",
Short: `Filter global products.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "region",
Short: `Filter products by region.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "zone",
Short: `Filter products by zone.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "datacenter",
Short: `Filter products by datacenter.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "status.{index}",
Short: `The lists of filtered product status, if empty only products with status public_beta, general_availability, preview, end_of_new_features, end_of_growth, end_of_deployment, end_of_support, end_of_sale, end_of_life or retired will be returned.`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{
"unknown_status",
"public_beta",
"preview",
"general_availability",
"end_of_new_features",
"end_of_growth",
"end_of_deployment",
"end_of_support",
"end_of_sale",
"end_of_life",
"retired",
},
},
},
Run: func(ctx context.Context, args any) (i any, e error) {
request := args.(*product_catalog.PublicCatalogAPIListPublicCatalogProductsRequest)

client := core.ExtractClient(ctx)
api := product_catalog.NewPublicCatalogAPI(client)
opts := []scw.RequestOption{scw.WithAllPages()}
resp, err := api.ListPublicCatalogProducts(request, opts...)
if err != nil {
return nil, err
}

return resp.Products, nil
},
}
}
Loading