-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add new module for checking Equinix Metal metro capacity #194
base: main
Are you sure you want to change the base?
feat: Add new module for checking Equinix Metal metro capacity #194
Conversation
This commit adds the `metal_metro_capacity_info.py` module, which allows gathering information about the current capacity for Equinix Metal metros.
- Generated documentation for new module metal_metro_capacity_info - Injected DOCUMENTATION, EXAMPLES, and RETURN sections into metal_metro_capacity_info.py
The code changes in `api_routes.py` add a new endpoint for retrieving metro capacity information in the Equinix Metal API. This change is necessary to support the new `metal_metro_capacity_info` module.
This commit adds the attribute mapper for the `metal_metro_capacity_info` resource type in the `metal_api.py` file. The attribute mapper maps the response attributes for the `metal_metro_capacity_info` resource type to their corresponding keys in the API response.
I encountered an issue while using the CapacityApi.find_capacity_for_metro endpoint from the Equinix Python SDK. The error indicated that a
Any insights or directions are appreciated. |
api_token = module.params['metal_api_token'] | ||
headers = {'X-Auth-Token': api_token} | ||
|
||
response = requests.get(f"{api_url}/capacity/metros", headers=headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go through the SDK client rather than using requests
. Is the metro capacity endpoint missing in the SDK?
@paolacernada Quick note on the commits. Use |
The code is failing with the following error due to a bug in the SDK:
This error occurs because the |
Added a new Ansible module named metal_capacity_metro_info to gather capacity information for Equinix Metal metros.