Skip to content

Commit 18f96db

Browse files
Merge pull request #388 from linode/dev
Release v5.14.0
2 parents 710ff67 + 0951c34 commit 18f96db

27 files changed

+582
-143
lines changed

.github/labels.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PR Labels
2+
- name: new-feature
3+
description: for new features in the changelog.
4+
color: 225fee
5+
- name: improvement
6+
description: for improvements in existing functionality in the changelog.
7+
color: 22ee47
8+
- name: repo-ci-improvement
9+
description: for improvements in the repository or CI workflow in the changelog.
10+
color: c922ee
11+
- name: bugfix
12+
description: for any bug fixes in the changelog.
13+
color: ed8e21
14+
- name: documentation
15+
description: for updates to the documentation in the changelog.
16+
color: d3e1e6
17+
- name: dependencies
18+
description: dependency updates usually from dependabot
19+
color: 5c9dff
20+
- name: testing
21+
description: for updates to the testing suite in the changelog.
22+
color: 933ac9
23+
- name: breaking-change
24+
description: for breaking changes in the changelog.
25+
color: ff0000
26+
- name: ignore-for-release
27+
description: PRs you do not want to render in the changelog
28+
color: 7b8eac
29+
- name: do-not-merge
30+
description: PRs that should not be merged until the commented issue is resolved
31+
color: eb1515
32+
# Issue Labels
33+
- name: enhancement
34+
description: issues that request a enhancement
35+
color: 22ee47
36+
- name: bug
37+
description: issues that report a bug
38+
color: ed8e21

.github/release-drafter.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
categories:
6+
- title: ⚠️ Breaking Change
7+
labels:
8+
- breaking-change
9+
- title: 🐛 Bug Fixes
10+
labels:
11+
- bugfix
12+
- title: 🚀 New Features
13+
labels:
14+
- new-feature
15+
- title: 💡 Improvements
16+
labels:
17+
- improvement
18+
- title: 🧪 Testing Improvements
19+
labels:
20+
- testing
21+
- title: ⚙️ Repo/CI Improvements
22+
labels:
23+
- repo-ci-improvement
24+
- title: 📖 Documentation
25+
labels:
26+
- documentation
27+
- title: 📦 Dependency Updates
28+
labels:
29+
- dependencies
30+
- title: Other Changes
31+
labels:
32+
- "*"

.github/workflows/labeler.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: labeler
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- '.github/labels.yml'
9+
- '.github/workflows/labeler.yml'
10+
pull_request:
11+
paths:
12+
- '.github/labels.yml'
13+
- '.github/workflows/labeler.yml'
14+
15+
jobs:
16+
labeler:
17+
runs-on: ubuntu-latest
18+
steps:
19+
-
20+
name: Checkout
21+
uses: actions/checkout@v4
22+
-
23+
name: Run Labeler
24+
uses: crazy-max/ghaction-github-labeler@de749cf181958193cb7debf1a9c5bb28922f3e1b
25+
with:
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
yaml-file: .github/labels.yml
28+
dry-run: ${{ github.event_name == 'pull_request' }}
29+
exclude: |
30+
help*
31+
*issue
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release Ansible cross repository test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [opened] # Workflow will only be executed when PR is opened to main branch
8+
workflow_dispatch: # Manual trigger
9+
10+
11+
jobs:
12+
ansible_integration_test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout linode_api4 repository
16+
uses: actions/checkout@v4
17+
18+
- name: update packages
19+
run: sudo apt-get update -y
20+
21+
- name: install make
22+
run: sudo apt-get install -y build-essential
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Install linode_api4
30+
run: make install
31+
32+
- name: checkout repo
33+
uses: actions/checkout@v3
34+
with:
35+
repository: linode/ansible_linode
36+
path: .ansible/collections/ansible_collections/linode/cloud
37+
38+
- name: install dependencies
39+
run: |
40+
cd .ansible/collections/ansible_collections/linode/cloud
41+
pip install -r requirements.txt -r requirements-dev.txt --upgrade-strategy only-if-needed
42+
43+
- name: install ansible dependencies
44+
run: ansible-galaxy collection install amazon.aws:==6.0.1
45+
46+
- name: install collection
47+
run: |
48+
cd .ansible/collections/ansible_collections/linode/cloud
49+
make install
50+
51+
- name: replace existing keys
52+
run: |
53+
cd .ansible/collections/ansible_collections/linode/cloud
54+
rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa
55+
56+
- name: run tests
57+
run: |
58+
cd .ansible/collections/ansible_collections/linode/cloud
59+
make testall
60+
env:
61+
LINODE_API_TOKEN: ${{ secrets.LINODE_TOKEN }}

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
build:
6+
os: ubuntu-lts-latest
7+
tools:
8+
python: latest
9+
sphinx:
10+
configuration: docs/conf.py
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- doc

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'linode_api4'
23-
copyright = '2023, Linode'
23+
copyright = '2024, Akamai Technologies Inc.'
2424
author = 'Linode'
2525

2626
# The short X.Y version

docs/linode_api4/linode_client.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ Includes methods for managing your account.
6161
:members:
6262
:special-members:
6363

64+
BetaGroup
65+
^^^^^^^^^
66+
67+
Includes methods for enrolling in beta programs.
68+
69+
.. autoclass:: linode_api4.linode_client.BetaGroup
70+
:members:
71+
:special-members:
72+
6473
DatabaseGroup
6574
^^^^^^^^^^^^^
6675

@@ -98,7 +107,7 @@ accessing and working with associated features.
98107
:members:
99108
:special-members:
100109

101-
LKE Group
110+
LKEGroup
102111
^^^^^^^^^
103112

104113
Includes methods for interacting with Linode Kubernetes Engine.
@@ -199,3 +208,12 @@ Includes methods for managing Linode Volumes.
199208
.. autoclass:: linode_api4.linode_client.VolumeGroup
200209
:members:
201210
:special-members:
211+
212+
VPCGroup
213+
^^^^^^^^
214+
215+
Includes methods for managing Linode VPCs.
216+
217+
.. autoclass:: linode_api4.linode_client.VPCGroup
218+
:members:
219+
:special-members:

docs/linode_api4/objects/models.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Account Models
1414
:undoc-members:
1515
:inherited-members:
1616

17+
Beta Models
18+
-----------
19+
20+
.. automodule:: linode_api4.objects.beta
21+
:members:
22+
:exclude-members: api_endpoint, properties, derived_url_path, id_attribute, parent_id_name
23+
:undoc-members:
24+
:inherited-members:
25+
1726
Database Models
1827
-------------
1928

@@ -139,3 +148,12 @@ Volume Models
139148
:exclude-members: api_endpoint, properties, derived_url_path, id_attribute, parent_id_name
140149
:undoc-members:
141150
:inherited-members:
151+
152+
VPC Models
153+
----------
154+
155+
.. automodule:: linode_api4.objects.vpc
156+
:members:
157+
:exclude-members: api_endpoint, properties, derived_url_path, id_attribute, parent_id_name
158+
:undoc-members:
159+
:inherited-members:

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

linode_api4/groups/vpc.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from typing import Any, Dict, List, Optional, Union
22

3-
from linode_api4 import VPCSubnet
43
from linode_api4.errors import UnexpectedResponseError
54
from linode_api4.groups import Group
6-
from linode_api4.objects import VPC, Base, Region
5+
from linode_api4.objects import VPC, Region, VPCIPAddress
76
from linode_api4.paginated_list import PaginatedList
87

98

@@ -81,3 +80,25 @@ def create(
8180

8281
d = VPC(self.client, result["id"], result)
8382
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+
)

linode_api4/objects/linode.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from linode_api4.objects.base import MappedObject
2323
from linode_api4.objects.filtering import FilterableAttribute
24-
from linode_api4.objects.networking import IPAddress, IPv6Range
24+
from linode_api4.objects.networking import IPAddress, IPv6Range, VPCIPAddress
2525
from linode_api4.objects.vpc import VPC, VPCSubnet
2626
from linode_api4.paginated_list import PaginatedList
2727

@@ -693,6 +693,10 @@ def ips(self):
693693
i = IPAddress(self._client, c["address"], c)
694694
reserved.append(i)
695695

696+
vpc = [
697+
VPCIPAddress.from_json(v) for v in result["ipv4"].get("vpc", [])
698+
]
699+
696700
slaac = IPAddress(
697701
self._client,
698702
result["ipv6"]["slaac"]["address"],
@@ -716,6 +720,7 @@ def ips(self):
716720
"private": v4pri,
717721
"shared": shared_ips,
718722
"reserved": reserved,
723+
"vpc": vpc,
719724
},
720725
"ipv6": {
721726
"slaac": slaac,

0 commit comments

Comments
 (0)