Skip to content

Commit

Permalink
Merge pull request #388 from linode/dev
Browse files Browse the repository at this point in the history
Release v5.14.0
  • Loading branch information
lgarber-akamai committed Apr 1, 2024
2 parents 710ff67 + 0951c34 commit 18f96db
Show file tree
Hide file tree
Showing 27 changed files with 582 additions and 143 deletions.
38 changes: 38 additions & 0 deletions .github/labels.yml
@@ -0,0 +1,38 @@
# PR Labels
- name: new-feature
description: for new features in the changelog.
color: 225fee
- name: improvement
description: for improvements in existing functionality in the changelog.
color: 22ee47
- name: repo-ci-improvement
description: for improvements in the repository or CI workflow in the changelog.
color: c922ee
- name: bugfix
description: for any bug fixes in the changelog.
color: ed8e21
- name: documentation
description: for updates to the documentation in the changelog.
color: d3e1e6
- name: dependencies
description: dependency updates usually from dependabot
color: 5c9dff
- name: testing
description: for updates to the testing suite in the changelog.
color: 933ac9
- name: breaking-change
description: for breaking changes in the changelog.
color: ff0000
- name: ignore-for-release
description: PRs you do not want to render in the changelog
color: 7b8eac
- name: do-not-merge
description: PRs that should not be merged until the commented issue is resolved
color: eb1515
# Issue Labels
- name: enhancement
description: issues that request a enhancement
color: 22ee47
- name: bug
description: issues that report a bug
color: ed8e21
21 changes: 0 additions & 21 deletions .github/release-drafter.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/release.yml
@@ -0,0 +1,32 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: ⚠️ Breaking Change
labels:
- breaking-change
- title: 🐛 Bug Fixes
labels:
- bugfix
- title: 🚀 New Features
labels:
- new-feature
- title: 💡 Improvements
labels:
- improvement
- title: 🧪 Testing Improvements
labels:
- testing
- title: ⚙️ Repo/CI Improvements
labels:
- repo-ci-improvement
- title: 📖 Documentation
labels:
- documentation
- title: 📦 Dependency Updates
labels:
- dependencies
- title: Other Changes
labels:
- "*"
31 changes: 31 additions & 0 deletions .github/workflows/labeler.yml
@@ -0,0 +1,31 @@
name: labeler

on:
push:
branches:
- 'main'
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'

jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@de749cf181958193cb7debf1a9c5bb28922f3e1b
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
dry-run: ${{ github.event_name == 'pull_request' }}
exclude: |
help*
*issue
61 changes: 61 additions & 0 deletions .github/workflows/release-cross-repo-test.yml
@@ -0,0 +1,61 @@
name: Release Ansible cross repository test

on:
pull_request:
branches:
- main
types: [opened] # Workflow will only be executed when PR is opened to main branch
workflow_dispatch: # Manual trigger


jobs:
ansible_integration_test:
runs-on: ubuntu-latest
steps:
- name: Checkout linode_api4 repository
uses: actions/checkout@v4

- name: update packages
run: sudo apt-get update -y

- name: install make
run: sudo apt-get install -y build-essential

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install linode_api4
run: make install

- name: checkout repo
uses: actions/checkout@v3
with:
repository: linode/ansible_linode
path: .ansible/collections/ansible_collections/linode/cloud

- name: install dependencies
run: |
cd .ansible/collections/ansible_collections/linode/cloud
pip install -r requirements.txt -r requirements-dev.txt --upgrade-strategy only-if-needed
- name: install ansible dependencies
run: ansible-galaxy collection install amazon.aws:==6.0.1

