Skip to content

why i recieved 500 error?????? #714

Answered by jshcodes
NSH531 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @NSH531 -

response is defined as an instance of the Hosts Service Class. It is properly created (assuming client_id and secret are valid and falconpy is imported outside of this method), but then it goes unused. The call to set last_seen_result is malformed by calling the module, then the class, then the method directly. (The way it is written, it is making a call to an uninstantiated object and does not reference the constructor.)

If you want the call all on one line, it would need to look something like:

last_seen_result = F1.hosts.Hosts(client_id=client_id, client_secret=secret).query_devices_by_filter(filter=f"hostname:*'*{myid}*'",sort='hostname.asc')

I don't recommend that patter…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jshcodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
hosts Hosts or Host Groups issues and questions SDK usage General SDK usage issues and questions
2 participants