aruba / pyedgeconnect

Python wrapper for Aruba Orchestrator and Edge Connect API
MIT License
14 stars 9 forks source link

get_routing_segmentation_maps_from_source_segment() returns 404 Error #2

Closed cdwchriburg closed 8 months ago

cdwchriburg commented 1 year ago

When using get_routing_segmentation_maps_from_source_segment() against Orchestrator 9.3.0.41159, the query doesn't seem to be formatted correctly and the API returns a 404 error.

2023-07-20 11:36:10,874 - orch_xxxxxxx.silverpeak.cloud - ERROR - [GET] /vrf/config/maps/1 | Received HTTP 404 | Response text: null for uri: http://xxxxxxx-orch-use1.silverpeak.cloud/gms/rest/vrf/config/maps/1?source=menu_rest_apis_id
{'api_path': '/vrf/config/maps/1',
 'request': '[GET]',
 'status_code': 404,
 'text': 'null for uri: '
         'http://xxxxxxx-orch-use1.silverpeak.cloud/gms/rest/vrf/config/maps/1?source=menu_rest_apis_id'}

Using the swagger interface it looks like the URL/querystring the orchestrator API is looking for should be: https://xxxxxxx-orch-use1.silverpeak.cloud/gms/rest/vrf/config/maps?srcSegmentId=1

cdwchriburg commented 1 year ago

Similar issue for update_routing_segmentation_maps_from_source_segment - this is returning 404 since the API wants /maps?srcSegmentId=XX and not /maps/XX

zachcamara-hpe commented 1 year ago

This specifically relates to API endpoint changes in Orchestrator 9.3, there's ongoing work to add version-aware logic in the Orchestrator class for Orchestrator 9.3 changes but there isn't a current target on when that will be published. In the interim, similar to if an endpoint is not yet included in pyedgeconnect an endpoint call be called directly with the Orchestrator._get or Orchestrator._post functions etc.

segment_id = 1
# Instead of
# segment_maps = orch.get_routing_segmentation_maps_from_source_segment(segment_id=segment_id)
# use
segment_maps = orch._get(f"/vrf/config/maps?segmentId={segment_id}")
ns-ppawaskar commented 10 months ago

Hi Folks, Is there any update on this? I am facing similar issue while using "get_api_key" and few other lib functions.

zachcamara-hpe commented 8 months ago

This is resolved as of the 0.16.0 release adding forward compatibility with Orchestrator 9.3 API changes. @ns-ppawaskar your additional example along with 280+ endpoints in pyedgeconnect were updated for the 9.3 changes.