Coverage for abb_rws_client_python_rw6/rws/ctrl/clock.py: 100%
23 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-13 22:17 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-13 22:17 +0000
1# This file is AUTO-GENERATED by utils/generator/main.py
2# DO NOT EDIT MANUALLY — run the generator to regenerate.
3# Generator author: Clement RACINET
4"""
5RWS module: Controller Service → Operations on Clock Resource → Get Clock Resource
71:1 mirror of the ABB RobotWare 6 REST API.
8Each function maps to exactly one HTTP endpoint.
9No composed logic — see highlevel/ for wrappers.
10"""
12from __future__ import annotations
14import httpx
16from abb_rws_client_python_rw6.core.client import RWSClient
19async def get_clock_resource(client: RWSClient) -> httpx.Response:
20 """
21 Get Clock Resource.
23 Route: ``GET /ctrl/clock``
24 ABB constraints: Not Supported in bootserver mode
26 Args:
27 client: Open RWSClient instance.
29 Returns:
30 Raw HTTP response. Expected success: HTTP 200.
32 Raises:
33 RWSAuthenticationError: On HTTP 401.
34 RWSNotFoundError: On HTTP 404.
35 RWSHTTPError: On any other HTTP >= 400.
36 # ABB codes: NOT_FOUND(404)
38 Example:
39 ```python
40 >>> await get_clock_resource(client)
41 <Response [200]>
42 ```
43 """
44 return await client.get("/ctrl/clock")
47async def get_clock_actions(
48 client: RWSClient,
49 action: str | None = None,
50) -> httpx.Response:
51 """
52 Get Clock Actions.
54 Route: ``GET /ctrl/clock``
55 ABB constraints: Not Supported in bootserver mode
57 Args:
58 client: Open RWSClient instance.
59 action: Query parameter. Optional.
61 Returns:
62 Raw HTTP response. Expected success: HTTP 200.
64 Raises:
65 RWSAuthenticationError: On HTTP 401.
66 RWSNotFoundError: On HTTP 404.
67 RWSHTTPError: On any other HTTP >= 400.
68 # ABB codes: NOT_FOUND(404) See
70 Example:
71 ```python
72 >>> await get_clock_actions(client)
73 <Response [200]>
74 ```
75 """
76 return await client.get(
77 "/ctrl/clock",
78 params={k: v for k, v in {"action": action}.items() if v is not None},
79 )
82async def set_the_clock_of_the_controller(client: RWSClient) -> httpx.Response:
83 """
84 Set the Clock of the controller.
86 Route: ``PUT /ctrl/clock``
87 ABB constraints: Available only for RC Not Supported in bootserver mode
89 Args:
90 client: Open RWSClient instance.
92 Returns:
93 Raw HTTP response. Expected success: HTTP 204.
95 Raises:
96 RWSAuthenticationError: On HTTP 401.
97 RWSNotFoundError: On HTTP 404.
98 RWSHTTPError: On any other HTTP >= 400.
99 # ABB codes: UNAUTHORIZED(401), BAD_REQUEST(400), UNSUPPORTED_MEDIA(415), See
101 Example:
102 ```python
103 >>> await set_the_clock_of_the_controller(client)
104 <Response [204]>
105 ```
106 """
107 return await client.put(
108 "/ctrl/clock",
109 data={},
110 )
113async def get_timezone_resource(client: RWSClient) -> httpx.Response:
114 """
115 Get timezone resource.
117 Route: ``GET /ctrl/clock/timezone``
118 ABB constraints: Available only for RC Not supported in bootserver mode
120 Args:
121 client: Open RWSClient instance.
123 Returns:
124 Raw HTTP response. Expected success: HTTP 200.
126 Raises:
127 RWSAuthenticationError: On HTTP 401.
128 RWSNotFoundError: On HTTP 404.
129 RWSHTTPError: On any other HTTP >= 400.
130 # ABB codes: See
132 Example:
133 ```python
134 >>> await get_timezone_resource(client)
135 <Response [200]>
136 ```
137 """
138 return await client.get("/ctrl/clock/timezone")
141async def get_timezone_actions(client: RWSClient) -> httpx.Response:
142 """
143 Get timezone actions.
145 Route: ``GET /ctrl/clock/timezone?action=show``
146 ABB constraints: Available only for RC Not supported in bootserver mode
148 Args:
149 client: Open RWSClient instance.
151 Returns:
152 Raw HTTP response. Expected success: HTTP 200.
154 Raises:
155 RWSAuthenticationError: On HTTP 401.
156 RWSNotFoundError: On HTTP 404.
157 RWSHTTPError: On any other HTTP >= 400.
158 # ABB codes: See
160 Example:
161 ```python
162 >>> await get_timezone_actions(client)
163 <Response [200]>
164 ```
165 """
166 return await client.get(
167 "/ctrl/clock/timezone",
168 params={"action": "show"},
169 )
172async def set_the_time_zone(client: RWSClient) -> httpx.Response:
173 """
174 Set the time zone.
176 Route: ``POST /ctrl/clock/timezone``
177 ABB constraints: Available only for RC Not supported in bootserver mode
179 Args:
180 client: Open RWSClient instance.
182 Returns:
183 Raw HTTP response. Expected success: HTTP 204.
185 Raises:
186 RWSAuthenticationError: On HTTP 401.
187 RWSNotFoundError: On HTTP 404.
188 RWSHTTPError: On any other HTTP >= 400.
189 # ABB codes: See
191 Example:
192 ```python
193 >>> await set_the_time_zone(client)
194 <Response [204]>
195 ```
196 """
197 return await client.post(
198 "/ctrl/clock/timezone",
199 data={},
200 )
203async def get_time_server_resource(client: RWSClient) -> httpx.Response:
204 """
205 Get time server resource.
207 Route: ``GET /ctrl/clock/timeserver``
208 ABB constraints: Available only for RC Not supported in bootserver mode
210 Args:
211 client: Open RWSClient instance.
213 Returns:
214 Raw HTTP response. Expected success: HTTP 200.
216 Raises:
217 RWSAuthenticationError: On HTTP 401.
218 RWSNotFoundError: On HTTP 404.
219 RWSHTTPError: On any other HTTP >= 400.
220 # ABB codes: See
222 Example:
223 ```python
224 >>> await get_time_server_resource(client)
225 <Response [200]>
226 ```
227 """
228 return await client.get("/ctrl/clock/timeserver")
231async def get_time_server_actions(client: RWSClient) -> httpx.Response:
232 """
233 Get time server actions.
235 Route: ``GET /ctrl/clock/timeserver?action=show``
236 ABB constraints: Available only for RC Not supported in bootserver mode
238 Args:
239 client: Open RWSClient instance.
241 Returns:
242 Raw HTTP response. Expected success: HTTP 200.
244 Raises:
245 RWSAuthenticationError: On HTTP 401.
246 RWSNotFoundError: On HTTP 404.
247 RWSHTTPError: On any other HTTP >= 400.
248 # ABB codes: See
250 Example:
251 ```python
252 >>> await get_time_server_actions(client)
253 <Response [200]>
254 ```
255 """
256 return await client.get(
257 "/ctrl/clock/timeserver",
258 params={"action": "show"},
259 )
262async def set_the_time_server(
263 client: RWSClient,
264 action: str | None = None,
265) -> httpx.Response:
266 """
267 Set the time server.
269 Route: ``POST /ctrl/clock/timeserver``
270 ABB constraints: Available only for RC Not supported in bootserver mode
272 Args:
273 client: Open RWSClient instance.
274 action: Query parameter. Optional.
276 Returns:
277 Raw HTTP response. Expected success: HTTP 204.
279 Raises:
280 RWSAuthenticationError: On HTTP 401.
281 RWSNotFoundError: On HTTP 404.
282 RWSHTTPError: On any other HTTP >= 400.
283 # ABB codes: See
285 Example:
286 ```python
287 >>> await set_the_time_server(client)
288 <Response [204]>
289 ```
290 """
291 return await client.post(
292 "/ctrl/clock/timeserver",
293 params={k: v for k, v in {"action": action}.items() if v is not None},
294 data={},
295 )
298async def get_test_time_server(
299 client: RWSClient,
300 resource: str | None = None,
301 server_ip: str | None = None,
302) -> httpx.Response:
303 """
304 Test Time Server.
306 Route: ``GET /ctrl/clock/timeserver``
307 ABB constraints: Available only for RC Not supported in bootserver mode
309 Args:
310 client: Open RWSClient instance.
311 resource: Query parameter. Optional.
312 server_ip: Query parameter. Optional.
314 Returns:
315 Raw HTTP response. Expected success: HTTP 200.
317 Raises:
318 RWSAuthenticationError: On HTTP 401.
319 RWSNotFoundError: On HTTP 404.
320 RWSHTTPError: On any other HTTP >= 400.
321 # ABB codes: See
323 Example:
324 ```python
325 >>> await get_test_time_server(client)
326 <Response [200]>
327 ```
328 """
329 return await client.get(
330 "/ctrl/clock/timeserver",
331 params={
332 k: v for k, v in {"resource": resource, "server_ip": server_ip}.items() if v is not None
333 },
334 )