Skip to content

new: Add available field to AccountAvailability class - #395

Merged
lgarber-akamai merged 2 commits into
linode:devfrom
lgarber-akamai:new/avail-attr
Apr 17, 2024
Merged

new: Add available field to AccountAvailability class#395
lgarber-akamai merged 2 commits into
linode:devfrom
lgarber-akamai:new/avail-attr

Conversation

@lgarber-akamai

@lgarber-akamai lgarber-akamai commented Apr 15, 2024

Copy link
Copy Markdown
Contributor

📝 Description

This pull requests adds the new available field to the AccountAvailability class and adjusts the unit tests/fixtures accordingly.

✔️ How to Test

The following test steps assume you have pulled this PR locally and run make install.

Unit Testing

make testunit

Manual Testing

  1. In a linode_api4 testing environment (e.g. dx-devenv), run the following:
import argparse
import os

from linode_api4 import LinodeClient, Instance

client = LinodeClient(
    os.getenv("LINODE_TOKEN"),
    base_url="https://.../v4beta",
    ca_path="..."
)

for avail in client.account.availabilities():
    print(f"{avail.region} - {avail.available}")

NOTE: Ensure the base_url kwarg is updated to point at the correct API environment.

  1. Ensure all regions and their corresponding availabilities are printed to the console with no errors.

@lgarber-akamai lgarber-akamai added new-feature for new features in the changelog. do-not-merge PRs that should not be merged until the commented issue is resolved labels Apr 15, 2024
@lgarber-akamai
lgarber-akamai requested a review from a team as a code owner April 15, 2024 16:02
@lgarber-akamai
lgarber-akamai requested review from jriddle-linode and yec-akamai and removed request for a team April 15, 2024 16:02

@yec-akamai yec-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Everything works well on my end

Comment thread linode_api4/objects/account.py
@lgarber-akamai lgarber-akamai removed the do-not-merge PRs that should not be merged until the commented issue is resolved label Apr 16, 2024

@ykim-akamai ykim-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tests pass locally

@lgarber-akamai
lgarber-akamai merged commit 23d41fd into linode:dev Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants