Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestResponse Class: Add HTTP status code as property #22

Closed
netgab opened this issue Feb 23, 2022 · 4 comments
Closed

RestResponse Class: Add HTTP status code as property #22

netgab opened this issue Feb 23, 2022 · 4 comments

Comments

@netgab
Copy link

netgab commented Feb 23, 2022

Is your feature request related to a problem? Please describe.
For regression testing using pyATS (or other testing tools), it might be useful to get the HTTP status code in successful API requests (e.g. 201 when creating a resource like an endpoint). In case of an error (ApiError exception) the fail status code is already implemented in the status_code property.

Describe the solution you'd like
Add the following properties to the RestResponse class:

  • status_code

The field status might not be needed, because I doubt the ISE will add any message in the body for success requests.

@wastorga
Copy link
Collaborator

I added it. I will publish the new version soon.

In [23]: r3 = api2.endpoint.delete_by_id(id=r1_id)

In [24]: r3.status_code
Out[24]: 204

@netgab
Copy link
Author

netgab commented Feb 23, 2022

Thank you! Damn you're fast

@wastorga
Copy link
Collaborator

The ciscoisesdk v1.5.0 is up. Feel free to test it and close or comment if necessary.

@netgab
Copy link
Author

netgab commented Feb 25, 2022

Works perfectly. Thanks!

@netgab netgab closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants