From f2ac7ca1c25c422e88d2fc01dc680ef9090fcf47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:17:41 -0500 Subject: [PATCH] feat: API Sync by GitHub Action (2024-03-13) (#90) This API Sync PR was automated through [GitHub Actions workflow_displatch](https://github.com/equinix-labs/metal-python/actions?query=event%3Aworkflow_dispatch) on 2024-03-13. * latest Equinix Metal API spec have been fetched * patches have been applied * generated client has been updated --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- equinix_metal/.openapi-generator/FILES | 302 +--------- equinix_metal/README.md | 6 + equinix_metal/docs/AuthTokenProject.md | 1 + equinix_metal/docs/CreateDeviceRequest.md | 2 +- ...reateOrganizationInterconnectionRequest.md | 1 + .../docs/DedicatedPortCreateInput.md | 1 + .../docs/DeviceCreateInMetroInput.md | 2 +- .../InstancesBatchCreateInputBatchesInner.md | 2 +- equinix_metal/docs/Interconnection.md | 5 +- equinix_metal/docs/MetroInput.md | 2 +- equinix_metal/docs/Port.md | 2 +- equinix_metal/docs/Project.md | 1 + equinix_metal/docs/VRFsApi.md | 162 ++++++ equinix_metal/docs/VirtualCircuit.md | 4 +- equinix_metal/docs/VirtualNetwork.md | 7 +- equinix_metal/docs/VlanFabricVcCreateInput.md | 3 +- equinix_metal/docs/VlanVirtualCircuit.md | 4 +- equinix_metal/docs/VrfBGPNeighbors.md | 30 + .../docs/VrfBGPNeighborsBgpNeighborsInner.md | 31 ++ equinix_metal/docs/VrfFabricVcCreateInput.md | 1 + equinix_metal/docs/VrfLearnedRoutes.md | 30 + .../VrfLearnedRoutesLearnedRoutesInner.md | 30 + equinix_metal/docs/VrfVirtualCircuit.md | 4 +- equinix_metal/equinix_metal/__init__.py | 4 + equinix_metal/equinix_metal/api/vrfs_api.py | 526 ++++++++++++++++++ .../equinix_metal/models/__init__.py | 4 + .../models/auth_token_project.py | 4 +- .../equinix_metal/models/bgp_config.py | 3 +- .../models/bgp_dynamic_neighbor.py | 5 +- .../bgp_dynamic_neighbor_create_input.py | 5 +- .../models/dedicated_port_create_input.py | 4 +- equinix_metal/equinix_metal/models/device.py | 2 +- .../models/device_create_in_metro_input.py | 2 +- ...tances_batch_create_input_batches_inner.py | 2 +- .../equinix_metal/models/interconnection.py | 18 +- .../models/interconnection_port.py | 4 +- .../equinix_metal/models/metro_input.py | 2 +- equinix_metal/equinix_metal/models/port.py | 9 +- equinix_metal/equinix_metal/models/project.py | 4 +- .../equinix_metal/models/virtual_circuit.py | 6 +- .../equinix_metal/models/virtual_network.py | 22 +- .../models/vlan_fabric_vc_create_input.py | 6 +- .../models/vlan_virtual_circuit.py | 12 +- equinix_metal/equinix_metal/models/vrf.py | 5 +- .../equinix_metal/models/vrf_bgp_neighbors.py | 98 ++++ .../vrf_bgp_neighbors_bgp_neighbors_inner.py | 93 ++++ .../equinix_metal/models/vrf_create_input.py | 5 +- .../models/vrf_fabric_vc_create_input.py | 4 +- .../models/vrf_learned_routes.py | 98 ++++ ...vrf_learned_routes_learned_routes_inner.py | 91 +++ .../models/vrf_virtual_circuit.py | 14 +- .../vrf_virtual_circuit_create_input.py | 4 +- .../vrf_virtual_circuit_update_input.py | 4 +- equinix_metal/test/test_vrf_bgp_neighbors.py | 58 ++ ...t_vrf_bgp_neighbors_bgp_neighbors_inner.py | 54 ++ equinix_metal/test/test_vrf_learned_routes.py | 57 ++ ...vrf_learned_routes_learned_routes_inner.py | 53 ++ metal_openapi.fixed.yaml | 201 ++++++- .../components/schemas/BgpConfig.yaml | 4 +- .../schemas/BgpConfigRequestInput.yaml | 1 + .../schemas/BgpDynamicNeighbor.yaml | 3 + .../BgpDynamicNeighborCreateInput.yaml | 3 + .../schemas/DedicatedPortCreateInput.yaml | 3 + .../components/schemas/Interconnection.yaml | 7 +- .../components/schemas/MetroInput.yaml | 4 +- oas3.fetched/components/schemas/Port.yaml | 2 +- oas3.fetched/components/schemas/Project.yaml | 2 + .../components/schemas/VirtualNetwork.yaml | 9 +- .../schemas/VlanFabricVcCreateInput.yaml | 4 + .../schemas/VlanVirtualCircuit.yaml | 4 +- oas3.fetched/components/schemas/Vrf.yaml | 5 +- .../components/schemas/VrfBGPNeighbors.yaml | 20 + .../components/schemas/VrfCreateInput.yaml | 5 +- .../schemas/VrfFabricVcCreateInput.yaml | 3 + .../components/schemas/VrfLearnedRoutes.yaml | 16 + .../components/schemas/VrfVirtualCircuit.yaml | 8 +- .../schemas/VrfVirtualCircuitCreateInput.yaml | 4 + .../schemas/VrfVirtualCircuitUpdateInput.yaml | 4 + oas3.fetched/openapi3.yaml | 9 + oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml | 34 ++ .../paths/vrfs/id/learned-routes.yaml | 35 ++ oas3.stitched/.openapi-generator/FILES | 1 - oas3.stitched/metal_openapi.yaml | 185 +++++- 83 files changed, 2088 insertions(+), 403 deletions(-) create mode 100644 equinix_metal/docs/VrfBGPNeighbors.md create mode 100644 equinix_metal/docs/VrfBGPNeighborsBgpNeighborsInner.md create mode 100644 equinix_metal/docs/VrfLearnedRoutes.md create mode 100644 equinix_metal/docs/VrfLearnedRoutesLearnedRoutesInner.md create mode 100644 equinix_metal/equinix_metal/models/vrf_bgp_neighbors.py create mode 100644 equinix_metal/equinix_metal/models/vrf_bgp_neighbors_bgp_neighbors_inner.py create mode 100644 equinix_metal/equinix_metal/models/vrf_learned_routes.py create mode 100644 equinix_metal/equinix_metal/models/vrf_learned_routes_learned_routes_inner.py create mode 100644 equinix_metal/test/test_vrf_bgp_neighbors.py create mode 100644 equinix_metal/test/test_vrf_bgp_neighbors_bgp_neighbors_inner.py create mode 100644 equinix_metal/test/test_vrf_learned_routes.py create mode 100644 equinix_metal/test/test_vrf_learned_routes_learned_routes_inner.py create mode 100644 oas3.fetched/components/schemas/VrfBGPNeighbors.yaml create mode 100644 oas3.fetched/components/schemas/VrfLearnedRoutes.yaml create mode 100644 oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml create mode 100644 oas3.fetched/paths/vrfs/id/learned-routes.yaml diff --git a/equinix_metal/.openapi-generator/FILES b/equinix_metal/.openapi-generator/FILES index 46784fce..6ecbf2f9 100644 --- a/equinix_metal/.openapi-generator/FILES +++ b/equinix_metal/.openapi-generator/FILES @@ -1,7 +1,6 @@ .github/workflows/python.yml .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md docs/AWSFabricProvider.md @@ -277,11 +276,15 @@ docs/VlanVirtualCircuit.md docs/VlanVirtualCircuitCreateInput.md docs/VlanVirtualCircuitUpdateInput.md docs/Vrf.md +docs/VrfBGPNeighbors.md +docs/VrfBGPNeighborsBgpNeighborsInner.md docs/VrfCreateInput.md docs/VrfFabricVcCreateInput.md docs/VrfIpReservation.md docs/VrfIpReservationCreateInput.md docs/VrfIpReservationList.md +docs/VrfLearnedRoutes.md +docs/VrfLearnedRoutesLearnedRoutesInner.md docs/VrfList.md docs/VrfMetalGateway.md docs/VrfMetalGatewayCreateInput.md @@ -573,11 +576,15 @@ equinix_metal/models/vlan_virtual_circuit.py equinix_metal/models/vlan_virtual_circuit_create_input.py equinix_metal/models/vlan_virtual_circuit_update_input.py equinix_metal/models/vrf.py +equinix_metal/models/vrf_bgp_neighbors.py +equinix_metal/models/vrf_bgp_neighbors_bgp_neighbors_inner.py equinix_metal/models/vrf_create_input.py equinix_metal/models/vrf_fabric_vc_create_input.py equinix_metal/models/vrf_ip_reservation.py equinix_metal/models/vrf_ip_reservation_create_input.py equinix_metal/models/vrf_ip_reservation_list.py +equinix_metal/models/vrf_learned_routes.py +equinix_metal/models/vrf_learned_routes_learned_routes_inner.py equinix_metal/models/vrf_list.py equinix_metal/models/vrf_metal_gateway.py equinix_metal/models/vrf_metal_gateway_create_input.py @@ -598,293 +605,8 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_activate_hardware_reservation_request.py -test/test_address.py -test/test_attribute.py -test/test_attribute_data.py -test/test_auth_token.py -test/test_auth_token_input.py -test/test_auth_token_list.py -test/test_auth_token_project.py -test/test_auth_token_user.py -test/test_authentication_api.py -test/test_aws_fabric_provider.py -test/test_batch.py -test/test_batches_api.py -test/test_batches_list.py -test/test_bgp_api.py -test/test_bgp_config.py -test/test_bgp_config_request_input.py -test/test_bgp_dynamic_neighbor.py -test/test_bgp_dynamic_neighbor_create_input.py -test/test_bgp_dynamic_neighbor_list.py -test/test_bgp_neighbor_data.py -test/test_bgp_route.py -test/test_bgp_session.py -test/test_bgp_session_input.py -test/test_bgp_session_list.py -test/test_bgp_session_neighbors.py -test/test_bond_port_data.py -test/test_capacity_api.py -test/test_capacity_check_per_facility_info.py -test/test_capacity_check_per_facility_list.py -test/test_capacity_check_per_metro_info.py -test/test_capacity_check_per_metro_list.py -test/test_capacity_input.py -test/test_capacity_level_per_baremetal.py -test/test_capacity_list.py -test/test_component.py -test/test_console_log_details_api.py -test/test_coordinates.py -test/test_create_device_request.py -test/test_create_email_input.py -test/test_create_metal_gateway_request.py -test/test_create_organization_interconnection_request.py -test/test_create_self_service_reservation_request.py -test/test_create_self_service_reservation_request_period.py -test/test_dedicated_port_create_input.py -test/test_device.py -test/test_device_action_input.py -test/test_device_actions_inner.py -test/test_device_create_in_facility_input.py -test/test_device_create_in_metro_input.py -test/test_device_create_input.py -test/test_device_created_by.py -test/test_device_health_rollup.py -test/test_device_list.py -test/test_device_metro.py -test/test_device_project_lite.py -test/test_device_update_input.py -test/test_device_usage.py -test/test_device_usage_list.py -test/test_devices_api.py -test/test_disk.py -test/test_email.py -test/test_email_input.py -test/test_emails_api.py -test/test_entitlement.py -test/test_error.py -test/test_event.py -test/test_event_list.py -test/test_events_api.py -test/test_fabric_service_token.py -test/test_facilities_api.py -test/test_facility.py -test/test_facility_input.py -test/test_facility_input_facility.py -test/test_facility_list.py -test/test_filesystem.py -test/test_find_ip_address_by_id200_response.py -test/test_find_metal_gateway_by_id200_response.py -test/test_find_traffic_timeframe_parameter.py -test/test_firmware_set.py -test/test_firmware_set_list_response.py -test/test_firmware_set_response.py -test/test_firmware_sets_api.py -test/test_global_bgp_range.py -test/test_global_bgp_range_list.py -test/test_hardware_reservation.py -test/test_hardware_reservation_list.py -test/test_hardware_reservations_api.py -test/test_href.py -test/test_incidents_api.py -test/test_instances_batch_create_input.py -test/test_instances_batch_create_input_batches_inner.py -test/test_interconnection.py -test/test_interconnection_list.py -test/test_interconnection_metro_list.py -test/test_interconnection_metro_list_metros_inner.py -test/test_interconnection_metro_list_metros_inner_all_of_providers_inner.py -test/test_interconnection_port.py -test/test_interconnection_port_list.py -test/test_interconnection_pricing_list.py -test/test_interconnection_pricing_list_provider_pricing_inner.py -test/test_interconnection_pricing_list_provider_pricing_inner_tiers_inner.py -test/test_interconnection_update_input.py -test/test_interconnections_api.py -test/test_invitation.py -test/test_invitation_input.py -test/test_invitation_list.py -test/test_invitations_api.py -test/test_invoice.py -test/test_invoice_list.py -test/test_invoices_api.py -test/test_ip_address.py -test/test_ip_addresses_api.py -test/test_ip_assignment.py -test/test_ip_assignment_input.py -test/test_ip_assignment_list.py -test/test_ip_assignment_metro.py -test/test_ip_assignment_update_input.py -test/test_ip_availabilities_list.py -test/test_ip_reservation.py -test/test_ip_reservation_facility.py -test/test_ip_reservation_list.py -test/test_ip_reservation_list_ip_addresses_inner.py -test/test_ip_reservation_metro.py -test/test_ip_reservation_request_input.py -test/test_license.py -test/test_license_create_input.py -test/test_license_list.py -test/test_license_update_input.py -test/test_licenses_api.py -test/test_line_item.py -test/test_membership.py -test/test_membership_input.py -test/test_membership_list.py -test/test_memberships_api.py -test/test_meta.py -test/test_metadata.py -test/test_metadata_network.py -test/test_metadata_network_network.py -test/test_metadata_network_network_bonding.py -test/test_metal_gateway.py -test/test_metal_gateway_create_input.py -test/test_metal_gateway_elastic_ip_create_input.py -test/test_metal_gateway_list.py -test/test_metal_gateway_list_metal_gateways_inner.py -test/test_metal_gateway_lite.py -test/test_metal_gateways_api.py -test/test_metro.py -test/test_metro_input.py -test/test_metro_list.py -test/test_metros_api.py -test/test_mount.py -test/test_move_hardware_reservation_request.py -test/test_new_password.py -test/test_operating_system.py -test/test_operating_system_list.py -test/test_operating_systems_api.py -test/test_organization.py -test/test_organization_input.py -test/test_organization_list.py -test/test_organizations_api.py -test/test_otps_api.py -test/test_parent_block.py -test/test_partition.py -test/test_password_reset_tokens_api.py -test/test_payment_method.py -test/test_payment_method_billing_address.py -test/test_payment_method_create_input.py -test/test_payment_method_list.py -test/test_payment_method_update_input.py -test/test_payment_methods_api.py -test/test_plan.py -test/test_plan_available_in_inner.py -test/test_plan_available_in_inner_price.py -test/test_plan_available_in_metros_inner.py -test/test_plan_list.py -test/test_plan_specs.py -test/test_plan_specs_cpus_inner.py -test/test_plan_specs_drives_inner.py -test/test_plan_specs_features.py -test/test_plan_specs_memory.py -test/test_plan_specs_nics_inner.py -test/test_plans_api.py -test/test_port.py -test/test_port_assign_input.py -test/test_port_convert_layer3_input.py -test/test_port_convert_layer3_input_request_ips_inner.py -test/test_port_data.py -test/test_port_vlan_assignment.py -test/test_port_vlan_assignment_batch.py -test/test_port_vlan_assignment_batch_create_input.py -test/test_port_vlan_assignment_batch_create_input_vlan_assignments_inner.py -test/test_port_vlan_assignment_batch_list.py -test/test_port_vlan_assignment_batch_vlan_assignments_inner.py -test/test_port_vlan_assignment_list.py -test/test_ports_api.py -test/test_project.py -test/test_project_create_from_root_input.py -test/test_project_create_input.py -test/test_project_id_name.py -test/test_project_list.py -test/test_project_update_input.py -test/test_project_usage.py -test/test_project_usage_list.py -test/test_projects_api.py -test/test_raid.py -test/test_recovery_code_list.py -test/test_request_ip_reservation201_response.py -test/test_request_ip_reservation_request.py -test/test_self_service_reservation_item_request.py -test/test_self_service_reservation_item_response.py -test/test_self_service_reservation_list.py -test/test_self_service_reservation_response.py -test/test_self_service_reservations_api.py -test/test_server_info.py -test/test_shared_port_vc_vlan_create_input.py -test/test_spot_market_api.py -test/test_spot_market_prices_list.py -test/test_spot_market_prices_per_metro_list.py -test/test_spot_market_prices_per_metro_report.py -test/test_spot_market_request.py -test/test_spot_market_request_create_input.py -test/test_spot_market_request_create_input_instance_parameters.py -test/test_spot_market_request_list.py -test/test_spot_market_request_metro.py -test/test_spot_prices_datapoints.py -test/test_spot_prices_history_report.py -test/test_spot_prices_per_baremetal.py -test/test_spot_prices_per_facility.py -test/test_spot_prices_per_new_facility.py -test/test_spot_prices_report.py -test/test_ssh_key.py -test/test_ssh_key_create_input.py -test/test_ssh_key_input.py -test/test_ssh_key_list.py -test/test_ssh_keys_api.py -test/test_storage.py -test/test_support_request_api.py -test/test_support_request_input.py -test/test_transfer_request.py -test/test_transfer_request_input.py -test/test_transfer_request_list.py -test/test_transfer_requests_api.py -test/test_two_factor_auth_api.py -test/test_update_email_input.py -test/test_usages_api.py -test/test_user.py -test/test_user_create_input.py -test/test_user_limited.py -test/test_user_list.py -test/test_user_lite.py -test/test_user_update_input.py -test/test_user_verification_tokens_api.py -test/test_userdata.py -test/test_userdata_api.py -test/test_users_api.py -test/test_verify_email.py -test/test_virtual_circuit.py -test/test_virtual_circuit_create_input.py -test/test_virtual_circuit_list.py -test/test_virtual_circuit_update_input.py -test/test_virtual_network.py -test/test_virtual_network_create_input.py -test/test_virtual_network_list.py -test/test_vlan_csp_connection_create_input.py -test/test_vlan_csp_connection_create_input_fabric_provider.py -test/test_vlan_fabric_vc_create_input.py -test/test_vlan_virtual_circuit.py -test/test_vlan_virtual_circuit_create_input.py -test/test_vlan_virtual_circuit_update_input.py -test/test_vlans_api.py -test/test_vrf.py -test/test_vrf_create_input.py -test/test_vrf_fabric_vc_create_input.py -test/test_vrf_ip_reservation.py -test/test_vrf_ip_reservation_create_input.py -test/test_vrf_ip_reservation_list.py -test/test_vrf_list.py -test/test_vrf_metal_gateway.py -test/test_vrf_metal_gateway_create_input.py -test/test_vrf_route.py -test/test_vrf_route_create_input.py -test/test_vrf_route_list.py -test/test_vrf_route_update_input.py -test/test_vrf_update_input.py -test/test_vrf_virtual_circuit.py -test/test_vrf_virtual_circuit_create_input.py -test/test_vrf_virtual_circuit_update_input.py -test/test_vrfs_api.py +test/test_vrf_bgp_neighbors.py +test/test_vrf_bgp_neighbors_bgp_neighbors_inner.py +test/test_vrf_learned_routes.py +test/test_vrf_learned_routes_learned_routes_inner.py tox.ini diff --git a/equinix_metal/README.md b/equinix_metal/README.md index f0cde588..b07ef4f6 100644 --- a/equinix_metal/README.md +++ b/equinix_metal/README.md @@ -397,6 +397,8 @@ Class | Method | HTTP request | Description *VRFsApi* | [**find_vrf_route_by_id**](docs/VRFsApi.md#find_vrf_route_by_id) | **GET** /routes/{id} | Retrieve a VRF Route *VRFsApi* | [**find_vrfs**](docs/VRFsApi.md#find_vrfs) | **GET** /projects/{id}/vrfs | Retrieve all VRFs in the project *VRFsApi* | [**get_bgp_dynamic_neighbors**](docs/VRFsApi.md#get_bgp_dynamic_neighbors) | **GET** /metal-gateways/{id}/bgp-dynamic-neighbors | List BGP Dynamic Neighbors +*VRFsApi* | [**get_vrf_bgp_neighbors**](docs/VRFsApi.md#get_vrf_bgp_neighbors) | **GET** /vrfs/{id}/bgp-neighbors | Retreive BGP neighbor states for the VRF +*VRFsApi* | [**get_vrf_learned_routes**](docs/VRFsApi.md#get_vrf_learned_routes) | **GET** /vrfs/{id}/learned-routes | Retreive learned L3 routes within the VRF *VRFsApi* | [**get_vrf_routes**](docs/VRFsApi.md#get_vrf_routes) | **GET** /vrfs/{id}/routes | Retrieve all routes in the VRF *VRFsApi* | [**update_vrf**](docs/VRFsApi.md#update_vrf) | **PUT** /vrfs/{id} | Update the VRF *VRFsApi* | [**update_vrf_route_by_id**](docs/VRFsApi.md#update_vrf_route_by_id) | **PUT** /routes/{id} | Update a VRF Route @@ -637,11 +639,15 @@ Class | Method | HTTP request | Description - [VlanVirtualCircuitCreateInput](docs/VlanVirtualCircuitCreateInput.md) - [VlanVirtualCircuitUpdateInput](docs/VlanVirtualCircuitUpdateInput.md) - [Vrf](docs/Vrf.md) + - [VrfBGPNeighbors](docs/VrfBGPNeighbors.md) + - [VrfBGPNeighborsBgpNeighborsInner](docs/VrfBGPNeighborsBgpNeighborsInner.md) - [VrfCreateInput](docs/VrfCreateInput.md) - [VrfFabricVcCreateInput](docs/VrfFabricVcCreateInput.md) - [VrfIpReservation](docs/VrfIpReservation.md) - [VrfIpReservationCreateInput](docs/VrfIpReservationCreateInput.md) - [VrfIpReservationList](docs/VrfIpReservationList.md) + - [VrfLearnedRoutes](docs/VrfLearnedRoutes.md) + - [VrfLearnedRoutesLearnedRoutesInner](docs/VrfLearnedRoutesLearnedRoutesInner.md) - [VrfList](docs/VrfList.md) - [VrfMetalGateway](docs/VrfMetalGateway.md) - [VrfMetalGatewayCreateInput](docs/VrfMetalGatewayCreateInput.md) diff --git a/equinix_metal/docs/AuthTokenProject.md b/equinix_metal/docs/AuthTokenProject.md index 5d6aeead..47556a91 100644 --- a/equinix_metal/docs/AuthTokenProject.md +++ b/equinix_metal/docs/AuthTokenProject.md @@ -24,6 +24,7 @@ Name | Type | Description | Notes **tags** | **List[str]** | | [optional] **type** | **str** | The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. | [optional] **updated_at** | **datetime** | | [optional] +**url** | **str** | | [optional] **volumes** | [**List[Href]**](Href.md) | | [optional] ## Example diff --git a/equinix_metal/docs/CreateDeviceRequest.md b/equinix_metal/docs/CreateDeviceRequest.md index c2aa712f..3ba37dce 100644 --- a/equinix_metal/docs/CreateDeviceRequest.md +++ b/equinix_metal/docs/CreateDeviceRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **href** | **str** | | [optional] -**metro** | **str** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**metro** | **str** | Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. | **always_pxe** | **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] **billing_cycle** | **str** | The billing cycle of the device. | [optional] **customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] diff --git a/equinix_metal/docs/CreateOrganizationInterconnectionRequest.md b/equinix_metal/docs/CreateOrganizationInterconnectionRequest.md index abd0c22a..7148363c 100644 --- a/equinix_metal/docs/CreateOrganizationInterconnectionRequest.md +++ b/equinix_metal/docs/CreateOrganizationInterconnectionRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **billing_account_name** | **str** | The billing account name of the Equinix Fabric account. | [optional] **contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] **description** | **str** | | [optional] +**facility_id** | **str** | | [optional] **href** | **str** | | [optional] **metro** | **str** | A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | **mode** | **str** | The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. | [optional] diff --git a/equinix_metal/docs/DedicatedPortCreateInput.md b/equinix_metal/docs/DedicatedPortCreateInput.md index 7fb8e850..decb160b 100644 --- a/equinix_metal/docs/DedicatedPortCreateInput.md +++ b/equinix_metal/docs/DedicatedPortCreateInput.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **billing_account_name** | **str** | The billing account name of the Equinix Fabric account. | [optional] **contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] **description** | **str** | | [optional] +**facility_id** | **str** | | [optional] **href** | **str** | | [optional] **metro** | **str** | A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. | **mode** | **str** | The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. | [optional] diff --git a/equinix_metal/docs/DeviceCreateInMetroInput.md b/equinix_metal/docs/DeviceCreateInMetroInput.md index 787d52a3..bb7872f1 100644 --- a/equinix_metal/docs/DeviceCreateInMetroInput.md +++ b/equinix_metal/docs/DeviceCreateInMetroInput.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **href** | **str** | | [optional] -**metro** | **str** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**metro** | **str** | Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. | **always_pxe** | **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] **billing_cycle** | **str** | The billing cycle of the device. | [optional] **customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] diff --git a/equinix_metal/docs/InstancesBatchCreateInputBatchesInner.md b/equinix_metal/docs/InstancesBatchCreateInputBatchesInner.md index 2a9288e1..49c59c5e 100644 --- a/equinix_metal/docs/InstancesBatchCreateInputBatchesInner.md +++ b/equinix_metal/docs/InstancesBatchCreateInputBatchesInner.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **hostnames** | **List[str]** | | [optional] **quantity** | **int** | The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. | [optional] **href** | **str** | | [optional] -**metro** | **str** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**metro** | **str** | Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. | **always_pxe** | **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] **billing_cycle** | **str** | The billing cycle of the device. | [optional] **customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] diff --git a/equinix_metal/docs/Interconnection.md b/equinix_metal/docs/Interconnection.md index d3b950ce..832ad39a 100644 --- a/equinix_metal/docs/Interconnection.md +++ b/equinix_metal/docs/Interconnection.md @@ -9,14 +9,15 @@ Name | Type | Description | Notes **contact_email** | **str** | | [optional] **created_at** | **datetime** | | [optional] **description** | **str** | | [optional] -**facility** | [**Href**](Href.md) | | [optional] +**facility** | [**Facility**](Facility.md) | | [optional] **href** | **str** | | [optional] **id** | **str** | | [optional] **metro** | [**Metro**](Metro.md) | The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | [optional] **mode** | **str** | The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. | [optional] **name** | **str** | | [optional] -**organization** | [**Href**](Href.md) | | [optional] +**organization** | [**Organization**](Organization.md) | | [optional] **ports** | [**List[InterconnectionPort]**](InterconnectionPort.md) | For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). | [optional] +**project** | [**Project**](Project.md) | | [optional] **redundancy** | **str** | Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. | [optional] **requested_by** | [**Href**](Href.md) | | [optional] **service_tokens** | [**List[FabricServiceToken]**](FabricServiceToken.md) | For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. | [optional] diff --git a/equinix_metal/docs/MetroInput.md b/equinix_metal/docs/MetroInput.md index 93d6b3a5..a950a99c 100644 --- a/equinix_metal/docs/MetroInput.md +++ b/equinix_metal/docs/MetroInput.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **href** | **str** | | [optional] -**metro** | **str** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**metro** | **str** | Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. | ## Example diff --git a/equinix_metal/docs/Port.md b/equinix_metal/docs/Port.md index fc2a84bf..98973918 100644 --- a/equinix_metal/docs/Port.md +++ b/equinix_metal/docs/Port.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **native_virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] **network_type** | **str** | Composite network type of the bond | [optional] **type** | **str** | Type is either \"NetworkBondPort\" for bond ports or \"NetworkPort\" for bondable ethernet ports | [optional] -**virtual_networks** | [**List[Href]**](Href.md) | | [optional] +**virtual_networks** | [**List[VirtualNetwork]**](VirtualNetwork.md) | | [optional] ## Example diff --git a/equinix_metal/docs/Project.md b/equinix_metal/docs/Project.md index 4bf1667f..8a618840 100644 --- a/equinix_metal/docs/Project.md +++ b/equinix_metal/docs/Project.md @@ -24,6 +24,7 @@ Name | Type | Description | Notes **tags** | **List[str]** | | [optional] **type** | **str** | The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. | [optional] **updated_at** | **datetime** | | [optional] +**url** | **str** | | [optional] **volumes** | [**List[Href]**](Href.md) | | [optional] ## Example diff --git a/equinix_metal/docs/VRFsApi.md b/equinix_metal/docs/VRFsApi.md index 59a7eab1..8c324881 100644 --- a/equinix_metal/docs/VRFsApi.md +++ b/equinix_metal/docs/VRFsApi.md @@ -17,6 +17,8 @@ Method | HTTP request | Description [**find_vrf_route_by_id**](VRFsApi.md#find_vrf_route_by_id) | **GET** /routes/{id} | Retrieve a VRF Route [**find_vrfs**](VRFsApi.md#find_vrfs) | **GET** /projects/{id}/vrfs | Retrieve all VRFs in the project [**get_bgp_dynamic_neighbors**](VRFsApi.md#get_bgp_dynamic_neighbors) | **GET** /metal-gateways/{id}/bgp-dynamic-neighbors | List BGP Dynamic Neighbors +[**get_vrf_bgp_neighbors**](VRFsApi.md#get_vrf_bgp_neighbors) | **GET** /vrfs/{id}/bgp-neighbors | Retreive BGP neighbor states for the VRF +[**get_vrf_learned_routes**](VRFsApi.md#get_vrf_learned_routes) | **GET** /vrfs/{id}/learned-routes | Retreive learned L3 routes within the VRF [**get_vrf_routes**](VRFsApi.md#get_vrf_routes) | **GET** /vrfs/{id}/routes | Retrieve all routes in the VRF [**update_vrf**](VRFsApi.md#update_vrf) | **PUT** /vrfs/{id} | Update the VRF [**update_vrf_route_by_id**](VRFsApi.md#update_vrf_route_by_id) | **PUT** /routes/{id} | Update a VRF Route @@ -1128,6 +1130,166 @@ Name | Type | Description | Notes **401** | Unauthorized | - | **404** | Not Found | - | +[[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) +# **get_vrf_bgp_neighbors** +> VrfBGPNeighbors get_vrf_bgp_neighbors(id) + +Retreive BGP neighbor states for the VRF + +Provides BGP peering information such as the IP and state of the neighbor. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix_metal +from equinix_metal.models.vrf_bgp_neighbors import VrfBGPNeighbors +from equinix_metal.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix_metal.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix_metal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix_metal.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + + try: + # Retreive BGP neighbor states for the VRF + api_response = api_instance.get_vrf_bgp_neighbors(id) + print("The response of VRFsApi->get_vrf_bgp_neighbors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->get_vrf_bgp_neighbors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + +### Return type + +[**VrfBGPNeighbors**](VrfBGPNeighbors.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[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) +# **get_vrf_learned_routes** +> VrfLearnedRoutes get_vrf_learned_routes(id) + +Retreive learned L3 routes within the VRF + +Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix_metal +from equinix_metal.models.vrf_learned_routes import VrfLearnedRoutes +from equinix_metal.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix_metal.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix_metal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix_metal.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + + try: + # Retreive learned L3 routes within the VRF + api_response = api_instance.get_vrf_learned_routes(id) + print("The response of VRFsApi->get_vrf_learned_routes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->get_vrf_learned_routes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + +### Return type + +[**VrfLearnedRoutes**](VrfLearnedRoutes.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + [[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) # **get_vrf_routes** > VrfRouteList get_vrf_routes(id, include=include, exclude=exclude) diff --git a/equinix_metal/docs/VirtualCircuit.md b/equinix_metal/docs/VirtualCircuit.md index 531230fc..40454fd2 100644 --- a/equinix_metal/docs/VirtualCircuit.md +++ b/equinix_metal/docs/VirtualCircuit.md @@ -13,8 +13,8 @@ Name | Type | Description | Notes **id** | **str** | | [optional] **name** | **str** | | [optional] **nni_vlan** | **int** | | [optional] -**port** | [**Href**](Href.md) | | [optional] -**project** | [**Href**](Href.md) | | [optional] +**port** | [**InterconnectionPort**](InterconnectionPort.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] **speed** | **int** | integer representing bps speed | [optional] **status** | **str** | The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated. | [optional] **tags** | **List[str]** | | [optional] diff --git a/equinix_metal/docs/VirtualNetwork.md b/equinix_metal/docs/VirtualNetwork.md index 0ed7c51d..a72af61e 100644 --- a/equinix_metal/docs/VirtualNetwork.md +++ b/equinix_metal/docs/VirtualNetwork.md @@ -5,15 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**assigned_to** | [**Href**](Href.md) | | [optional] +**assigned_to** | [**Project**](Project.md) | | [optional] **assigned_to_virtual_circuit** | **bool** | True if the virtual network is attached to a virtual circuit. False if not. | [optional] +**created_at** | **datetime** | | [optional] **description** | **str** | | [optional] **facility** | [**Href**](Href.md) | | [optional] **href** | **str** | | [optional] **id** | **str** | | [optional] -**instances** | [**List[Href]**](Href.md) | A list of instances with ports currently associated to this Virtual Network. | [optional] +**instances** | [**List[Device]**](Device.md) | A list of instances with ports currently associated to this Virtual Network. | [optional] **metal_gateways** | [**List[MetalGatewayLite]**](MetalGatewayLite.md) | A list of metal gateways currently associated to this Virtual Network. | [optional] -**metro** | [**Href**](Href.md) | | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] **metro_code** | **str** | The Metro code of the metro in which this Virtual Network is defined. | [optional] **tags** | **List[str]** | | [optional] **vxlan** | **int** | | [optional] diff --git a/equinix_metal/docs/VlanFabricVcCreateInput.md b/equinix_metal/docs/VlanFabricVcCreateInput.md index 9689a57e..dbc21b92 100644 --- a/equinix_metal/docs/VlanFabricVcCreateInput.md +++ b/equinix_metal/docs/VlanFabricVcCreateInput.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] **description** | **str** | | [optional] +**facility_id** | **str** | | [optional] **href** | **str** | | [optional] **metro** | **str** | A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | **name** | **str** | | @@ -16,7 +17,7 @@ Name | Type | Description | Notes **speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] **tags** | **List[str]** | | [optional] **type** | **str** | When requesting for a Fabric VC, the value of this field should be 'shared'. | -**vlans** | **List[int]** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | [optional] +**vlans** | **List[int]** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | ## Example diff --git a/equinix_metal/docs/VlanVirtualCircuit.md b/equinix_metal/docs/VlanVirtualCircuit.md index e53e9af1..c27d1074 100644 --- a/equinix_metal/docs/VlanVirtualCircuit.md +++ b/equinix_metal/docs/VlanVirtualCircuit.md @@ -13,8 +13,8 @@ Name | Type | Description | Notes **id** | **str** | | [optional] **name** | **str** | | [optional] **nni_vlan** | **int** | | [optional] -**port** | [**Href**](Href.md) | | [optional] -**project** | [**Href**](Href.md) | | [optional] +**port** | [**InterconnectionPort**](InterconnectionPort.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] **speed** | **int** | For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | [optional] **status** | **str** | The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric. | [optional] **tags** | **List[str]** | | [optional] diff --git a/equinix_metal/docs/VrfBGPNeighbors.md b/equinix_metal/docs/VrfBGPNeighbors.md new file mode 100644 index 00000000..01efcbae --- /dev/null +++ b/equinix_metal/docs/VrfBGPNeighbors.md @@ -0,0 +1,30 @@ +# VrfBGPNeighbors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_neighbors** | [**List[VrfBGPNeighborsBgpNeighborsInner]**](VrfBGPNeighborsBgpNeighborsInner.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix_metal.models.vrf_bgp_neighbors import VrfBGPNeighbors + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfBGPNeighbors from a JSON string +vrf_bgp_neighbors_instance = VrfBGPNeighbors.from_json(json) +# print the JSON string representation of the object +print(VrfBGPNeighbors.to_json()) + +# convert the object into a dict +vrf_bgp_neighbors_dict = vrf_bgp_neighbors_instance.to_dict() +# create an instance of VrfBGPNeighbors from a dict +vrf_bgp_neighbors_form_dict = vrf_bgp_neighbors.from_dict(vrf_bgp_neighbors_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/equinix_metal/docs/VrfBGPNeighborsBgpNeighborsInner.md b/equinix_metal/docs/VrfBGPNeighborsBgpNeighborsInner.md new file mode 100644 index 00000000..f29eba20 --- /dev/null +++ b/equinix_metal/docs/VrfBGPNeighborsBgpNeighborsInner.md @@ -0,0 +1,31 @@ +# VrfBGPNeighborsBgpNeighborsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**peer_as** | **int** | The ASN of the peer that advertised the prefix. | [optional] +**peer_ip** | **str** | | [optional] +**state** | **str** | The current status of the connection to the BGP peer. State is either up or down. | [optional] + +## Example + +```python +from equinix_metal.models.vrf_bgp_neighbors_bgp_neighbors_inner import VrfBGPNeighborsBgpNeighborsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfBGPNeighborsBgpNeighborsInner from a JSON string +vrf_bgp_neighbors_bgp_neighbors_inner_instance = VrfBGPNeighborsBgpNeighborsInner.from_json(json) +# print the JSON string representation of the object +print(VrfBGPNeighborsBgpNeighborsInner.to_json()) + +# convert the object into a dict +vrf_bgp_neighbors_bgp_neighbors_inner_dict = vrf_bgp_neighbors_bgp_neighbors_inner_instance.to_dict() +# create an instance of VrfBGPNeighborsBgpNeighborsInner from a dict +vrf_bgp_neighbors_bgp_neighbors_inner_form_dict = vrf_bgp_neighbors_bgp_neighbors_inner.from_dict(vrf_bgp_neighbors_bgp_neighbors_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/equinix_metal/docs/VrfFabricVcCreateInput.md b/equinix_metal/docs/VrfFabricVcCreateInput.md index 0effb1ca..61b47e82 100644 --- a/equinix_metal/docs/VrfFabricVcCreateInput.md +++ b/equinix_metal/docs/VrfFabricVcCreateInput.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] **description** | **str** | | [optional] +**facility_id** | **str** | | [optional] **href** | **str** | | [optional] **metro** | **str** | A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | **name** | **str** | | diff --git a/equinix_metal/docs/VrfLearnedRoutes.md b/equinix_metal/docs/VrfLearnedRoutes.md new file mode 100644 index 00000000..a7ce4efe --- /dev/null +++ b/equinix_metal/docs/VrfLearnedRoutes.md @@ -0,0 +1,30 @@ +# VrfLearnedRoutes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**learned_routes** | [**List[VrfLearnedRoutesLearnedRoutesInner]**](VrfLearnedRoutesLearnedRoutesInner.md) | | [optional] + +## Example + +```python +from equinix_metal.models.vrf_learned_routes import VrfLearnedRoutes + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfLearnedRoutes from a JSON string +vrf_learned_routes_instance = VrfLearnedRoutes.from_json(json) +# print the JSON string representation of the object +print(VrfLearnedRoutes.to_json()) + +# convert the object into a dict +vrf_learned_routes_dict = vrf_learned_routes_instance.to_dict() +# create an instance of VrfLearnedRoutes from a dict +vrf_learned_routes_form_dict = vrf_learned_routes.from_dict(vrf_learned_routes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/equinix_metal/docs/VrfLearnedRoutesLearnedRoutesInner.md b/equinix_metal/docs/VrfLearnedRoutesLearnedRoutesInner.md new file mode 100644 index 00000000..6d535ac3 --- /dev/null +++ b/equinix_metal/docs/VrfLearnedRoutesLearnedRoutesInner.md @@ -0,0 +1,30 @@ +# VrfLearnedRoutesLearnedRoutesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**origin_as** | **int** | The ASN of the peer that advertised the prefix. | [optional] +**prefix** | **str** | | [optional] + +## Example + +```python +from equinix_metal.models.vrf_learned_routes_learned_routes_inner import VrfLearnedRoutesLearnedRoutesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfLearnedRoutesLearnedRoutesInner from a JSON string +vrf_learned_routes_learned_routes_inner_instance = VrfLearnedRoutesLearnedRoutesInner.from_json(json) +# print the JSON string representation of the object +print(VrfLearnedRoutesLearnedRoutesInner.to_json()) + +# convert the object into a dict +vrf_learned_routes_learned_routes_inner_dict = vrf_learned_routes_learned_routes_inner_instance.to_dict() +# create an instance of VrfLearnedRoutesLearnedRoutesInner from a dict +vrf_learned_routes_learned_routes_inner_form_dict = vrf_learned_routes_learned_routes_inner.from_dict(vrf_learned_routes_learned_routes_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/equinix_metal/docs/VrfVirtualCircuit.md b/equinix_metal/docs/VrfVirtualCircuit.md index ef6041e9..8d96c4de 100644 --- a/equinix_metal/docs/VrfVirtualCircuit.md +++ b/equinix_metal/docs/VrfVirtualCircuit.md @@ -15,8 +15,8 @@ Name | Type | Description | Notes **name** | **str** | | [optional] **nni_vlan** | **int** | | [optional] **peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] -**port** | [**Href**](Href.md) | | [optional] -**project** | [**Href**](Href.md) | | [optional] +**port** | [**InterconnectionPort**](InterconnectionPort.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] **speed** | **int** | integer representing bps speed | [optional] **status** | **str** | The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated. | [optional] **subnet** | **str** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] diff --git a/equinix_metal/equinix_metal/__init__.py b/equinix_metal/equinix_metal/__init__.py index 256d3124..3f228470 100644 --- a/equinix_metal/equinix_metal/__init__.py +++ b/equinix_metal/equinix_metal/__init__.py @@ -304,11 +304,15 @@ from equinix_metal.models.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput from equinix_metal.models.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput from equinix_metal.models.vrf import Vrf +from equinix_metal.models.vrf_bgp_neighbors import VrfBGPNeighbors +from equinix_metal.models.vrf_bgp_neighbors_bgp_neighbors_inner import VrfBGPNeighborsBgpNeighborsInner from equinix_metal.models.vrf_create_input import VrfCreateInput from equinix_metal.models.vrf_fabric_vc_create_input import VrfFabricVcCreateInput from equinix_metal.models.vrf_ip_reservation import VrfIpReservation from equinix_metal.models.vrf_ip_reservation_create_input import VrfIpReservationCreateInput from equinix_metal.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix_metal.models.vrf_learned_routes import VrfLearnedRoutes +from equinix_metal.models.vrf_learned_routes_learned_routes_inner import VrfLearnedRoutesLearnedRoutesInner from equinix_metal.models.vrf_list import VrfList from equinix_metal.models.vrf_metal_gateway import VrfMetalGateway from equinix_metal.models.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput diff --git a/equinix_metal/equinix_metal/api/vrfs_api.py b/equinix_metal/equinix_metal/api/vrfs_api.py index 98fd38fd..d9a2e353 100644 --- a/equinix_metal/equinix_metal/api/vrfs_api.py +++ b/equinix_metal/equinix_metal/api/vrfs_api.py @@ -24,9 +24,11 @@ from equinix_metal.models.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput from equinix_metal.models.bgp_dynamic_neighbor_list import BgpDynamicNeighborList from equinix_metal.models.vrf import Vrf +from equinix_metal.models.vrf_bgp_neighbors import VrfBGPNeighbors from equinix_metal.models.vrf_create_input import VrfCreateInput from equinix_metal.models.vrf_ip_reservation import VrfIpReservation from equinix_metal.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix_metal.models.vrf_learned_routes import VrfLearnedRoutes from equinix_metal.models.vrf_list import VrfList from equinix_metal.models.vrf_route import VrfRoute from equinix_metal.models.vrf_route_create_input import VrfRouteCreateInput @@ -4031,6 +4033,530 @@ def _get_bgp_dynamic_neighbors_serialize( ) + @validate_call + def get_vrf_bgp_neighbors( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfBGPNeighbors: + """Retreive BGP neighbor states for the VRF + + Provides BGP peering information such as the IP and state of the neighbor. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_bgp_neighbors_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfBGPNeighbors", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_vrf_bgp_neighbors_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfBGPNeighbors]: + """Retreive BGP neighbor states for the VRF + + Provides BGP peering information such as the IP and state of the neighbor. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_bgp_neighbors_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfBGPNeighbors", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_vrf_bgp_neighbors_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retreive BGP neighbor states for the VRF + + Provides BGP peering information such as the IP and state of the neighbor. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_bgp_neighbors_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfBGPNeighbors", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vrf_bgp_neighbors_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}/bgp-neighbors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_vrf_learned_routes( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfLearnedRoutes: + """Retreive learned L3 routes within the VRF + + Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_learned_routes_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfLearnedRoutes", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_vrf_learned_routes_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfLearnedRoutes]: + """Retreive learned L3 routes within the VRF + + Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_learned_routes_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfLearnedRoutes", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_vrf_learned_routes_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retreive learned L3 routes within the VRF + + Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_learned_routes_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfLearnedRoutes", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vrf_learned_routes_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}/learned-routes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + @validate_call def get_vrf_routes( self, diff --git a/equinix_metal/equinix_metal/models/__init__.py b/equinix_metal/equinix_metal/models/__init__.py index 68d0c2e2..6ff37974 100644 --- a/equinix_metal/equinix_metal/models/__init__.py +++ b/equinix_metal/equinix_metal/models/__init__.py @@ -248,11 +248,15 @@ from equinix_metal.models.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput from equinix_metal.models.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput from equinix_metal.models.vrf import Vrf +from equinix_metal.models.vrf_bgp_neighbors import VrfBGPNeighbors +from equinix_metal.models.vrf_bgp_neighbors_bgp_neighbors_inner import VrfBGPNeighborsBgpNeighborsInner from equinix_metal.models.vrf_create_input import VrfCreateInput from equinix_metal.models.vrf_fabric_vc_create_input import VrfFabricVcCreateInput from equinix_metal.models.vrf_ip_reservation import VrfIpReservation from equinix_metal.models.vrf_ip_reservation_create_input import VrfIpReservationCreateInput from equinix_metal.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix_metal.models.vrf_learned_routes import VrfLearnedRoutes +from equinix_metal.models.vrf_learned_routes_learned_routes_inner import VrfLearnedRoutesLearnedRoutesInner from equinix_metal.models.vrf_list import VrfList from equinix_metal.models.vrf_metal_gateway import VrfMetalGateway from equinix_metal.models.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput diff --git a/equinix_metal/equinix_metal/models/auth_token_project.py b/equinix_metal/equinix_metal/models/auth_token_project.py index e131e08a..f4a1394b 100644 --- a/equinix_metal/equinix_metal/models/auth_token_project.py +++ b/equinix_metal/equinix_metal/models/auth_token_project.py @@ -49,8 +49,9 @@ class AuthTokenProject(BaseModel): tags: Optional[List[StrictStr]] = None type: Optional[StrictStr] = Field(default=None, description="The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers.") updated_at: Optional[datetime] = None + url: Optional[StrictStr] = None volumes: Optional[List[Href]] = None - __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "bgp_config", "created_at", "customdata", "devices", "href", "id", "invitations", "max_devices", "members", "memberships", "name", "network_status", "organization", "payment_method", "ssh_keys", "tags", "type", "updated_at", "volumes"] + __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "bgp_config", "created_at", "customdata", "devices", "href", "id", "invitations", "max_devices", "members", "memberships", "name", "network_status", "organization", "payment_method", "ssh_keys", "tags", "type", "updated_at", "url", "volumes"] @field_validator('type') def type_validate_enum(cls, value): @@ -183,6 +184,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "tags": obj.get("tags"), "type": obj.get("type"), "updated_at": obj.get("updated_at"), + "url": obj.get("url"), "volumes": [Href.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None }) return _obj diff --git a/equinix_metal/equinix_metal/models/bgp_config.py b/equinix_metal/equinix_metal/models/bgp_config.py index 8cfcf755..55a611bd 100644 --- a/equinix_metal/equinix_metal/models/bgp_config.py +++ b/equinix_metal/equinix_metal/models/bgp_config.py @@ -21,6 +21,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from equinix_metal.models.bgp_session import BgpSession from equinix_metal.models.global_bgp_range import GlobalBgpRange from equinix_metal.models.href import Href @@ -31,7 +32,7 @@ class BgpConfig(BaseModel): """ BgpConfig """ # noqa: E501 - asn: Optional[StrictInt] = Field(default=None, description="Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned.") + asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned.") created_at: Optional[datetime] = None deployment_type: Optional[StrictStr] = Field(default=None, description="In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. ") href: Optional[StrictStr] = None diff --git a/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor.py b/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor.py index ec21c425..942c4780 100644 --- a/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor.py +++ b/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor.py @@ -19,8 +19,9 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from equinix_metal.models.user_limited import UserLimited from equinix_metal.models.vrf_metal_gateway import VrfMetalGateway from typing import Optional, Set @@ -30,7 +31,7 @@ class BgpDynamicNeighbor(BaseModel): """ BgpDynamicNeighbor """ # noqa: E501 - bgp_neighbor_asn: Optional[StrictInt] = Field(default=None, description="The ASN of the dynamic BGP neighbor") + bgp_neighbor_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The ASN of the dynamic BGP neighbor") bgp_neighbor_range: Optional[StrictStr] = Field(default=None, description="Network range of the dynamic BGP neighbor in CIDR format") created_at: Optional[datetime] = None created_by: Optional[UserLimited] = None diff --git a/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor_create_input.py b/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor_create_input.py index d680ca44..362b08c0 100644 --- a/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor_create_input.py +++ b/equinix_metal/equinix_metal/models/bgp_dynamic_neighbor_create_input.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -27,7 +28,7 @@ class BgpDynamicNeighborCreateInput(BaseModel): """ BgpDynamicNeighborCreateInput """ # noqa: E501 - bgp_neighbor_asn: StrictInt = Field(description="The ASN of the dynamic BGP neighbor") + bgp_neighbor_asn: Annotated[int, Field(le=4294967295, strict=True, ge=0)] = Field(description="The ASN of the dynamic BGP neighbor") bgp_neighbor_range: StrictStr = Field(description="Network range of the dynamic BGP neighbor in CIDR format") href: Optional[StrictStr] = None tags: Optional[List[StrictStr]] = None diff --git a/equinix_metal/equinix_metal/models/dedicated_port_create_input.py b/equinix_metal/equinix_metal/models/dedicated_port_create_input.py index 06508473..a26cbac0 100644 --- a/equinix_metal/equinix_metal/models/dedicated_port_create_input.py +++ b/equinix_metal/equinix_metal/models/dedicated_port_create_input.py @@ -30,6 +30,7 @@ class DedicatedPortCreateInput(BaseModel): billing_account_name: Optional[StrictStr] = Field(default=None, description="The billing account name of the Equinix Fabric account.") contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key.") description: Optional[StrictStr] = None + facility_id: Optional[StrictStr] = None href: Optional[StrictStr] = None metro: StrictStr = Field(description="A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports.") mode: Optional[StrictStr] = Field(default=None, description="The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances.") @@ -40,7 +41,7 @@ class DedicatedPortCreateInput(BaseModel): tags: Optional[List[StrictStr]] = None type: StrictStr = Field(description="When requesting for a dedicated port, the value of this field should be 'dedicated'.") use_case: Optional[StrictStr] = Field(default=None, description="The intended use case of the dedicated port.") - __properties: ClassVar[List[str]] = ["billing_account_name", "contact_email", "description", "href", "metro", "mode", "name", "project", "redundancy", "speed", "tags", "type", "use_case"] + __properties: ClassVar[List[str]] = ["billing_account_name", "contact_email", "description", "facility_id", "href", "metro", "mode", "name", "project", "redundancy", "speed", "tags", "type", "use_case"] @field_validator('mode') def mode_validate_enum(cls, value): @@ -113,6 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "billing_account_name": obj.get("billing_account_name"), "contact_email": obj.get("contact_email"), "description": obj.get("description"), + "facility_id": obj.get("facility_id"), "href": obj.get("href"), "metro": obj.get("metro"), "mode": obj.get("mode"), diff --git a/equinix_metal/equinix_metal/models/device.py b/equinix_metal/equinix_metal/models/device.py index ec4d1437..a3fc922d 100644 --- a/equinix_metal/equinix_metal/models/device.py +++ b/equinix_metal/equinix_metal/models/device.py @@ -31,7 +31,6 @@ from equinix_metal.models.ip_assignment import IPAssignment from equinix_metal.models.operating_system import OperatingSystem from equinix_metal.models.plan import Plan -from equinix_metal.models.port import Port from equinix_metal.models.project import Project from equinix_metal.models.storage import Storage from typing import Optional, Set @@ -263,6 +262,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return _obj from equinix_metal.models.hardware_reservation import HardwareReservation +from equinix_metal.models.port import Port # TODO: Rewrite to not use raise_errors Device.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/device_create_in_metro_input.py b/equinix_metal/equinix_metal/models/device_create_in_metro_input.py index 5ac8be68..221df3c9 100644 --- a/equinix_metal/equinix_metal/models/device_create_in_metro_input.py +++ b/equinix_metal/equinix_metal/models/device_create_in_metro_input.py @@ -32,7 +32,7 @@ class DeviceCreateInMetroInput(BaseModel): DeviceCreateInMetroInput """ # noqa: E501 href: Optional[StrictStr] = None - metro: StrictStr = Field(description="Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided.") + metro: StrictStr = Field(description="Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided.") always_pxe: Optional[StrictBool] = Field(default=None, description="When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot.") billing_cycle: Optional[StrictStr] = Field(default=None, description="The billing cycle of the device.") customdata: Optional[Dict[str, Any]] = Field(default=None, description="Customdata is an arbitrary JSON value that can be accessed via the metadata service.") diff --git a/equinix_metal/equinix_metal/models/instances_batch_create_input_batches_inner.py b/equinix_metal/equinix_metal/models/instances_batch_create_input_batches_inner.py index dc692a47..92a6f216 100644 --- a/equinix_metal/equinix_metal/models/instances_batch_create_input_batches_inner.py +++ b/equinix_metal/equinix_metal/models/instances_batch_create_input_batches_inner.py @@ -35,7 +35,7 @@ class InstancesBatchCreateInputBatchesInner(BaseModel): hostnames: Optional[List[StrictStr]] = None quantity: Optional[StrictInt] = Field(default=None, description="The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on.") href: Optional[StrictStr] = None - metro: StrictStr = Field(description="Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided.") + metro: StrictStr = Field(description="Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided.") always_pxe: Optional[StrictBool] = Field(default=None, description="When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot.") billing_cycle: Optional[StrictStr] = Field(default=None, description="The billing cycle of the device.") customdata: Optional[Dict[str, Any]] = Field(default=None, description="Customdata is an arbitrary JSON value that can be accessed via the metadata service.") diff --git a/equinix_metal/equinix_metal/models/interconnection.py b/equinix_metal/equinix_metal/models/interconnection.py index f138e90c..d4e05702 100644 --- a/equinix_metal/equinix_metal/models/interconnection.py +++ b/equinix_metal/equinix_metal/models/interconnection.py @@ -22,9 +22,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from equinix_metal.models.fabric_service_token import FabricServiceToken +from equinix_metal.models.facility import Facility from equinix_metal.models.href import Href from equinix_metal.models.interconnection_port import InterconnectionPort from equinix_metal.models.metro import Metro +from equinix_metal.models.organization import Organization +from equinix_metal.models.project import Project from typing import Optional, Set from typing_extensions import Self @@ -36,14 +39,15 @@ class Interconnection(BaseModel): contact_email: Optional[StrictStr] = None created_at: Optional[datetime] = None description: Optional[StrictStr] = None - facility: Optional[Href] = None + facility: Optional[Facility] = None href: Optional[StrictStr] = None id: Optional[StrictStr] = None metro: Optional[Metro] = Field(default=None, description="The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here.") mode: Optional[StrictStr] = Field(default=None, description="The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances.") name: Optional[StrictStr] = None - organization: Optional[Href] = None + organization: Optional[Organization] = None ports: Optional[List[InterconnectionPort]] = Field(default=None, description="For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s).") + project: Optional[Project] = None redundancy: Optional[StrictStr] = Field(default=None, description="Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection.") requested_by: Optional[Href] = None service_tokens: Optional[List[FabricServiceToken]] = Field(default=None, description="For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued.") @@ -53,7 +57,7 @@ class Interconnection(BaseModel): token: Optional[StrictStr] = Field(default=None, description="This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated.") type: Optional[StrictStr] = Field(default=None, description="The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. The 'shared_port_vlan' type of interconnection refers to shared connections created without service tokens. The 'shared_port_vlan_to_csp' type of interconnection refers to connections created directly to a supported cloud service provider.") updated_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = ["authorization_code", "contact_email", "created_at", "description", "facility", "href", "id", "metro", "mode", "name", "organization", "ports", "redundancy", "requested_by", "service_tokens", "speed", "status", "tags", "token", "type", "updated_at"] + __properties: ClassVar[List[str]] = ["authorization_code", "contact_email", "created_at", "description", "facility", "href", "id", "metro", "mode", "name", "organization", "ports", "project", "redundancy", "requested_by", "service_tokens", "speed", "status", "tags", "token", "type", "updated_at"] @field_validator('mode') def mode_validate_enum(cls, value): @@ -140,6 +144,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['ports'] = _items + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() # override the default output from pydantic by calling `to_dict()` of requested_by if self.requested_by: _dict['requested_by'] = self.requested_by.to_dict() @@ -166,14 +173,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "contact_email": obj.get("contact_email"), "created_at": obj.get("created_at"), "description": obj.get("description"), - "facility": Href.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "facility": Facility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, "href": obj.get("href"), "id": obj.get("id"), "metro": Metro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, "mode": obj.get("mode"), "name": obj.get("name"), - "organization": Href.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, "ports": [InterconnectionPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, "redundancy": obj.get("redundancy"), "requested_by": Href.from_dict(obj["requested_by"]) if obj.get("requested_by") is not None else None, "service_tokens": [FabricServiceToken.from_dict(_item) for _item in obj["service_tokens"]] if obj.get("service_tokens") is not None else None, diff --git a/equinix_metal/equinix_metal/models/interconnection_port.py b/equinix_metal/equinix_metal/models/interconnection_port.py index a7f6b4bf..74606673 100644 --- a/equinix_metal/equinix_metal/models/interconnection_port.py +++ b/equinix_metal/equinix_metal/models/interconnection_port.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from equinix_metal.models.href import Href -from equinix_metal.models.virtual_circuit import VirtualCircuit from typing import Optional, Set from typing_extensions import Self @@ -135,4 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: }) return _obj +from equinix_metal.models.virtual_circuit import VirtualCircuit +# TODO: Rewrite to not use raise_errors +InterconnectionPort.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/metro_input.py b/equinix_metal/equinix_metal/models/metro_input.py index ea5a8c15..91a50e88 100644 --- a/equinix_metal/equinix_metal/models/metro_input.py +++ b/equinix_metal/equinix_metal/models/metro_input.py @@ -28,7 +28,7 @@ class MetroInput(BaseModel): MetroInput """ # noqa: E501 href: Optional[StrictStr] = None - metro: StrictStr = Field(description="Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided.") + metro: StrictStr = Field(description="Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided.") __properties: ClassVar[List[str]] = ["href", "metro"] model_config = ConfigDict( diff --git a/equinix_metal/equinix_metal/models/port.py b/equinix_metal/equinix_metal/models/port.py index ae9bf38b..648a1b4a 100644 --- a/equinix_metal/equinix_metal/models/port.py +++ b/equinix_metal/equinix_metal/models/port.py @@ -21,9 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from equinix_metal.models.bond_port_data import BondPortData -from equinix_metal.models.href import Href from equinix_metal.models.port_data import PortData -from equinix_metal.models.virtual_network import VirtualNetwork from typing import Optional, Set from typing_extensions import Self @@ -40,7 +38,7 @@ class Port(BaseModel): native_virtual_network: Optional[VirtualNetwork] = None network_type: Optional[StrictStr] = Field(default=None, description="Composite network type of the bond") type: Optional[StrictStr] = Field(default=None, description="Type is either \"NetworkBondPort\" for bond ports or \"NetworkPort\" for bondable ethernet ports") - virtual_networks: Optional[List[Href]] = None + virtual_networks: Optional[List[VirtualNetwork]] = None __properties: ClassVar[List[str]] = ["bond", "data", "disbond_operation_supported", "href", "id", "name", "native_virtual_network", "network_type", "type", "virtual_networks"] @field_validator('network_type') @@ -139,8 +137,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "native_virtual_network": VirtualNetwork.from_dict(obj["native_virtual_network"]) if obj.get("native_virtual_network") is not None else None, "network_type": obj.get("network_type"), "type": obj.get("type"), - "virtual_networks": [Href.from_dict(_item) for _item in obj["virtual_networks"]] if obj.get("virtual_networks") is not None else None + "virtual_networks": [VirtualNetwork.from_dict(_item) for _item in obj["virtual_networks"]] if obj.get("virtual_networks") is not None else None }) return _obj +from equinix_metal.models.virtual_network import VirtualNetwork +# TODO: Rewrite to not use raise_errors +Port.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/project.py b/equinix_metal/equinix_metal/models/project.py index b8e5b8ec..d1b7208e 100644 --- a/equinix_metal/equinix_metal/models/project.py +++ b/equinix_metal/equinix_metal/models/project.py @@ -49,8 +49,9 @@ class Project(BaseModel): tags: Optional[List[StrictStr]] = None type: Optional[StrictStr] = Field(default=None, description="The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers.") updated_at: Optional[datetime] = None + url: Optional[StrictStr] = None volumes: Optional[List[Href]] = None - __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "bgp_config", "created_at", "customdata", "devices", "href", "id", "invitations", "max_devices", "members", "memberships", "name", "network_status", "organization", "payment_method", "ssh_keys", "tags", "type", "updated_at", "volumes"] + __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "bgp_config", "created_at", "customdata", "devices", "href", "id", "invitations", "max_devices", "members", "memberships", "name", "network_status", "organization", "payment_method", "ssh_keys", "tags", "type", "updated_at", "url", "volumes"] @field_validator('type') def type_validate_enum(cls, value): @@ -183,6 +184,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "tags": obj.get("tags"), "type": obj.get("type"), "updated_at": obj.get("updated_at"), + "url": obj.get("url"), "volumes": [Href.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None }) return _obj diff --git a/equinix_metal/equinix_metal/models/virtual_circuit.py b/equinix_metal/equinix_metal/models/virtual_circuit.py index 750ae2c8..a73f5ae1 100644 --- a/equinix_metal/equinix_metal/models/virtual_circuit.py +++ b/equinix_metal/equinix_metal/models/virtual_circuit.py @@ -18,8 +18,6 @@ import pprint from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from equinix_metal.models.vlan_virtual_circuit import VlanVirtualCircuit -from equinix_metal.models.vrf_virtual_circuit import VrfVirtualCircuit from pydantic import StrictStr, Field from typing import Union, List, Optional, Dict from typing_extensions import Literal, Self @@ -135,4 +133,8 @@ def to_str(self) -> str: """Returns the string representation of the actual instance""" return pprint.pformat(self.model_dump()) +from equinix_metal.models.vlan_virtual_circuit import VlanVirtualCircuit +from equinix_metal.models.vrf_virtual_circuit import VrfVirtualCircuit +# TODO: Rewrite to not use raise_errors +VirtualCircuit.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/virtual_network.py b/equinix_metal/equinix_metal/models/virtual_network.py index f7a9e8bc..978149a1 100644 --- a/equinix_metal/equinix_metal/models/virtual_network.py +++ b/equinix_metal/equinix_metal/models/virtual_network.py @@ -18,10 +18,13 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from equinix_metal.models.href import Href from equinix_metal.models.metal_gateway_lite import MetalGatewayLite +from equinix_metal.models.metro import Metro +from equinix_metal.models.project import Project from typing import Optional, Set from typing_extensions import Self @@ -29,19 +32,20 @@ class VirtualNetwork(BaseModel): """ VirtualNetwork """ # noqa: E501 - assigned_to: Optional[Href] = None + assigned_to: Optional[Project] = None assigned_to_virtual_circuit: Optional[StrictBool] = Field(default=None, description="True if the virtual network is attached to a virtual circuit. False if not.") + created_at: Optional[datetime] = None description: Optional[StrictStr] = None facility: Optional[Href] = None href: Optional[StrictStr] = None id: Optional[StrictStr] = None - instances: Optional[List[Href]] = Field(default=None, description="A list of instances with ports currently associated to this Virtual Network.") + instances: Optional[List[Device]] = Field(default=None, description="A list of instances with ports currently associated to this Virtual Network.") metal_gateways: Optional[List[MetalGatewayLite]] = Field(default=None, description="A list of metal gateways currently associated to this Virtual Network.") - metro: Optional[Href] = None + metro: Optional[Metro] = None metro_code: Optional[StrictStr] = Field(default=None, description="The Metro code of the metro in which this Virtual Network is defined.") tags: Optional[List[StrictStr]] = None vxlan: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["assigned_to", "assigned_to_virtual_circuit", "description", "facility", "href", "id", "instances", "metal_gateways", "metro", "metro_code", "tags", "vxlan"] + __properties: ClassVar[List[str]] = ["assigned_to", "assigned_to_virtual_circuit", "created_at", "description", "facility", "href", "id", "instances", "metal_gateways", "metro", "metro_code", "tags", "vxlan"] model_config = ConfigDict( populate_by_name=True, @@ -117,19 +121,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "assigned_to": Href.from_dict(obj["assigned_to"]) if obj.get("assigned_to") is not None else None, + "assigned_to": Project.from_dict(obj["assigned_to"]) if obj.get("assigned_to") is not None else None, "assigned_to_virtual_circuit": obj.get("assigned_to_virtual_circuit"), + "created_at": obj.get("created_at"), "description": obj.get("description"), "facility": Href.from_dict(obj["facility"]) if obj.get("facility") is not None else None, "href": obj.get("href"), "id": obj.get("id"), - "instances": [Href.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, + "instances": [Device.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, "metal_gateways": [MetalGatewayLite.from_dict(_item) for _item in obj["metal_gateways"]] if obj.get("metal_gateways") is not None else None, - "metro": Href.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "metro": Metro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, "metro_code": obj.get("metro_code"), "tags": obj.get("tags"), "vxlan": obj.get("vxlan") }) return _obj +from equinix_metal.models.device import Device +# TODO: Rewrite to not use raise_errors +VirtualNetwork.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/vlan_fabric_vc_create_input.py b/equinix_metal/equinix_metal/models/vlan_fabric_vc_create_input.py index f9673626..630173f5 100644 --- a/equinix_metal/equinix_metal/models/vlan_fabric_vc_create_input.py +++ b/equinix_metal/equinix_metal/models/vlan_fabric_vc_create_input.py @@ -29,6 +29,7 @@ class VlanFabricVcCreateInput(BaseModel): """ # noqa: E501 contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key.") description: Optional[StrictStr] = None + facility_id: Optional[StrictStr] = None href: Optional[StrictStr] = None metro: StrictStr = Field(description="A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here.") name: StrictStr @@ -38,8 +39,8 @@ class VlanFabricVcCreateInput(BaseModel): speed: Optional[StrictStr] = Field(default=None, description="A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs.") tags: Optional[List[StrictStr]] = None type: StrictStr = Field(description="When requesting for a Fabric VC, the value of this field should be 'shared'.") - vlans: Optional[List[StrictInt]] = Field(default=None, description="A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits.") - __properties: ClassVar[List[str]] = ["contact_email", "description", "href", "metro", "name", "project", "redundancy", "service_token_type", "speed", "tags", "type", "vlans"] + vlans: List[StrictInt] = Field(description="A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits.") + __properties: ClassVar[List[str]] = ["contact_email", "description", "facility_id", "href", "metro", "name", "project", "redundancy", "service_token_type", "speed", "tags", "type", "vlans"] @field_validator('service_token_type') def service_token_type_validate_enum(cls, value): @@ -108,6 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "contact_email": obj.get("contact_email"), "description": obj.get("description"), + "facility_id": obj.get("facility_id"), "href": obj.get("href"), "metro": obj.get("metro"), "name": obj.get("name"), diff --git a/equinix_metal/equinix_metal/models/vlan_virtual_circuit.py b/equinix_metal/equinix_metal/models/vlan_virtual_circuit.py index 38b16a11..53dbcc80 100644 --- a/equinix_metal/equinix_metal/models/vlan_virtual_circuit.py +++ b/equinix_metal/equinix_metal/models/vlan_virtual_circuit.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from equinix_metal.models.href import Href +from equinix_metal.models.project import Project from typing import Optional, Set from typing_extensions import Self @@ -37,8 +38,8 @@ class VlanVirtualCircuit(BaseModel): id: Optional[StrictStr] = None name: Optional[StrictStr] = None nni_vlan: Optional[StrictInt] = None - port: Optional[Href] = None - project: Optional[Href] = None + port: Optional[InterconnectionPort] = None + project: Optional[Project] = None speed: Optional[StrictInt] = Field(default=None, description="For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details.") status: Optional[StrictStr] = Field(default=None, description="The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric.") tags: Optional[List[StrictStr]] = None @@ -151,8 +152,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "name": obj.get("name"), "nni_vlan": obj.get("nni_vlan"), - "port": Href.from_dict(obj["port"]) if obj.get("port") is not None else None, - "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "port": InterconnectionPort.from_dict(obj["port"]) if obj.get("port") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, "speed": obj.get("speed"), "status": obj.get("status"), "tags": obj.get("tags"), @@ -163,4 +164,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: }) return _obj +from equinix_metal.models.interconnection_port import InterconnectionPort +# TODO: Rewrite to not use raise_errors +VlanVirtualCircuit.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/vrf.py b/equinix_metal/equinix_metal/models/vrf.py index 94e87497..8954ff31 100644 --- a/equinix_metal/equinix_metal/models/vrf.py +++ b/equinix_metal/equinix_metal/models/vrf.py @@ -19,8 +19,9 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from equinix_metal.models.metro import Metro from equinix_metal.models.project import Project from equinix_metal.models.user import User @@ -41,7 +42,7 @@ class Vrf(BaseModel): href: Optional[StrictStr] = None id: Optional[StrictStr] = None ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"].") - local_asn: Optional[StrictInt] = Field(default=None, description="A 4-byte ASN associated with the VRF.") + local_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="A 4-byte ASN associated with the VRF.") metro: Optional[Metro] = None name: Optional[StrictStr] = None project: Optional[Project] = None diff --git a/equinix_metal/equinix_metal/models/vrf_bgp_neighbors.py b/equinix_metal/equinix_metal/models/vrf_bgp_neighbors.py new file mode 100644 index 00000000..2571ca92 --- /dev/null +++ b/equinix_metal/equinix_metal/models/vrf_bgp_neighbors.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix_metal.models.vrf_bgp_neighbors_bgp_neighbors_inner import VrfBGPNeighborsBgpNeighborsInner +from typing import Optional, Set +from typing_extensions import Self + +class VrfBGPNeighbors(BaseModel): + """ + VrfBGPNeighbors + """ # noqa: E501 + bgp_neighbors: Optional[List[VrfBGPNeighborsBgpNeighborsInner]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bgp_neighbors", "href"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VrfBGPNeighbors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in bgp_neighbors (list) + _items = [] + if self.bgp_neighbors: + for _item in self.bgp_neighbors: + if _item: + _items.append(_item.to_dict()) + _dict['bgp_neighbors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfBGPNeighbors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_neighbors": [VrfBGPNeighborsBgpNeighborsInner.from_dict(_item) for _item in obj["bgp_neighbors"]] if obj.get("bgp_neighbors") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix_metal/equinix_metal/models/vrf_bgp_neighbors_bgp_neighbors_inner.py b/equinix_metal/equinix_metal/models/vrf_bgp_neighbors_bgp_neighbors_inner.py new file mode 100644 index 00000000..0ca9f197 --- /dev/null +++ b/equinix_metal/equinix_metal/models/vrf_bgp_neighbors_bgp_neighbors_inner.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfBGPNeighborsBgpNeighborsInner(BaseModel): + """ + VrfBGPNeighborsBgpNeighborsInner + """ # noqa: E501 + peer_as: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The ASN of the peer that advertised the prefix.") + peer_ip: Optional[StrictStr] = None + state: Optional[StrictStr] = Field(default=None, description="The current status of the connection to the BGP peer. State is either up or down.") + __properties: ClassVar[List[str]] = ["peer_as", "peer_ip", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VrfBGPNeighborsBgpNeighborsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfBGPNeighborsBgpNeighborsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "peer_as": obj.get("peer_as"), + "peer_ip": obj.get("peer_ip"), + "state": obj.get("state") + }) + return _obj + + diff --git a/equinix_metal/equinix_metal/models/vrf_create_input.py b/equinix_metal/equinix_metal/models/vrf_create_input.py index 54b12f89..b10647a5 100644 --- a/equinix_metal/equinix_metal/models/vrf_create_input.py +++ b/equinix_metal/equinix_metal/models/vrf_create_input.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -33,7 +34,7 @@ class VrfCreateInput(BaseModel): description: Optional[StrictStr] = None href: Optional[StrictStr] = None ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits.") - local_asn: Optional[StrictInt] = None + local_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = None metro: StrictStr = Field(description="The UUID (or metro code) for the Metro in which to create this VRF.") name: StrictStr tags: Optional[List[StrictStr]] = None diff --git a/equinix_metal/equinix_metal/models/vrf_fabric_vc_create_input.py b/equinix_metal/equinix_metal/models/vrf_fabric_vc_create_input.py index e4da6b00..80967c3a 100644 --- a/equinix_metal/equinix_metal/models/vrf_fabric_vc_create_input.py +++ b/equinix_metal/equinix_metal/models/vrf_fabric_vc_create_input.py @@ -29,6 +29,7 @@ class VrfFabricVcCreateInput(BaseModel): """ # noqa: E501 contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key.") description: Optional[StrictStr] = None + facility_id: Optional[StrictStr] = None href: Optional[StrictStr] = None metro: StrictStr = Field(description="A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here.") name: StrictStr @@ -39,7 +40,7 @@ class VrfFabricVcCreateInput(BaseModel): tags: Optional[List[StrictStr]] = None type: StrictStr = Field(description="When requesting for a Fabric VC, the value of this field should be 'shared'.") vrfs: List[StrictStr] = Field(description="This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details.") - __properties: ClassVar[List[str]] = ["contact_email", "description", "href", "metro", "name", "project", "redundancy", "service_token_type", "speed", "tags", "type", "vrfs"] + __properties: ClassVar[List[str]] = ["contact_email", "description", "facility_id", "href", "metro", "name", "project", "redundancy", "service_token_type", "speed", "tags", "type", "vrfs"] @field_validator('service_token_type') def service_token_type_validate_enum(cls, value): @@ -108,6 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "contact_email": obj.get("contact_email"), "description": obj.get("description"), + "facility_id": obj.get("facility_id"), "href": obj.get("href"), "metro": obj.get("metro"), "name": obj.get("name"), diff --git a/equinix_metal/equinix_metal/models/vrf_learned_routes.py b/equinix_metal/equinix_metal/models/vrf_learned_routes.py new file mode 100644 index 00000000..e0481153 --- /dev/null +++ b/equinix_metal/equinix_metal/models/vrf_learned_routes.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix_metal.models.vrf_learned_routes_learned_routes_inner import VrfLearnedRoutesLearnedRoutesInner +from typing import Optional, Set +from typing_extensions import Self + +class VrfLearnedRoutes(BaseModel): + """ + VrfLearnedRoutes + """ # noqa: E501 + href: Optional[StrictStr] = None + learned_routes: Optional[List[VrfLearnedRoutesLearnedRoutesInner]] = None + __properties: ClassVar[List[str]] = ["href", "learned_routes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VrfLearnedRoutes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in learned_routes (list) + _items = [] + if self.learned_routes: + for _item in self.learned_routes: + if _item: + _items.append(_item.to_dict()) + _dict['learned_routes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfLearnedRoutes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "learned_routes": [VrfLearnedRoutesLearnedRoutesInner.from_dict(_item) for _item in obj["learned_routes"]] if obj.get("learned_routes") is not None else None + }) + return _obj + + diff --git a/equinix_metal/equinix_metal/models/vrf_learned_routes_learned_routes_inner.py b/equinix_metal/equinix_metal/models/vrf_learned_routes_learned_routes_inner.py new file mode 100644 index 00000000..2ab821a6 --- /dev/null +++ b/equinix_metal/equinix_metal/models/vrf_learned_routes_learned_routes_inner.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfLearnedRoutesLearnedRoutesInner(BaseModel): + """ + VrfLearnedRoutesLearnedRoutesInner + """ # noqa: E501 + origin_as: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The ASN of the peer that advertised the prefix.") + prefix: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["origin_as", "prefix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VrfLearnedRoutesLearnedRoutesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfLearnedRoutesLearnedRoutesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "origin_as": obj.get("origin_as"), + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/equinix_metal/equinix_metal/models/vrf_virtual_circuit.py b/equinix_metal/equinix_metal/models/vrf_virtual_circuit.py index f57fc9c3..6047cb52 100644 --- a/equinix_metal/equinix_metal/models/vrf_virtual_circuit.py +++ b/equinix_metal/equinix_metal/models/vrf_virtual_circuit.py @@ -21,7 +21,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from equinix_metal.models.href import Href +from typing_extensions import Annotated +from equinix_metal.models.project import Project from typing import Optional, Set from typing_extensions import Self @@ -38,9 +39,9 @@ class VrfVirtualCircuit(BaseModel): metal_ip: Optional[StrictStr] = Field(default=None, description="An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used.") name: Optional[StrictStr] = None nni_vlan: Optional[StrictInt] = None - peer_asn: Optional[StrictInt] = Field(default=None, description="The peer ASN that will be used with the VRF on the Virtual Circuit.") - port: Optional[Href] = None - project: Optional[Href] = None + peer_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The peer ASN that will be used with the VRF on the Virtual Circuit.") + port: Optional[InterconnectionPort] = None + project: Optional[Project] = None speed: Optional[StrictInt] = Field(default=None, description="integer representing bps speed") status: Optional[StrictStr] = Field(default=None, description="The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated.") subnet: Optional[StrictStr] = Field(default=None, description="The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP.") @@ -140,8 +141,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "nni_vlan": obj.get("nni_vlan"), "peer_asn": obj.get("peer_asn"), - "port": Href.from_dict(obj["port"]) if obj.get("port") is not None else None, - "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "port": InterconnectionPort.from_dict(obj["port"]) if obj.get("port") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, "speed": obj.get("speed"), "status": obj.get("status"), "subnet": obj.get("subnet"), @@ -152,6 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: }) return _obj +from equinix_metal.models.interconnection_port import InterconnectionPort from equinix_metal.models.vrf import Vrf # TODO: Rewrite to not use raise_errors VrfVirtualCircuit.model_rebuild(raise_errors=False) diff --git a/equinix_metal/equinix_metal/models/vrf_virtual_circuit_create_input.py b/equinix_metal/equinix_metal/models/vrf_virtual_circuit_create_input.py index c830f994..b70757e3 100644 --- a/equinix_metal/equinix_metal/models/vrf_virtual_circuit_create_input.py +++ b/equinix_metal/equinix_metal/models/vrf_virtual_circuit_create_input.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set @@ -35,7 +35,7 @@ class VrfVirtualCircuitCreateInput(BaseModel): metal_ip: Optional[StrictStr] = Field(default=None, description="An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used.") name: Optional[StrictStr] = None nni_vlan: Annotated[int, Field(le=4094, strict=True, ge=2)] - peer_asn: StrictInt = Field(description="The peer ASN that will be used with the VRF on the Virtual Circuit.") + peer_asn: Annotated[int, Field(le=4294967295, strict=True, ge=0)] = Field(description="The peer ASN that will be used with the VRF on the Virtual Circuit.") project_id: StrictStr speed: Optional[StrictStr] = Field(default=None, description="speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps')") subnet: StrictStr = Field(description="The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF.") diff --git a/equinix_metal/equinix_metal/models/vrf_virtual_circuit_update_input.py b/equinix_metal/equinix_metal/models/vrf_virtual_circuit_update_input.py index 73f9d4b0..1acfbcf0 100644 --- a/equinix_metal/equinix_metal/models/vrf_virtual_circuit_update_input.py +++ b/equinix_metal/equinix_metal/models/vrf_virtual_circuit_update_input.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set @@ -34,7 +34,7 @@ class VrfVirtualCircuitUpdateInput(BaseModel): md5: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character ") metal_ip: Optional[StrictStr] = Field(default=None, description="An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used.") name: Optional[StrictStr] = None - peer_asn: Optional[StrictInt] = Field(default=None, description="The peer ASN that will be used with the VRF on the Virtual Circuit.") + peer_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The peer ASN that will be used with the VRF on the Virtual Circuit.") speed: Optional[StrictStr] = Field(default=None, description="Speed can be changed only if it is an interconnection on a Dedicated Port") subnet: Optional[StrictStr] = Field(default=None, description="The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP.") tags: Optional[List[StrictStr]] = None diff --git a/equinix_metal/test/test_vrf_bgp_neighbors.py b/equinix_metal/test/test_vrf_bgp_neighbors.py new file mode 100644 index 00000000..7ea3cdbb --- /dev/null +++ b/equinix_metal/test/test_vrf_bgp_neighbors.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from equinix_metal.models.vrf_bgp_neighbors import VrfBGPNeighbors + +class TestVrfBGPNeighbors(unittest.TestCase): + """VrfBGPNeighbors unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfBGPNeighbors: + """Test VrfBGPNeighbors + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VrfBGPNeighbors` + """ + model = VrfBGPNeighbors() + if include_optional: + return VrfBGPNeighbors( + bgp_neighbors = [ + equinix_metal.models.vrf_bgp_neighbors_bgp_neighbors_inner.VrfBGPNeighbors_bgp_neighbors_inner( + peer_as = 65000, + peer_ip = '8.8.8.8', + state = 'up', ) + ], + href = '' + ) + else: + return VrfBGPNeighbors( + ) + """ + + def testVrfBGPNeighbors(self): + """Test VrfBGPNeighbors""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/equinix_metal/test/test_vrf_bgp_neighbors_bgp_neighbors_inner.py b/equinix_metal/test/test_vrf_bgp_neighbors_bgp_neighbors_inner.py new file mode 100644 index 00000000..3705af9a --- /dev/null +++ b/equinix_metal/test/test_vrf_bgp_neighbors_bgp_neighbors_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from equinix_metal.models.vrf_bgp_neighbors_bgp_neighbors_inner import VrfBGPNeighborsBgpNeighborsInner + +class TestVrfBGPNeighborsBgpNeighborsInner(unittest.TestCase): + """VrfBGPNeighborsBgpNeighborsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfBGPNeighborsBgpNeighborsInner: + """Test VrfBGPNeighborsBgpNeighborsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VrfBGPNeighborsBgpNeighborsInner` + """ + model = VrfBGPNeighborsBgpNeighborsInner() + if include_optional: + return VrfBGPNeighborsBgpNeighborsInner( + peer_as = 65000, + peer_ip = '8.8.8.8', + state = 'up' + ) + else: + return VrfBGPNeighborsBgpNeighborsInner( + ) + """ + + def testVrfBGPNeighborsBgpNeighborsInner(self): + """Test VrfBGPNeighborsBgpNeighborsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/equinix_metal/test/test_vrf_learned_routes.py b/equinix_metal/test/test_vrf_learned_routes.py new file mode 100644 index 00000000..2da6d516 --- /dev/null +++ b/equinix_metal/test/test_vrf_learned_routes.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from equinix_metal.models.vrf_learned_routes import VrfLearnedRoutes + +class TestVrfLearnedRoutes(unittest.TestCase): + """VrfLearnedRoutes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfLearnedRoutes: + """Test VrfLearnedRoutes + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VrfLearnedRoutes` + """ + model = VrfLearnedRoutes() + if include_optional: + return VrfLearnedRoutes( + href = '', + learned_routes = [ + equinix_metal.models.vrf_learned_routes_learned_routes_inner.VrfLearnedRoutes_learned_routes_inner( + origin_as = 65000, + prefix = '8.8.8.0/24', ) + ] + ) + else: + return VrfLearnedRoutes( + ) + """ + + def testVrfLearnedRoutes(self): + """Test VrfLearnedRoutes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/equinix_metal/test/test_vrf_learned_routes_learned_routes_inner.py b/equinix_metal/test/test_vrf_learned_routes_learned_routes_inner.py new file mode 100644 index 00000000..a6d9dd98 --- /dev/null +++ b/equinix_metal/test/test_vrf_learned_routes_learned_routes_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + The version of the OpenAPI document: 1.0.0 + Contact: support@equinixmetal.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from equinix_metal.models.vrf_learned_routes_learned_routes_inner import VrfLearnedRoutesLearnedRoutesInner + +class TestVrfLearnedRoutesLearnedRoutesInner(unittest.TestCase): + """VrfLearnedRoutesLearnedRoutesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfLearnedRoutesLearnedRoutesInner: + """Test VrfLearnedRoutesLearnedRoutesInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VrfLearnedRoutesLearnedRoutesInner` + """ + model = VrfLearnedRoutesLearnedRoutesInner() + if include_optional: + return VrfLearnedRoutesLearnedRoutesInner( + origin_as = 65000, + prefix = '8.8.8.0/24' + ) + else: + return VrfLearnedRoutesLearnedRoutesInner( + ) + """ + + def testVrfLearnedRoutesLearnedRoutesInner(self): + """Test VrfLearnedRoutesLearnedRoutesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/metal_openapi.fixed.yaml b/metal_openapi.fixed.yaml index baf24e2a..bb781888 100644 --- a/metal_openapi.fixed.yaml +++ b/metal_openapi.fixed.yaml @@ -319,7 +319,9 @@ components: description: Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned. example: 65000 - format: int32 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer created_at: format: date-time @@ -385,6 +387,7 @@ components: asn: description: Autonomous System Number for local BGP deployment. example: 65000 + format: int64 maximum: 4294967295 minimum: 0 type: integer @@ -427,6 +430,9 @@ components: bgp_neighbor_asn: description: The ASN of the dynamic BGP neighbor example: 12345 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer bgp_neighbor_range: description: Network range of the dynamic BGP neighbor in CIDR format @@ -472,6 +478,9 @@ components: bgp_neighbor_asn: description: The ASN of the dynamic BGP neighbor example: 12345 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer bgp_neighbor_range: description: Network range of the dynamic BGP neighbor in CIDR format @@ -865,6 +874,9 @@ components: type: string description: type: string + facility_id: + type: string + x-deprecated: true href: format: uri type: string @@ -2337,7 +2349,7 @@ components: description: type: string facility: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Facility' href: format: uri type: string @@ -2374,7 +2386,7 @@ components: name: type: string organization: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Organization' ports: description: For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the @@ -2382,6 +2394,8 @@ components: items: $ref: '#/components/schemas/InterconnectionPort' type: array + project: + $ref: '#/components/schemas/Project' redundancy: description: Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. @@ -3176,8 +3190,18 @@ components: format: uri type: string metro: - description: 'Metro code or ID of where the instance should be provisioned - in. + description: 'Metro code or ID of where the device should be provisioned + in, or it can be instructed to create the device in the best available + metro with `{ "metro": "any" }`. + + The special metro value of any means anywhere, any metro. When any is + chosen in the request, the metro location is picked per our scheduling + algorithms that favor the following factors: hardware reservation location + (if requesting reserved hardware), ip reservations, spot instances, etc. + + The any keyword *does not* optimize for cost, this means that usage costs + (instance, transfer, other features dependent on location) will vary. + Please check metro value in response to see where the device was created. Either metro or facility must be provided.' example: sv @@ -3704,7 +3728,7 @@ components: type: string virtual_networks: items: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/VirtualNetwork' type: array type: object PortAssignInput: @@ -3944,6 +3968,8 @@ components: updated_at: format: date-time type: string + url: + type: string volumes: items: $ref: '#/components/schemas/Href' @@ -4968,11 +4994,14 @@ components: VirtualNetwork: properties: assigned_to: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Project' assigned_to_virtual_circuit: description: True if the virtual network is attached to a virtual circuit. False if not. type: boolean + created_at: + format: date-time + type: string description: type: string facility: @@ -4986,7 +5015,7 @@ components: description: A list of instances with ports currently associated to this Virtual Network. items: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Device' type: array metal_gateways: description: A list of metal gateways currently associated to this Virtual @@ -4995,7 +5024,7 @@ components: $ref: '#/components/schemas/MetalGatewayLite' type: array metro: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Metro' metro_code: description: The Metro code of the metro in which this Virtual Network is defined. @@ -5133,6 +5162,9 @@ components: type: string description: type: string + facility_id: + type: string + x-deprecated: true href: format: uri type: string @@ -5205,6 +5237,7 @@ components: - redundancy - service_token_type - type + - vlans type: object VlanVirtualCircuit: properties: @@ -5240,9 +5273,9 @@ components: nni_vlan: type: integer port: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/InterconnectionPort' project: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Project' speed: description: For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual @@ -5403,7 +5436,10 @@ components: type: array local_asn: description: A 4-byte ASN associated with the VRF. - format: int32 + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer metro: $ref: '#/components/schemas/Metro' @@ -5424,6 +5460,32 @@ components: $ref: '#/components/schemas/VrfVirtualCircuit' type: array type: object + VrfBGPNeighbors: + properties: + bgp_neighbors: + items: + properties: + peer_as: + description: The ASN of the peer that advertised the prefix. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + peer_ip: + example: 8.8.8.8 + type: string + state: + description: The current status of the connection to the BGP peer. + State is either up or down. + example: up + type: string + type: object + type: object + href: + format: uri + type: string + type: object VrfCreateInput: properties: bgp_dynamic_neighbors_bfd_enabled: @@ -5450,7 +5512,10 @@ components: type: string type: array local_asn: - format: int32 + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer metro: description: The UUID (or metro code) for the Metro in which to create this @@ -5477,6 +5542,9 @@ components: type: string description: type: string + facility_id: + type: string + x-deprecated: true href: format: uri type: string @@ -5689,6 +5757,27 @@ components: $ref: '#/components/schemas/VrfIpReservation' type: array type: object + VrfLearnedRoutes: + properties: + href: + format: uri + type: string + learned_routes: + items: + properties: + origin_as: + description: The ASN of the peer that advertised the prefix. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + prefix: + example: 8.8.8.0/24 + type: string + type: object + type: object + type: object VrfList: properties: href: @@ -5960,11 +6049,15 @@ components: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer port: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/InterconnectionPort' project: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Project' speed: description: integer representing bps speed format: int64 @@ -6065,6 +6158,10 @@ components: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer project_id: format: uuid @@ -6140,6 +6237,10 @@ components: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer speed: description: Speed can be changed only if it is an interconnection on a @@ -18818,6 +18919,41 @@ paths: summary: Update the VRF tags: - VRFs + /vrfs/{id}/bgp-neighbors: + get: + description: Provides BGP peering information such as the IP and state of the + neighbor. + operationId: getVrfBGPNeighbors + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfBGPNeighbors' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retreive BGP neighbor states for the VRF + tags: + - VRFs /vrfs/{id}/ips: get: description: Returns the list of VRF IP Reservations for the VRF. @@ -18872,6 +19008,41 @@ paths: summary: Retrieve all VRF IP Reservations in the VRF tags: - VRFs + /vrfs/{id}/learned-routes: + get: + description: Provides information about learned routes for the VRF. The VRF + builds this information dynamically though BGP from other routers in the network. + operationId: getVrfLearnedRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfLearnedRoutes' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retreive learned L3 routes within the VRF + tags: + - VRFs /vrfs/{id}/routes: get: description: Returns the list of routes for the VRF diff --git a/oas3.fetched/components/schemas/BgpConfig.yaml b/oas3.fetched/components/schemas/BgpConfig.yaml index 0947e2f2..81e0cd90 100644 --- a/oas3.fetched/components/schemas/BgpConfig.yaml +++ b/oas3.fetched/components/schemas/BgpConfig.yaml @@ -3,7 +3,9 @@ properties: description: Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned. example: 65000 - format: int32 + minimum: 0 + maximum: 4294967295 + format: int64 type: integer created_at: format: date-time diff --git a/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml b/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml index 9cd1aa01..b7342df8 100644 --- a/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml +++ b/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml @@ -1,6 +1,7 @@ properties: asn: type: integer + format: int64 minimum: 0 maximum: 4294967295 description: Autonomous System Number for local BGP deployment. diff --git a/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml b/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml index 02135006..eeec59aa 100644 --- a/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml +++ b/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml @@ -8,6 +8,9 @@ properties: bgp_neighbor_asn: description: The ASN of the dynamic BGP neighbor type: integer + format: int64 + minimum: 0 + maximum: 4294967295 example: 12345 bgp_neighbor_range: description: Network range of the dynamic BGP neighbor in CIDR format diff --git a/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml b/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml index c53701f3..40347f6a 100644 --- a/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml +++ b/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml @@ -6,6 +6,9 @@ properties: bgp_neighbor_asn: description: The ASN of the dynamic BGP neighbor type: integer + format: int64 + minimum: 0 + maximum: 4294967295 example: 12345 tags: items: diff --git a/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml b/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml index 1c3bde92..a0bee635 100644 --- a/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml +++ b/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml @@ -8,6 +8,9 @@ properties: format: email description: type: string + facility_id: + type: string + x-deprecated: true metro: description: A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. type: string diff --git a/oas3.fetched/components/schemas/Interconnection.yaml b/oas3.fetched/components/schemas/Interconnection.yaml index add6ba61..1bcc36d3 100644 --- a/oas3.fetched/components/schemas/Interconnection.yaml +++ b/oas3.fetched/components/schemas/Interconnection.yaml @@ -4,7 +4,8 @@ properties: description: type: string facility: - $ref: './Href.yaml' + $ref: './Facility.yaml' + x-deprecated: true id: format: uuid type: string @@ -29,12 +30,14 @@ properties: name: type: string organization: - $ref: './Href.yaml' + $ref: './Organization.yaml' ports: items: $ref: './InterconnectionPort.yaml' type: array description: For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). + project: + $ref: './Project.yaml' redundancy: type: string enum: diff --git a/oas3.fetched/components/schemas/MetroInput.yaml b/oas3.fetched/components/schemas/MetroInput.yaml index 0c6ebac5..5cd1b9d5 100644 --- a/oas3.fetched/components/schemas/MetroInput.yaml +++ b/oas3.fetched/components/schemas/MetroInput.yaml @@ -3,7 +3,9 @@ required: properties: metro: description: |- - Metro code or ID of where the instance should be provisioned in. + Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ "metro": "any" }`. + The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. + The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. type: string example: sv \ No newline at end of file diff --git a/oas3.fetched/components/schemas/Port.yaml b/oas3.fetched/components/schemas/Port.yaml index bceaf31b..e232c6dd 100644 --- a/oas3.fetched/components/schemas/Port.yaml +++ b/oas3.fetched/components/schemas/Port.yaml @@ -35,6 +35,6 @@ properties: $ref: './VirtualNetwork.yaml' virtual_networks: items: - $ref: './Href.yaml' + $ref: './VirtualNetwork.yaml' type: array type: object diff --git a/oas3.fetched/components/schemas/Project.yaml b/oas3.fetched/components/schemas/Project.yaml index de5da431..48af7d0b 100644 --- a/oas3.fetched/components/schemas/Project.yaml +++ b/oas3.fetched/components/schemas/Project.yaml @@ -47,6 +47,8 @@ properties: updated_at: format: date-time type: string + url: + type: string volumes: items: $ref: './Href.yaml' diff --git a/oas3.fetched/components/schemas/VirtualNetwork.yaml b/oas3.fetched/components/schemas/VirtualNetwork.yaml index cb0c698f..311670d0 100644 --- a/oas3.fetched/components/schemas/VirtualNetwork.yaml +++ b/oas3.fetched/components/schemas/VirtualNetwork.yaml @@ -1,6 +1,6 @@ properties: assigned_to: - $ref: './Href.yaml' + $ref: './Project.yaml' assigned_to_virtual_circuit: description: True if the virtual network is attached to a virtual circuit. False if not. @@ -11,6 +11,9 @@ properties: $ref: './Href.yaml' href: type: string + created_at: + format: date-time + type: string id: format: uuid type: string @@ -18,7 +21,7 @@ properties: description: A list of instances with ports currently associated to this Virtual Network. items: - $ref: './Href.yaml' + $ref: './Device.yaml' type: array metal_gateways: description: A list of metal gateways currently associated to this Virtual Network. @@ -26,7 +29,7 @@ properties: $ref: './MetalGatewayLite.yaml' type: array metro: - $ref: './Href.yaml' + $ref: './Metro.yaml' metro_code: description: The Metro code of the metro in which this Virtual Network is defined. type: string diff --git a/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml b/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml index e2063a0c..e2938886 100644 --- a/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml +++ b/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml @@ -5,6 +5,9 @@ properties: format: email description: type: string + facility_id: + type: string + x-deprecated: true metro: description: A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), @@ -58,4 +61,5 @@ required: - type - redundancy - service_token_type +- vlans type: object diff --git a/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml b/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml index ba39f6d9..89a8dbdb 100644 --- a/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml +++ b/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml @@ -20,9 +20,9 @@ properties: nni_vlan: type: integer port: - $ref: './Href.yaml' + $ref: './InterconnectionPort.yaml' project: - $ref: './Href.yaml' + $ref: './Project.yaml' speed: description: For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. diff --git a/oas3.fetched/components/schemas/Vrf.yaml b/oas3.fetched/components/schemas/Vrf.yaml index 85f576ea..1be4cd4e 100644 --- a/oas3.fetched/components/schemas/Vrf.yaml +++ b/oas3.fetched/components/schemas/Vrf.yaml @@ -23,7 +23,10 @@ properties: local_asn: description: A 4-byte ASN associated with the VRF. type: integer - format: int32 + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 virtual_circuits: description: Virtual circuits that are in the VRF type: array diff --git a/oas3.fetched/components/schemas/VrfBGPNeighbors.yaml b/oas3.fetched/components/schemas/VrfBGPNeighbors.yaml new file mode 100644 index 00000000..5189b672 --- /dev/null +++ b/oas3.fetched/components/schemas/VrfBGPNeighbors.yaml @@ -0,0 +1,20 @@ +properties: + bgp_neighbors: + items: + properties: + peer_ip: + type: string + example: "8.8.8.8" + peer_as: + description: The ASN of the peer that advertised the prefix. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + state: + description: The current status of the connection to the BGP peer. State is either up or down. + type: string + example: "up" + type: object +type: object diff --git a/oas3.fetched/components/schemas/VrfCreateInput.yaml b/oas3.fetched/components/schemas/VrfCreateInput.yaml index 081a63b6..dc934527 100644 --- a/oas3.fetched/components/schemas/VrfCreateInput.yaml +++ b/oas3.fetched/components/schemas/VrfCreateInput.yaml @@ -14,7 +14,10 @@ properties: $ref: './VrfIpRangeCreateInput.yaml' local_asn: type: integer - format: int32 + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 metro: description: The UUID (or metro code) for the Metro in which to create this VRF. type: string diff --git a/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml b/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml index 644701d9..db340250 100644 --- a/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml +++ b/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml @@ -5,6 +5,9 @@ properties: format: email description: type: string + facility_id: + type: string + x-deprecated: true metro: description: A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), diff --git a/oas3.fetched/components/schemas/VrfLearnedRoutes.yaml b/oas3.fetched/components/schemas/VrfLearnedRoutes.yaml new file mode 100644 index 00000000..be9cd750 --- /dev/null +++ b/oas3.fetched/components/schemas/VrfLearnedRoutes.yaml @@ -0,0 +1,16 @@ +properties: + learned_routes: + items: + type: object + properties: + prefix: + type: string + example: "8.8.8.0/24" + origin_as: + description: The ASN of the peer that advertised the prefix. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 +type: object diff --git a/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml b/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml index 50646508..b5b21681 100644 --- a/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml +++ b/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml @@ -27,14 +27,18 @@ properties: name: type: string port: - $ref: './Href.yaml' + $ref: './InterconnectionPort.yaml' nni_vlan: type: integer peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 project: - $ref: './Href.yaml' + $ref: './Project.yaml' speed: description: integer representing bps speed type: integer diff --git a/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml b/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml index 51a934f0..00f468aa 100644 --- a/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml +++ b/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml @@ -32,6 +32,10 @@ properties: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 project_id: format: uuid type: string diff --git a/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml b/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml index 4058c7c0..bdba267d 100644 --- a/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml +++ b/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml @@ -29,6 +29,10 @@ properties: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 speed: description: Speed can be changed only if it is an interconnection on a Dedicated Port type: string diff --git a/oas3.fetched/openapi3.yaml b/oas3.fetched/openapi3.yaml index 8fe52759..25b37427 100644 --- a/oas3.fetched/openapi3.yaml +++ b/oas3.fetched/openapi3.yaml @@ -509,6 +509,10 @@ components: $ref: './components/schemas/VrfVirtualCircuitCreateInput.yaml' VrfVirtualCircuitUpdateInput: $ref: './components/schemas/VrfVirtualCircuitUpdateInput.yaml' + VrfBGPNeighbors: + $ref: './components/schemas/VrfBGPNeighbors.yaml' + VrfLearnedRoutes: + $ref: './components/schemas/VrfLearnedRoutes.yaml' securitySchemes: x_auth_token: in: header @@ -816,6 +820,11 @@ paths: $ref: ./paths/vrfs/vrf_id/ips/id.yaml /vrfs/{id}/routes: $ref: ./paths/vrfs/id/routes.yaml + /vrfs/{id}/learned-routes: + $ref: ./paths/vrfs/id/learned-routes.yaml + /vrfs/{id}/bgp-neighbors: + $ref: ./paths/vrfs/id/bgp-neighbors.yaml + tags: - description: |+ Nearly all of the endpoints in the API require authentication. Authentication is performed by providing an authentication token (interchangeably referred to as an API key) in the `X-Auth-Token` HTTP request header. diff --git a/oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml b/oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml new file mode 100644 index 00000000..c2b31099 --- /dev/null +++ b/oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml @@ -0,0 +1,34 @@ +get: + description: Provides BGP peering information such as the IP and state + of the neighbor. + summary: Retreive BGP neighbor states for the VRF + operationId: getVrfBGPNeighbors + tags: + - VRFs + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfBGPNeighbors.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found diff --git a/oas3.fetched/paths/vrfs/id/learned-routes.yaml b/oas3.fetched/paths/vrfs/id/learned-routes.yaml new file mode 100644 index 00000000..7c57ff0c --- /dev/null +++ b/oas3.fetched/paths/vrfs/id/learned-routes.yaml @@ -0,0 +1,35 @@ +get: + description: Provides information about learned routes for the VRF. + The VRF builds this information dynamically though BGP from other + routers in the network. + summary: Retreive learned L3 routes within the VRF + operationId: getVrfLearnedRoutes + tags: + - VRFs + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfLearnedRoutes.yaml' + "403": + description: forbidden + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found diff --git a/oas3.stitched/.openapi-generator/FILES b/oas3.stitched/.openapi-generator/FILES index 5528e4dc..18e57cb2 100644 --- a/oas3.stitched/.openapi-generator/FILES +++ b/oas3.stitched/.openapi-generator/FILES @@ -1,3 +1,2 @@ -.openapi-generator-ignore README.md metal_openapi.yaml diff --git a/oas3.stitched/metal_openapi.yaml b/oas3.stitched/metal_openapi.yaml index 523093af..61712198 100644 --- a/oas3.stitched/metal_openapi.yaml +++ b/oas3.stitched/metal_openapi.yaml @@ -12588,6 +12588,76 @@ paths: summary: Create a VRF route tags: - VRFs + /vrfs/{id}/learned-routes: + get: + description: Provides information about learned routes for the VRF. The VRF + builds this information dynamically though BGP from other routers in the network. + operationId: getVrfLearnedRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VrfLearnedRoutes' + description: ok + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retreive learned L3 routes within the VRF + tags: + - VRFs + /vrfs/{id}/bgp-neighbors: + get: + description: Provides BGP peering information such as the IP and state of the + neighbor. + operationId: getVrfBGPNeighbors + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VrfBGPNeighbors' + description: ok + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retreive BGP neighbor states for the VRF + tags: + - VRFs components: parameters: DeviceSearch: @@ -12844,7 +12914,9 @@ components: description: "Autonomous System Number. ASN is required with Global BGP.\ \ With Local BGP the private ASN, 65000, is assigned." example: 65000 - format: int32 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer created_at: format: date-time @@ -12905,6 +12977,7 @@ components: asn: description: Autonomous System Number for local BGP deployment. example: 65000 + format: int64 maximum: 4294967295 minimum: 0 type: integer @@ -12944,6 +13017,9 @@ components: bgp_neighbor_asn: description: The ASN of the dynamic BGP neighbor example: 12345 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer bgp_neighbor_range: description: Network range of the dynamic BGP neighbor in CIDR format @@ -12987,6 +13063,9 @@ components: bgp_neighbor_asn: description: The ASN of the dynamic BGP neighbor example: 12345 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer tags: items: @@ -13289,6 +13368,9 @@ components: type: string description: type: string + facility_id: + type: string + x-deprecated: true metro: description: "A Metro ID or code. For interconnections with Dedicated Ports,\ \ this will be the location of the issued Dedicated Ports." @@ -14414,7 +14496,7 @@ components: description: type: string facility: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Facility' id: format: uuid type: string @@ -14445,7 +14527,7 @@ components: name: type: string organization: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Organization' ports: description: "For Fabric VCs, these represent Virtual Port(s) created for\ \ the interconnection. For dedicated interconnections, these represent\ @@ -14453,6 +14535,8 @@ components: items: $ref: '#/components/schemas/InterconnectionPort' type: array + project: + $ref: '#/components/schemas/Project' redundancy: description: "Either 'primary', meaning a single interconnection, or 'redundant',\ \ meaning a redundant interconnection." @@ -15066,7 +15150,9 @@ components: properties: metro: description: |- - Metro code or ID of where the instance should be provisioned in. + Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ "metro": "any" }`. + The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. + The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. example: sv type: string @@ -15413,7 +15499,7 @@ components: $ref: '#/components/schemas/VirtualNetwork' virtual_networks: items: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/VirtualNetwork' type: array type: object PortAssignInput: @@ -15561,6 +15647,8 @@ components: updated_at: format: date-time type: string + url: + type: string volumes: items: $ref: '#/components/schemas/Href' @@ -16380,7 +16468,7 @@ components: VirtualNetwork: properties: assigned_to: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Project' assigned_to_virtual_circuit: description: True if the virtual network is attached to a virtual circuit. False if not. @@ -16391,6 +16479,9 @@ components: $ref: '#/components/schemas/Href' href: type: string + created_at: + format: date-time + type: string id: format: uuid type: string @@ -16398,7 +16489,7 @@ components: description: A list of instances with ports currently associated to this Virtual Network. items: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Device' type: array metal_gateways: description: A list of metal gateways currently associated to this Virtual @@ -16407,7 +16498,7 @@ components: $ref: '#/components/schemas/MetalGatewayLite' type: array metro: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Metro' metro_code: description: The Metro code of the metro in which this Virtual Network is defined. @@ -16524,6 +16615,9 @@ components: type: string description: type: string + facility_id: + type: string + x-deprecated: true metro: description: "A Metro ID or code. When creating Fabric VCs (Metal Billed),\ \ this is where interconnection will be originating from, as we pre-authorize\ @@ -16593,6 +16687,7 @@ components: - redundancy - service_token_type - type + - vlans type: object VlanVirtualCircuit: properties: @@ -16622,9 +16717,9 @@ components: nni_vlan: type: integer port: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/InterconnectionPort' project: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Project' speed: description: "For Virtual Circuits on shared and dedicated connections,\ \ this speed should match the one set on their Interconnection Ports.\ @@ -16772,7 +16867,10 @@ components: type: boolean local_asn: description: A 4-byte ASN associated with the VRF. - format: int32 + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer virtual_circuits: description: Virtual circuits that are in the VRF @@ -16827,7 +16925,10 @@ components: type: string type: array local_asn: - format: int32 + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer metro: description: The UUID (or metro code) for the Metro in which to create this @@ -16854,6 +16955,9 @@ components: type: string description: type: string + facility_id: + type: string + x-deprecated: true metro: description: "A Metro ID or code. When creating Fabric VCs (Metal Billed),\ \ this is where interconnection will be originating from, as we pre-authorize\ @@ -17303,15 +17407,19 @@ components: name: type: string port: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/InterconnectionPort' nni_vlan: type: integer peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer project: - $ref: '#/components/schemas/Href' + $ref: '#/components/schemas/Project' speed: description: integer representing bps speed format: int64 @@ -17406,6 +17514,10 @@ components: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer project_id: format: uuid @@ -17472,6 +17584,10 @@ components: peer_asn: description: The peer ASN that will be used with the VRF on the Virtual Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 type: integer speed: description: Speed can be changed only if it is an interconnection on a @@ -17491,6 +17607,47 @@ components: type: string type: array type: object + VrfBGPNeighbors: + properties: + bgp_neighbors: + items: + properties: + peer_ip: + example: 8.8.8.8 + type: string + peer_as: + description: The ASN of the peer that advertised the prefix. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + state: + description: The current status of the connection to the BGP peer. + State is either up or down. + example: up + type: string + type: object + type: object + type: object + VrfLearnedRoutes: + properties: + learned_routes: + items: + properties: + prefix: + example: 8.8.8.0/24 + type: string + origin_as: + description: The ASN of the peer that advertised the prefix. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + type: object + type: object InterconnectionMetroList: properties: metros: