File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,6 +177,28 @@ def logout(ctx):
177177 log (payload ["detail" ])
178178
179179
180+ @cli .command ()
181+ @click .pass_context
182+ def status (ctx : Context ):
183+ """Check the status of the QFieldCloud server."""
184+ log ("Checking server status..." )
185+ client : sdk .Client = ctx .obj ["client" ]
186+ is_json : bool = ctx .obj ["format_json" ]
187+
188+ status_info = client .check_server_status ()
189+
190+ if is_json :
191+ print_json (status_info )
192+ else :
193+ log (click .style ("Server Status:" , bold = True ))
194+
195+ if isinstance (status_info , dict ):
196+ for key , value in status_info .items ():
197+ log (f" { key .replace ('_' , ' ' ).capitalize ()} : { value } " )
198+ else :
199+ log (str (status_info ))
200+
201+
180202@cli .command ()
181203@paginated
182204@click .option (
Original file line number Diff line number Diff line change @@ -326,6 +326,28 @@ def logout(self) -> None:
326326
327327 return resp .json ()
328328
329+ def check_server_status (self ) -> Dict [str , Any ]:
330+ """Checks the status of the QFieldCloud server.
331+
332+ This endpoint usually provides information of the server health.
333+
334+ Returns:
335+ A dictionary containing the server status information (e.g., {"storage": "ok", ...}).
336+
337+ Example:
338+ ```python
339+ client = sdk.Client(url="[https://app.qfield.cloud/api/v1/](https://app.qfield.cloud/api/v1/)")
340+ status = client.check_server_status()
341+ print(f"Server status: {status}")
342+ ```
343+ """
344+ resp = self ._request (
345+ "GET" ,
346+ "status/" ,
347+ skip_token = True ,
348+ )
349+ return resp .json ()
350+
329351 def list_projects (
330352 self ,
331353 include_public : bool = False ,
You can’t perform that action at this time.
0 commit comments