Add /v1/actions API call to HetznerApi client#20
Conversation
|
Hi @danielthegray, thank you for contribution. Unless I missed something, this method is not really needed to support polling since addition of 58969fa. |
4db7e19 to
1a85be1
Compare
|
Hi, interesting! OK! Have you been working on the actions polling for server success checking on your end? I was thinking about the issue I saw in your queue (and wondered if it could help solve other issues like the race condition with the burst requests of servers), and I saw this API endpoint was missing and thought it was fairly trivial to add :) If this client is ever used for other projects it might be useful to have a separate endpoint. I was not aware of the actions under each resource type to query its actions. The main nuisance that I can see in the Anyway, this function is fairly general and could be used for other things, so I've added the unit test you requested, trying to stick as closely as possible to the style of the API in general. Please let me know if you would like me to make any adjustments, no matter how minor/trivial they might seem! |
This will allow the polling of asynchronous actions from the Hetzner API without consuming the main rate limit of the other (main) endpoints.
1a85be1 to
b6e649e
Compare
|



This will allow the polling of asynchronous actions from the Hetzner API without consuming the main rate limit of the other (main) endpoints.
Testing
I tested the new method of the API client by integrating it in a small CLI app with my own API token and polling an action, and the response (and status) came back correctly.
I've also added a small unit test covering the "happy path" case of polling for a
server_deleteaction, ensuring that all the fields are parsed + populated as expected.