mirror of
https://github.com/jangraefen/hcloud-pricing-exporter
synced 2024-11-10 05:54:15 +00:00
feat: paginate hcloud requests
This commit is contained in:
parent
0a0204f07f
commit
04826e589a
9 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue