Skip to content
Open
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

Versioning follows [SemVer](https://semver.org/). Sections: **Added**, **Changed**, **Deprecated**, **Fixed**, **Removed**, **Known Limitations**, **Dependencies**. Only user-visible changes listed. Older entries may use non-standard section names.

## [v6.10.2] - June 2026

### Added
- **Regional API list from all locations**: List commands for regional APIs (DNS, Kafka, VPN, DBaaS, Monitoring, Logging, CDN, CertManager) now query all locations by default and display a `Location` column. Use `--location` to filter to a specific location. `-o json` merges items from all locations; `-o api-json` returns an array of per-location responses.
- **Multi-location tab completion**: Tab completion for regional resource IDs (e.g. `--cluster-id`, `--gateway-id`) now shows resources from all locations with location hints, when `--location` is not set.

## [v6.10.1] – May 2026

### Added
Expand Down
48 changes: 18 additions & 30 deletions commands/cdn/distribution/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package distribution

import (
"context"
"fmt"

"github.com/ionos-cloud/ionosctl/v6/commands/cdn/completer"
cdn "github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"
"github.com/spf13/viper"

"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2"

"github.com/spf13/viper"
)

func List() *core.Command {
Expand All @@ -25,7 +24,20 @@ func List() *core.Command {
return nil
},
CmdRun: func(c *core.CommandConfig) error {
return listDistributions(c)
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
cdnClient := cdn.NewAPIClient(cfg)
req := cdnClient.DistributionsApi.DistributionsGet(context.Background())

if fn := core.GetFlagName(c.NS, constants.FlagCDNDistributionFilterState); viper.IsSet(fn) {
req = req.FilterState(viper.GetString(fn))
}
if fn := core.GetFlagName(c.NS, constants.FlagCDNDistributionFilterDomain); viper.IsSet(fn) {
req = req.FilterDomain(viper.GetString(fn))
}

ls, _, err := req.Execute()
return ls, err
})
},
InitClient: true,
},
Expand All @@ -36,27 +48,3 @@ func List() *core.Command {

return cmd
}

func listDistributions(c *core.CommandConfig) error {
ls, err := completer.Distributions(
func(req cdn.ApiDistributionsGetRequest) (cdn.ApiDistributionsGetRequest, error) {
if fn := core.GetFlagName(c.NS, constants.FlagCDNDistributionFilterState); viper.IsSet(fn) {
req = req.FilterState(viper.GetString(fn))
}
if fn := core.GetFlagName(c.NS, constants.FlagCDNDistributionFilterDomain); viper.IsSet(fn) {
req = req.FilterDomain(viper.GetString(fn))
}
return req, nil
},
)
if err != nil {
return fmt.Errorf("failed listing cdn distributions: %w", err)
}

items, ok := ls.GetItemsOk()
if !ok || items == nil {
return fmt.Errorf("could not retrieve distributions")
}

return c.Printer(allCols).Print(items)
}
26 changes: 13 additions & 13 deletions commands/cert/autocertificate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package autocertificate

import (
"context"
"fmt"

"github.com/ionos-cloud/ionosctl/v6/internal/client"
cert "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"
"github.com/spf13/viper"

"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/spf13/viper"
)

func AutocertificateListCmd() *core.Command {
Expand All @@ -22,18 +23,17 @@ func AutocertificateListCmd() *core.Command {
return nil
},
CmdRun: func(c *core.CommandConfig) error {
req := client.Must().CertManagerClient.AutoCertificateApi.AutoCertificatesGet(context.Background())

if fn := core.GetFlagName(c.NS, constants.FlagCommonName); viper.IsSet(fn) {
req = req.FilterCommonName(viper.GetString(fn))
}
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
certClient := cert.NewAPIClient(cfg)
req := certClient.AutoCertificateApi.AutoCertificatesGet(context.Background())

ls, _, err := req.Execute()
if err != nil {
return fmt.Errorf("failed listing the AutoCertificates: %w", err)
}
if fn := core.GetFlagName(c.NS, constants.FlagCommonName); viper.IsSet(fn) {
req = req.FilterCommonName(viper.GetString(fn))
}

return c.Printer(allCols).Prefix("items").Print(ls)
ls, _, err := req.Execute()
return ls, err
})
},
InitClient: true,
})
Expand Down
15 changes: 8 additions & 7 deletions commands/cert/certificate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package certificate
import (
"context"

"github.com/ionos-cloud/ionosctl/v6/internal/client"
cert "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"

"github.com/ionos-cloud/ionosctl/v6/internal/core"
)

