blueprint: Add support for GET /api/blueprints/{bp_id}/relationships#44
Conversation
that1guy15
left a comment
There was a problem hiding this comment.
One comment and you need to rebase and bump version #.
Looks good, thank you!
|
|
||
| if queries: | ||
| query_str = '&'.join(queries) | ||
| url += f'?{query_str}' |
There was a problem hiding this comment.
no need to append the url, you can use the queries in the header.
There was a problem hiding this comment.
Thank you for your review!
Please tell me how I can put queries in header? (I don't know how to do except for append into URL)
There was a problem hiding this comment.
If you look at the json_resp_get() method you will see it takes params as an optional argument as a dictionary with your query parameters as key/value pairs. This library is designed to take params and pass them in through the headers when populated so you dont have to work with them raw in the url
There are examples through out this library that are using the params argument in the rest class. Here is a good example: https://github.com/Apstra/apstra-api-python/blob/main/aos/blueprint.py#L536
There was a problem hiding this comment.
Good advice! I have fixed to use params instead of querystring. How about that?
There was a problem hiding this comment.
And rebased to bump version number.
b670568 to
9bc3df2
Compare
Add support for GET
/api/blueprints/{bp_id}/relationshipsThis API is useful in some use cases like finding a pair of interface and device.