|
1 | 1 | from typing import Any, Dict, List, Optional, Union |
2 | 2 |
|
3 | | -from linode_api4 import VPCSubnet |
4 | 3 | from linode_api4.errors import UnexpectedResponseError |
5 | 4 | from linode_api4.groups import Group |
6 | | -from linode_api4.objects import VPC, Base, Region |
| 5 | +from linode_api4.objects import VPC, Region, VPCIPAddress |
7 | 6 | from linode_api4.paginated_list import PaginatedList |
8 | 7 |
|
9 | 8 |
|
@@ -81,3 +80,25 @@ def create( |
81 | 80 |
|
82 | 81 | d = VPC(self.client, result["id"], result) |
83 | 82 | return d |
| 83 | + |
| 84 | + def ips(self, *filters) -> PaginatedList: |
| 85 | + """ |
| 86 | + Retrieves all of the VPC IP addresses for the current account matching the given filters. |
| 87 | +
|
| 88 | + This is intended to be called from the :any:`LinodeClient` |
| 89 | + class, like this:: |
| 90 | +
|
| 91 | + vpc_ips = client.vpcs.ips() |
| 92 | +
|
| 93 | + API Documentation: TODO |
| 94 | +
|
| 95 | + :param filters: Any number of filters to apply to this query. |
| 96 | + See :doc:`Filtering Collections</linode_api4/objects/filtering>` |
| 97 | + for more details on filtering. |
| 98 | +
|
| 99 | + :returns: A list of VPCIPAddresses the acting user can access. |
| 100 | + :rtype: PaginatedList of VPCIPAddress |
| 101 | + """ |
| 102 | + return self.client._get_and_filter( |
| 103 | + VPCIPAddress, *filters, endpoint="/vpcs/ips" |
| 104 | + ) |
0 commit comments