Expand All @@ -27,10 +29,9 @@ func CertListCmd() *core.Command {
func CmdList(c *core.CommandConfig) error {
c.Verbose("Getting Certificates...")

certs, _, err := client.Must().CertManagerClient.CertificateApi.CertificatesGet(context.Background()).Execute()
if err != nil {
return err
}

return c.Printer(allCols).Prefix("items").Print(certs)
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
certClient := cert.NewAPIClient(cfg)
ls, _, err := certClient.CertificateApi.CertificatesGet(context.Background()).Execute()
return ls, err
})
}
18 changes: 8 additions & 10 deletions commands/cert/provider/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package provider

import (
"context"
"fmt"

"github.com/ionos-cloud/ionosctl/v6/internal/client"
cert "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"

"github.com/ionos-cloud/ionosctl/v6/internal/core"
)

Expand All @@ -20,14 +21,11 @@ func ProviderListCmd() *core.Command {
return nil
},
CmdRun: func(c *core.CommandConfig) error {
req := client.Must().CertManagerClient.ProviderApi.ProvidersGet(context.Background())

ls, _, err := req.Execute()
if err != nil {
return fmt.Errorf("failed listing the Providers: %w", err)
}

return c.Printer(allCols).Prefix("items").Print(ls)
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
certClient := cert.NewAPIClient(cfg)
ls, _, err := certClient.ProviderApi.ProvidersGet(context.Background()).Execute()
return ls, err
})
},
InitClient: true,
})
Expand Down
15 changes: 7 additions & 8 deletions commands/dbaas/inmemorydb/replicaset/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"

"github.com/ionos-cloud/ionosctl/v6/commands/dbaas/inmemorydb/utils"
"github.com/ionos-cloud/ionosctl/v6/internal/client"
"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/ionos-cloud/sdk-go-bundle/products/dbaas/inmemorydb/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)

func List() *core.Command {
Expand All @@ -23,13 +23,12 @@ func List() *core.Command {
return nil
},
CmdRun: func(c *core.CommandConfig) error {
ls, _, err := client.Must().InMemoryDBClient.ReplicaSetApi.
ReplicasetsGet(context.Background()).Execute()
if err != nil {
return err
}

return c.Printer(allCols).Prefix("items").Print(ls)
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
apiClient := inmemorydb.NewAPIClient(cfg)
ls, _, err := apiClient.ReplicaSetApi.
ReplicasetsGet(context.Background()).Execute()
return ls, err
})
},
InitClient: true,
})
Expand Down
16 changes: 8 additions & 8 deletions commands/dbaas/inmemorydb/snapshot/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package snapshot
import (
"context"

"github.com/ionos-cloud/ionosctl/v6/internal/client"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/ionos-cloud/sdk-go-bundle/products/dbaas/inmemorydb/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)

func List() *core.Command {
Expand All @@ -20,13 +21,12 @@ func List() *core.Command {
return nil
},
CmdRun: func(c *core.CommandConfig) error {
ls, _, err := client.Must().InMemoryDBClient.SnapshotApi.
SnapshotsGet(context.Background()).Execute()
if err != nil {
return err
}

return c.Printer(allCols).Prefix("items").Print(ls)
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
apiClient := inmemorydb.NewAPIClient(cfg)
ls, _, err := apiClient.SnapshotApi.
SnapshotsGet(context.Background()).Execute()
return ls, err
})
},
InitClient: true,
})
Expand Down
18 changes: 13 additions & 5 deletions commands/dbaas/mariadb/cluster/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (

"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"
"github.com/spf13/viper"
)

