Skip to content

Commit 4db7e19

Browse files
Add /v1/actions API call to HetznerApi client
This will allow the polling of asynchronous actions from the Hetzner API without consuming the main rate limit of the other (main) endpoints.
1 parent f7245cf commit 4db7e19

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/cloud/dnation/hetznerclient/HetznerApi.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
* For full version, check <a href="https://docs.hetzner.cloud/">official documentation</a>
3131
*/
3232
public interface HetznerApi {
33+
34+
/**
35+
* Poll the status of an asynchronous API on the Hetzner Cloud.
36+
* <p>Normally, the rate limit of this API is higher and separate from the other API calls,
37+
* as it is preferred to poll the /actions endpoint to wait for asynchronous action to complete.</p>
38+
* @param actionId the ID of the action whose status you want to poll
39+
* @return the full Action object, including its current status
40+
*/
41+
@GET("/v1/actions/{id}")
42+
Call<ActionResponse> pollAction(@Path("id") Long actionId);
43+
3344
/**
3445
* Get all images that matches given label expression.
3546
*

0 commit comments

Comments
 (0)