- name: install collection
run: |
cd .ansible/collections/ansible_collections/linode/cloud
make install
- name: replace existing keys
run: |
cd .ansible/collections/ansible_collections/linode/cloud
rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa
- name: run tests
run: |
cd .ansible/collections/ansible_collections/linode/cloud
make testall
env:
LINODE_API_TOKEN: ${{ secrets.LINODE_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,16 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2
build:
os: ubuntu-lts-latest
tools:
python: latest
sphinx:
configuration: docs/conf.py
python:
install:
- method: pip
path: .
extra_requirements:
- doc
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -20,7 +20,7 @@
# -- Project information -----------------------------------------------------

project = 'linode_api4'
copyright = '2023, Linode'
copyright = '2024, Akamai Technologies Inc.'
author = 'Linode'

# The short X.Y version
Expand Down
20 changes: 19 additions & 1 deletion docs/linode_api4/linode_client.rst
Expand Up @@ -61,6 +61,15 @@ Includes methods for managing your account.
:members:
:special-members:

BetaGroup
^^^^^^^^^

Includes methods for enrolling in beta programs.

.. autoclass:: linode_api4.linode_client.BetaGroup
:members:
:special-members:

DatabaseGroup
^^^^^^^^^^^^^

Expand Down Expand Up @@ -98,7 +107,7 @@ accessing and working with associated features.
:members:
:special-members:

LKE Group
LKEGroup
^^^^^^^^^

Includes methods for interacting with Linode Kubernetes Engine.
Expand Down Expand Up @@ -199,3 +208,12 @@ Includes methods for managing Linode Volumes.
.. autoclass:: linode_api4.linode_client.VolumeGroup
:members:
:special-members:

VPCGroup
^^^^^^^^

Includes methods for managing Linode VPCs.

.. autoclass:: linode_api4.linode_client.VPCGroup
:members:
:special-members:
18 changes: 18 additions & 0 deletions docs/linode_api4/objects/models.rst
Expand Up @@ -14,6 +14,15 @@ Account Models
:undoc-members:
:inherited-members:

Beta Models
-----------

.. automodule:: linode_api4.objects.beta
:members:
:exclude-members: api_endpoint, properties, derived_url_path, id_attribute, parent_id_name
:undoc-members:
:inherited-members:

Database Models
-------------

Expand Down Expand Up @@ -139,3 +148,12 @@ Volume Models
:exclude-members: api_endpoint, properties, derived_url_path, id_attribute, parent_id_name
:undoc-members:
:inherited-members:

VPC Models
----------

.. automodule:: linode_api4.objects.vpc
:members:
:exclude-members: api_endpoint, properties, derived_url_path, id_attribute, parent_id_name
:undoc-members:
:inherited-members:
1 change: 0 additions & 1 deletion docs/requirements.txt

This file was deleted.

25 changes: 23 additions & 2 deletions linode_api4/groups/vpc.py
@@ -1,9 +1,8 @@
from typing import Any, Dict, List, Optional, Union

from linode_api4 import VPCSubnet
from linode_api4.errors import UnexpectedResponseError
from linode_api4.groups import Group
from linode_api4.objects import VPC, Base, Region
from linode_api4.objects import VPC, Region, VPCIPAddress
from linode_api4.paginated_list import PaginatedList


Expand Down Expand Up @@ -81,3 +80,25 @@ def create(

d = VPC(self.client, result["id"], result)
return d

def ips(self, *filters) -> PaginatedList:
"""
Retrieves all of the VPC IP addresses for the current account matching the given filters.
This is intended to be called from the :any:`LinodeClient`
class, like this::
vpc_ips = client.vpcs.ips()
API Documentation: TODO
:param filters: Any number of filters to apply to this query.
See :doc:`Filtering Collections</linode_api4/objects/filtering>`
for more details on filtering.
:returns: A list of VPCIPAddresses the acting user can access.
:rtype: PaginatedList of VPCIPAddress
"""
return self.client._get_and_filter(
VPCIPAddress, *filters, endpoint="/vpcs/ips"
)
7 changes: 6 additions & 1 deletion linode_api4/objects/linode.py
Expand Up @@ -21,7 +21,7 @@
)
from linode_api4.objects.base import MappedObject
from linode_api4.objects.filtering import FilterableAttribute
from linode_api4.objects.networking import IPAddress, IPv6Range
from linode_api4.objects.networking import IPAddress, IPv6Range, VPCIPAddress
from linode_api4.objects.vpc import VPC, VPCSubnet
from linode_api4.paginated_list import PaginatedList

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

vpc = [
VPCIPAddress.from_json(v) for v in result["ipv4"].get("vpc", [])
]

slaac = IPAddress(
self._client,
result["ipv6"]["slaac"]["address"],
Expand All @@ -716,6 +720,7 @@ def ips(self):
"private": v4pri,
"shared": shared_ips,
"reserved": reserved,
"vpc": vpc,
},
"ipv6": {
"slaac": slaac,
Expand Down

0 comments on commit 18f96db

Please sign in to comment.