func List() *core.Command {
Expand All @@ -20,12 +23,17 @@ func List() *core.Command {
CmdRun: func(c *core.CommandConfig) error {
c.Verbose("Getting Clusters...")

clusters, err := Clusters(FilterNameFlags(c))
if err != nil {
return err
}
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
apiClient := mariadb.NewAPIClient(cfg)
req := apiClient.ClustersApi.ClustersGet(context.Background())

return c.Printer(allCols).Prefix("items").Print(clusters)
if fn := core.GetFlagName(c.NS, constants.FlagName); viper.IsSet(fn) {
req = req.FilterName(viper.GetString(fn))
}

clusters, _, err := req.Execute()
return clusters, err
})
},
InitClient: true,
})
Expand Down
46 changes: 21 additions & 25 deletions commands/dbaas/postgres-v2/cluster/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package cluster
import (
"context"

"github.com/ionos-cloud/ionosctl/v6/internal/client"
"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/table"
psqlv2 "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql/v3"
"github.com/ionos-cloud/sdk-go-bundle/shared"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -37,27 +36,24 @@ func ClusterListCmd() *core.Command {
}

func RunClusterList(c *core.CommandConfig) error {
req := client.Must().PostgresClientV2.ClustersApi.ClustersGet(context.Background())

if fn := core.GetFlagName(c.NS, constants.FlagName); viper.IsSet(fn) {
req = req.FilterName(viper.GetString(fn))
}
if fn := core.GetFlagName(c.NS, constants.FlagState); viper.IsSet(fn) {
req = req.FilterState(psqlv2.PostgresClusterStates(viper.GetString(fn)))
}
if fn := core.GetFlagName(c.NS, constants.FlagLimit); viper.IsSet(fn) {
req = req.Limit(viper.GetInt32(fn))
}
if fn := core.GetFlagName(c.NS, constants.FlagOffset); viper.IsSet(fn) {
req = req.Offset(viper.GetInt32(fn))
}

clusters, _, err := req.Execute()
if err != nil {
return err
}

cols, _ := c.Command.Command.Flags().GetStringSlice(constants.ArgCols)

return c.Out(table.Sprint(clusterCols, clusters, cols, table.WithPrefix("items")))
return c.ListAllLocations(clusterCols, func(cfg *shared.Configuration) (any, error) {
apiClient := psqlv2.NewAPIClient(cfg)
req := apiClient.ClustersApi.ClustersGet(context.Background())

if fn := core.GetFlagName(c.NS, constants.FlagName); viper.IsSet(fn) {
req = req.FilterName(viper.GetString(fn))
}
if fn := core.GetFlagName(c.NS, constants.FlagState); viper.IsSet(fn) {
req = req.FilterState(psqlv2.PostgresClusterStates(viper.GetString(fn)))
}
if fn := core.GetFlagName(c.NS, constants.FlagLimit); viper.IsSet(fn) {
req = req.Limit(viper.GetInt32(fn))
}
if fn := core.GetFlagName(c.NS, constants.FlagOffset); viper.IsSet(fn) {
req = req.Offset(viper.GetInt32(fn))
}

clusters, _, err := req.Execute()
return clusters, err
})
}
23 changes: 12 additions & 11 deletions commands/dns/reverse-record/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package reverse_record

import (
"context"
"fmt"

"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
"github.com/ionos-cloud/sdk-go-bundle/products/dns/v2"
dns "github.com/ionos-cloud/sdk-go-bundle/products/dns/v2"
"github.com/ionos-cloud/sdk-go-bundle/shared"
"github.com/spf13/viper"
)

func List() *core.Command {
Expand All @@ -18,17 +19,17 @@ func List() *core.Command {
ShortDesc: "Retrieve all reverse records",
Example: "ionosctl dns rr list",
CmdRun: func(c *core.CommandConfig) error {
ls, err := Records(FilterRecordsByIp(c.NS))
if err != nil {
return fmt.Errorf("failed listing records: %w", err)
}
return c.ListAllLocations(allCols, func(cfg *shared.Configuration) (any, error) {
dnsClient := dns.NewAPIClient(cfg)
req := dnsClient.ReverseRecordsApi.ReverserecordsGet(context.Background())

items, ok := ls.GetItemsOk()
if !ok || items == nil {
return fmt.Errorf("could not retrieve Record items")
}
if fn := core.GetFlagName(c.NS, constants.FlagIps); viper.IsSet(fn) {
req = req.FilterRecordIp(viper.GetStringSlice(fn))
}

return c.Printer(allCols).Prefix("items").Print(ls)
ls, _, err := req.Execute()
return ls, err
})
},
InitClient: true,
})
Expand Down
Loading
Loading