Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #51 from equinix-labs/paginated_listers
Browse files Browse the repository at this point in the history
feat: templates for listing methods that fetch all pages
  • Loading branch information
t0mk authored Nov 7, 2023
2 parents 3a2c18a + 969786f commit bad99c1
Show file tree
Hide file tree
Showing 31 changed files with 1,582 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CURRENT_GID := $(shell id -g)
OPENAPI_COMMAND=docker run --rm -u ${CURRENT_UID}:${CURRENT_GID} -v $(CURDIR):/local ${OPENAPI_CODEGEN_IMAGE}
GIT_REPO=metal-python
GIT_ORG=equinix-labs
OPENAPI_CONFIG:=oas3.config.json
OPENAPI_CONFIG:=config/openapi-generator.json
PACKAGE_NAME=equinix_metal
STITCHED_DIR=oas3.stitched
STITCHED_FILE=metal_openapi.yaml
Expand Down Expand Up @@ -46,6 +46,7 @@ generate: clean patch-spec
-i /local/${SPEC_PATCHED_FILE} \
-g python \
-o /local/${PACKAGE_NAME} \
-c /local/${OPENAPI_CONFIG} \
--git-repo-id ${GIT_REPO} \
--git-user-id ${GIT_ORG} \
--http-user-agent ${USER_AGENT} \
Expand Down
3 changes: 3 additions & 0 deletions config/openapi-generator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"templateDir": "/local/templates"
}
12 changes: 12 additions & 0 deletions equinix_metal/docs/DevicesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Method | HTTP request | Description
[**find_ip_assignment_customdata**](DevicesApi.md#find_ip_assignment_customdata) | **GET** /devices/{instance_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Assignment
[**find_ip_assignments**](DevicesApi.md#find_ip_assignments) | **GET** /devices/{id}/ips | Retrieve all ip assignments
[**find_organization_devices**](DevicesApi.md#find_organization_devices) | **GET** /organizations/{id}/devices | Retrieve all devices of an organization
[**find_organization_devices_all_pages**](DevicesApi.md#find_organization_devices_all_pages) | **GET** /organizations/{id}/devices | Retrieve all devices of an organization, fetches all the pages
[**find_project_devices**](DevicesApi.md#find_project_devices) | **GET** /projects/{id}/devices | Retrieve all devices of a project
[**find_project_devices_all_pages**](DevicesApi.md#find_project_devices_all_pages) | **GET** /projects/{id}/devices | Retrieve all devices of a project, fetches all the pages
[**find_traffic**](DevicesApi.md#find_traffic) | **GET** /devices/{id}/traffic | Retrieve device traffic
[**get_bgp_neighbor_data**](DevicesApi.md#get_bgp_neighbor_data) | **GET** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device
[**get_device_firmware_sets**](DevicesApi.md#get_device_firmware_sets) | **GET** /devices/{id}/firmware-sets | Get Device's associated Firmware Set
Expand Down Expand Up @@ -1127,6 +1129,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_organization_devices_all_pages**
> DeviceList find_organization_devices_all_pages(id, search=search, categories=categories, facility=facility, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, include=include, exclude=exclude, per_page=per_page)
Just like [**find_organization_devices**](DevicesApi.md#find_organization_devices) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organization_devices**](DevicesApi.md#find_organization_devices).

# **find_project_devices**
> DeviceList find_project_devices(id, search=search, categories=categories, facility=facility, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, include=include, exclude=exclude, page=page, per_page=per_page)
Expand Down Expand Up @@ -1232,6 +1239,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_project_devices_all_pages**
> DeviceList find_project_devices_all_pages(id, search=search, categories=categories, facility=facility, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, include=include, exclude=exclude, per_page=per_page)
Just like [**find_project_devices**](DevicesApi.md#find_project_devices) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_project_devices**](DevicesApi.md#find_project_devices).

# **find_traffic**
> find_traffic(id, direction, interval=interval, bucket=bucket, timeframe=timeframe)
Expand Down
30 changes: 30 additions & 0 deletions equinix_metal/docs/EventsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ All URIs are relative to *https://api.equinix.com/metal/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**find_device_events**](EventsApi.md#find_device_events) | **GET** /devices/{id}/events | Retrieve device's events
[**find_device_events_all_pages**](EventsApi.md#find_device_events_all_pages) | **GET** /devices/{id}/events | Retrieve device's events, fetches all the pages
[**find_event_by_id**](EventsApi.md#find_event_by_id) | **GET** /events/{id} | Retrieve an event
[**find_events**](EventsApi.md#find_events) | **GET** /events | Retrieve current user's events
[**find_events_all_pages**](EventsApi.md#find_events_all_pages) | **GET** /events | Retrieve current user's events, fetches all the pages
[**find_interconnection_events**](EventsApi.md#find_interconnection_events) | **GET** /connections/{connection_id}/events | Retrieve interconnection events
[**find_interconnection_events_all_pages**](EventsApi.md#find_interconnection_events_all_pages) | **GET** /connections/{connection_id}/events | Retrieve interconnection events, fetches all the pages
[**find_interconnection_port_events**](EventsApi.md#find_interconnection_port_events) | **GET** /connections/{connection_id}/ports/{id}/events | Retrieve interconnection port events
[**find_organization_events**](EventsApi.md#find_organization_events) | **GET** /organizations/{id}/events | Retrieve organization's events
[**find_organization_events_all_pages**](EventsApi.md#find_organization_events_all_pages) | **GET** /organizations/{id}/events | Retrieve organization's events, fetches all the pages
[**find_project_events**](EventsApi.md#find_project_events) | **GET** /projects/{id}/events | Retrieve project's events
[**find_project_events_all_pages**](EventsApi.md#find_project_events_all_pages) | **GET** /projects/{id}/events | Retrieve project's events, fetches all the pages
[**find_virtual_circuit_events**](EventsApi.md#find_virtual_circuit_events) | **GET** /virtual-circuits/{id}/events | Retrieve virtual circuit events
[**find_vrf_route_events**](EventsApi.md#find_vrf_route_events) | **GET** /routes/{id}/events | Retrieve VRF route events

Expand Down Expand Up @@ -104,6 +109,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_device_events_all_pages**
> EventList find_device_events_all_pages(id, include=include, exclude=exclude, per_page=per_page)
Just like [**find_device_events**](EventsApi.md#find_device_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_device_events**](EventsApi.md#find_device_events).

# **find_event_by_id**
> Event find_event_by_id(id, include=include, exclude=exclude)
Expand Down Expand Up @@ -274,6 +284,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_events_all_pages**
> EventList find_events_all_pages(include=include, exclude=exclude, per_page=per_page)
Just like [**find_events**](EventsApi.md#find_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_events**](EventsApi.md#find_events).

# **find_interconnection_events**
> EventList find_interconnection_events(connection_id, include=include, exclude=exclude, page=page, per_page=per_page)
Expand Down Expand Up @@ -363,6 +378,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_interconnection_events_all_pages**
> EventList find_interconnection_events_all_pages(connection_id, include=include, exclude=exclude, per_page=per_page)
Just like [**find_interconnection_events**](EventsApi.md#find_interconnection_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_interconnection_events**](EventsApi.md#find_interconnection_events).

# **find_interconnection_port_events**
> Event find_interconnection_port_events(connection_id, id, include=include, exclude=exclude, page=page, per_page=per_page)
Expand Down Expand Up @@ -543,6 +563,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_organization_events_all_pages**
> EventList find_organization_events_all_pages(id, include=include, exclude=exclude, per_page=per_page)
Just like [**find_organization_events**](EventsApi.md#find_organization_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organization_events**](EventsApi.md#find_organization_events).

# **find_project_events**
> EventList find_project_events(id, include=include, exclude=exclude, page=page, per_page=per_page)
Expand Down Expand Up @@ -632,6 +657,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_project_events_all_pages**
> EventList find_project_events_all_pages(id, include=include, exclude=exclude, per_page=per_page)
Just like [**find_project_events**](EventsApi.md#find_project_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_project_events**](EventsApi.md#find_project_events).

# **find_virtual_circuit_events**
> Event find_virtual_circuit_events(id, include=include, exclude=exclude, page=page, per_page=per_page)
Expand Down
6 changes: 6 additions & 0 deletions equinix_metal/docs/HardwareReservationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Method | HTTP request | Description
[**activate_hardware_reservation**](HardwareReservationsApi.md#activate_hardware_reservation) | **POST** /hardware-reservations/{id}/activate | Activate a spare hardware reservation
[**find_hardware_reservation_by_id**](HardwareReservationsApi.md#find_hardware_reservation_by_id) | **GET** /hardware-reservations/{id} | Retrieve a hardware reservation
[**find_project_hardware_reservations**](HardwareReservationsApi.md#find_project_hardware_reservations) | **GET** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project
[**find_project_hardware_reservations_all_pages**](HardwareReservationsApi.md#find_project_hardware_reservations_all_pages) | **GET** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project, fetches all the pages
[**move_hardware_reservation**](HardwareReservationsApi.md#move_hardware_reservation) | **POST** /hardware-reservations/{id}/move | Move a hardware reservation


Expand Down Expand Up @@ -278,6 +279,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_project_hardware_reservations_all_pages**
> HardwareReservationList find_project_hardware_reservations_all_pages(id, query=query, state=state, provisionable=provisionable, include=include, exclude=exclude, per_page=per_page)
Just like [**find_project_hardware_reservations**](HardwareReservationsApi.md#find_project_hardware_reservations) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_project_hardware_reservations**](HardwareReservationsApi.md#find_project_hardware_reservations).

# **move_hardware_reservation**
> HardwareReservation move_hardware_reservation(id, move_hardware_reservation_request, include=include, exclude=exclude)
Expand Down
6 changes: 6 additions & 0 deletions equinix_metal/docs/InterconnectionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Method | HTTP request | Description
[**list_interconnection_virtual_circuits**](InterconnectionsApi.md#list_interconnection_virtual_circuits) | **GET** /connections/{connection_id}/virtual-circuits | List a interconnection's virtual circuits
[**organization_list_interconnections**](InterconnectionsApi.md#organization_list_interconnections) | **GET** /organizations/{organization_id}/connections | List organization connections
[**project_list_interconnections**](InterconnectionsApi.md#project_list_interconnections) | **GET** /projects/{project_id}/connections | List project connections
[**project_list_interconnections_all_pages**](InterconnectionsApi.md#project_list_interconnections_all_pages) | **GET** /projects/{project_id}/connections | List project connections, fetches all the pages
[**update_interconnection**](InterconnectionsApi.md#update_interconnection) | **PUT** /connections/{connection_id} | Update interconnection
[**update_virtual_circuit**](InterconnectionsApi.md#update_virtual_circuit) | **PUT** /virtual-circuits/{id} | Update a virtual circuit

Expand Down Expand Up @@ -1121,6 +1122,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **project_list_interconnections_all_pages**
> InterconnectionList project_list_interconnections_all_pages(project_id, include=include, exclude=exclude, per_page=per_page)
Just like [**project_list_interconnections**](InterconnectionsApi.md#project_list_interconnections) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**project_list_interconnections**](InterconnectionsApi.md#project_list_interconnections).

# **update_interconnection**
> Interconnection update_interconnection(connection_id, interconnection_update_input, include=include, exclude=exclude)
Expand Down
6 changes: 6 additions & 0 deletions equinix_metal/docs/MetalGatewaysApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Method | HTTP request | Description
[**delete_metal_gateway**](MetalGatewaysApi.md#delete_metal_gateway) | **DELETE** /metal-gateways/{id} | Deletes the metal gateway
[**find_metal_gateway_by_id**](MetalGatewaysApi.md#find_metal_gateway_by_id) | **GET** /metal-gateways/{id} | Returns the metal gateway
[**find_metal_gateways_by_project**](MetalGatewaysApi.md#find_metal_gateways_by_project) | **GET** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project
[**find_metal_gateways_by_project_all_pages**](MetalGatewaysApi.md#find_metal_gateways_by_project_all_pages) | **GET** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project, fetches all the pages
[**get_metal_gateway_elastic_ips**](MetalGatewaysApi.md#get_metal_gateway_elastic_ips) | **GET** /metal-gateways/{id}/ips | List Metal Gateway Elastic IPs


Expand Down Expand Up @@ -449,6 +450,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_metal_gateways_by_project_all_pages**
> MetalGatewayList find_metal_gateways_by_project_all_pages(project_id, include=include, exclude=exclude, per_page=per_page)
Just like [**find_metal_gateways_by_project**](MetalGatewaysApi.md#find_metal_gateways_by_project) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_metal_gateways_by_project**](MetalGatewaysApi.md#find_metal_gateways_by_project).

# **get_metal_gateway_elastic_ips**
> IPAssignmentList get_metal_gateway_elastic_ips(id, include=include, exclude=exclude)
Expand Down
12 changes: 12 additions & 0 deletions equinix_metal/docs/OrganizationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Method | HTTP request | Description
[**find_organization_invitations**](OrganizationsApi.md#find_organization_invitations) | **GET** /organizations/{id}/invitations | Retrieve organization invitations
[**find_organization_payment_methods**](OrganizationsApi.md#find_organization_payment_methods) | **GET** /organizations/{id}/payment-methods | Retrieve all payment methods of an organization
[**find_organization_projects**](OrganizationsApi.md#find_organization_projects) | **GET** /organizations/{id}/projects | Retrieve all projects of an organization
[**find_organization_projects_all_pages**](OrganizationsApi.md#find_organization_projects_all_pages) | **GET** /organizations/{id}/projects | Retrieve all projects of an organization, fetches all the pages
[**find_organization_transfers**](OrganizationsApi.md#find_organization_transfers) | **GET** /organizations/{id}/transfers | Retrieve all project transfer requests from or to an organization
[**find_organizations**](OrganizationsApi.md#find_organizations) | **GET** /organizations | Retrieve all organizations
[**find_organizations_all_pages**](OrganizationsApi.md#find_organizations_all_pages) | **GET** /organizations | Retrieve all organizations, fetches all the pages
[**find_plans_by_organization**](OrganizationsApi.md#find_plans_by_organization) | **GET** /organizations/{id}/plans | Retrieve all plans visible by the organization
[**update_organization**](OrganizationsApi.md#update_organization) | **PUT** /organizations/{id} | Update the organization

Expand Down Expand Up @@ -952,6 +954,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_organization_projects_all_pages**
> ProjectList find_organization_projects_all_pages(id, name=name, include=include, exclude=exclude, per_page=per_page)
Just like [**find_organization_projects**](OrganizationsApi.md#find_organization_projects) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organization_projects**](OrganizationsApi.md#find_organization_projects).

# **find_organization_transfers**
> TransferRequestList find_organization_transfers(id, include=include)
Expand Down Expand Up @@ -1123,6 +1130,11 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **find_organizations_all_pages**
> OrganizationList find_organizations_all_pages(personal=personal, without_projects=without_projects, include=include, exclude=exclude, per_page=per_page)
Just like [**find_organizations**](OrganizationsApi.md#find_organizations) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organizations**](OrganizationsApi.md#find_organizations).

# **find_plans_by_organization**
> PlanList find_plans_by_organization(id, include=include, exclude=exclude)
Expand Down
Loading

0 comments on commit bad99c1

Please sign in to comment.