File: vpc_ips.go

package info (click to toggle)
golang-github-linode-linodego 1.55.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,112 kB
  • sloc: makefile: 96; sh: 52; python: 24
file content (20 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package linodego

import (
	"context"
	"fmt"
)

// ListAllVPCIPAddresses gets the list of all IP addresses of all VPCs in the Linode account.
func (c *Client) ListAllVPCIPAddresses(
	ctx context.Context, opts *ListOptions,
) ([]VPCIP, error) {
	return getPaginatedResults[VPCIP](ctx, c, "vpcs/ips", opts)
}

// ListVPCIPAddresses gets the list of all IP addresses of a specific VPC.
func (c *Client) ListVPCIPAddresses(
	ctx context.Context, vpcID int, opts *ListOptions,
) ([]VPCIP, error) {
	return getPaginatedResults[VPCIP](ctx, c, fmt.Sprintf("vpcs/%d/ips", vpcID), opts)
}