feat: paginate hcloud requests

This commit is contained in:
Jan Henkel 2024-01-17 20:19:21 +01:00
parent 0a0204f07f
commit 04826e589a
9 changed files with 9 additions and 9 deletions

View file

@ -16,7 +16,7 @@ type floatingIP struct {
}
func (floatingIP floatingIP) Run(client *hcloud.Client) error {
floatingIPs, _, err := client.FloatingIP.List(ctx, hcloud.FloatingIPListOpts{})
floatingIPs, err := client.FloatingIP.All(ctx)
if err != nil {
return err
}

View file

@ -18,7 +18,7 @@ type loadBalancer struct {
}
func (loadBalancer loadBalancer) Run(client *hcloud.Client) error {
loadBalancers, _, err := client.LoadBalancer.List(ctx, hcloud.LoadBalancerListOpts{})
loadBalancers, err := client.LoadBalancer.All(ctx)
if err != nil {
return err
}

View file

@ -18,7 +18,7 @@ type loadbalancerTraffic struct {
}
func (loadbalancerTraffic loadbalancerTraffic) Run(client *hcloud.Client) error {
loadBalancers, _, err := client.LoadBalancer.List(ctx, hcloud.LoadBalancerListOpts{})
loadBalancers, err := client.LoadBalancer.All(ctx)
if err != nil {
return err
}

View file

@ -16,7 +16,7 @@ type primaryIP struct {
}
func (primaryIP primaryIP) Run(client *hcloud.Client) error {
primaryIPs, _, err := client.PrimaryIP.List(ctx, hcloud.PrimaryIPListOpts{})
primaryIPs, err := client.PrimaryIP.All(ctx)
if err != nil {
return err
}

View file

@ -18,7 +18,7 @@ type server struct {
}
func (server server) Run(client *hcloud.Client) error {
servers, _, err := client.Server.List(ctx, hcloud.ServerListOpts{})
servers, err := client.Server.All(ctx)
if err != nil {
return err
}

View file

@ -18,7 +18,7 @@ type serverBackup struct {
}
func (serverBackup serverBackup) Run(client *hcloud.Client) error {
servers, _, err := client.Server.List(ctx, hcloud.ServerListOpts{})
servers, err := client.Server.All(ctx)
if err != nil {
return err
}

View file

@ -18,7 +18,7 @@ type serverTraffic struct {
}
func (serverTraffic serverTraffic) Run(client *hcloud.Client) error {
servers, _, err := client.Server.List(ctx, hcloud.ServerListOpts{})
servers, err := client.Server.All(ctx)
if err != nil {
return err
}

View file

@ -16,7 +16,7 @@ type snapshot struct {
}
func (snapshot snapshot) Run(client *hcloud.Client) error {
images, _, err := client.Image.List(ctx, hcloud.ImageListOpts{})
images, err := client.Image.All(ctx)
if err != nil {
return err
}

View file

@ -18,7 +18,7 @@ type volume struct {
}
func (volume volume) Run(client *hcloud.Client) error {
volumes, _, err := client.Volume.List(ctx, hcloud.VolumeListOpts{})
volumes, err := client.Volume.All(ctx)
if err != nil {
return err
}