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

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 

6 

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""" 

11 

12from __future__ import annotations 

13 

14import httpx 

15 

16from abb_rws_client_python_rw6.core.client import RWSClient 

17 

18 

19async def get_clock_resource(client: RWSClient) -> httpx.Response: 

20 """ 

21 Get Clock Resource. 

22 

23 Route: ``GET /ctrl/clock`` 

24 ABB constraints: Not Supported in bootserver mode 

25 

26 Args: 

27 client: Open RWSClient instance. 

28 

29 Returns: 

30 Raw HTTP response. Expected success: HTTP 200. 

31 

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) 

37 

38 Example: 

39 ```python 

40 >>> await get_clock_resource(client) 

41 <Response [200]> 

42 ``` 

43 """ 

44 return await client.get("/ctrl/clock") 

45 

46 

47async def get_clock_actions( 

48 client: RWSClient, 

49 action: str | None = None, 

50) -> httpx.Response: 

51 """ 

52 Get Clock Actions. 

53 

54 Route: ``GET /ctrl/clock`` 

55 ABB constraints: Not Supported in bootserver mode 

56 

57 Args: 

58 client: Open RWSClient instance. 

59 action: Query parameter. Optional. 

60 

61 Returns: 

62 Raw HTTP response. Expected success: HTTP 200. 

63 

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 

69 

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 ) 

80 

81 

82async def set_the_clock_of_the_controller(client: RWSClient) -> httpx.Response: 

83 """ 

84 Set the Clock of the controller. 

85 

86 Route: ``PUT /ctrl/clock`` 

87 ABB constraints: Available only for RC Not Supported in bootserver mode 

88 

89 Args: 

90 client: Open RWSClient instance. 

91 

92 Returns: 

93 Raw HTTP response. Expected success: HTTP 204. 

94 

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 

100 

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 ) 

111 

112 

113async def get_timezone_resource(client: RWSClient) -> httpx.Response: 

114 """ 

115 Get timezone resource. 

116 

117 Route: ``GET /ctrl/clock/timezone`` 

118 ABB constraints: Available only for RC Not supported in bootserver mode 

119 

120 Args: 

121 client: Open RWSClient instance. 

122 

123 Returns: 

124 Raw HTTP response. Expected success: HTTP 200. 

125 

126 Raises: 

127 RWSAuthenticationError: On HTTP 401. 

128 RWSNotFoundError: On HTTP 404. 

129 RWSHTTPError: On any other HTTP >= 400. 

130 # ABB codes: See 

131 

132 Example: 

133 ```python 

134 >>> await get_timezone_resource(client) 

135 <Response [200]> 

136 ``` 

137 """ 

138 return await client.get("/ctrl/clock/timezone") 

139 

140 

141async def get_timezone_actions(client: RWSClient) -> httpx.Response: 

142 """ 

143 Get timezone actions. 

144 

145 Route: ``GET /ctrl/clock/timezone?action=show`` 

146 ABB constraints: Available only for RC Not supported in bootserver mode 

147 

148 Args: 

149 client: Open RWSClient instance. 

150 

151 Returns: 

152 Raw HTTP response. Expected success: HTTP 200. 

153 

154 Raises: 

155 RWSAuthenticationError: On HTTP 401. 

156 RWSNotFoundError: On HTTP 404. 

157 RWSHTTPError: On any other HTTP >= 400. 

158 # ABB codes: See 

159 

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 ) 

170 

171 

172async def set_the_time_zone(client: RWSClient) -> httpx.Response: 

173 """ 

174 Set the time zone. 

175 

176 Route: ``POST /ctrl/clock/timezone`` 

177 ABB constraints: Available only for RC Not supported in bootserver mode 

178 

179 Args: 

180 client: Open RWSClient instance. 

181 

182 Returns: 

183 Raw HTTP response. Expected success: HTTP 204. 

184 

185 Raises: 

186 RWSAuthenticationError: On HTTP 401. 

187 RWSNotFoundError: On HTTP 404. 

188 RWSHTTPError: On any other HTTP >= 400. 

189 # ABB codes: See 

190 

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 ) 

201 

202 

203async def get_time_server_resource(client: RWSClient) -> httpx.Response: 

204 """ 

205 Get time server resource. 

206 

207 Route: ``GET /ctrl/clock/timeserver`` 

208 ABB constraints: Available only for RC Not supported in bootserver mode 

209 

210 Args: 

211 client: Open RWSClient instance. 

212 

213 Returns: 

214 Raw HTTP response. Expected success: HTTP 200. 

215 

216 Raises: 

217 RWSAuthenticationError: On HTTP 401. 

218 RWSNotFoundError: On HTTP 404. 

219 RWSHTTPError: On any other HTTP >= 400. 

220 # ABB codes: See 

221 

222 Example: 

223 ```python 

224 >>> await get_time_server_resource(client) 

225 <Response [200]> 

226 ``` 

227 """ 

228 return await client.get("/ctrl/clock/timeserver") 

229 

230 

231async def get_time_server_actions(client: RWSClient) -> httpx.Response: 

232 """ 

233 Get time server actions. 

234 

235 Route: ``GET /ctrl/clock/timeserver?action=show`` 

236 ABB constraints: Available only for RC Not supported in bootserver mode 

237 

238 Args: 

239 client: Open RWSClient instance. 

240 

241 Returns: 

242 Raw HTTP response. Expected success: HTTP 200. 

243 

244 Raises: 

245 RWSAuthenticationError: On HTTP 401. 

246 RWSNotFoundError: On HTTP 404. 

247 RWSHTTPError: On any other HTTP >= 400. 

248 # ABB codes: See 

249 

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 ) 

260 

261 

262async def set_the_time_server( 

263 client: RWSClient, 

264 action: str | None = None, 

265) -> httpx.Response: 

266 """ 

267 Set the time server. 

268 

269 Route: ``POST /ctrl/clock/timeserver`` 

270 ABB constraints: Available only for RC Not supported in bootserver mode 

271 

272 Args: 

273 client: Open RWSClient instance. 

274 action: Query parameter. Optional. 

275 

276 Returns: 

277 Raw HTTP response. Expected success: HTTP 204. 

278 

279 Raises: 

280 RWSAuthenticationError: On HTTP 401. 

281 RWSNotFoundError: On HTTP 404. 

282 RWSHTTPError: On any other HTTP >= 400. 

283 # ABB codes: See 

284 

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 ) 

296 

297 

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. 

305 

306 Route: ``GET /ctrl/clock/timeserver`` 

307 ABB constraints: Available only for RC Not supported in bootserver mode 

308 

309 Args: 

310 client: Open RWSClient instance. 

311 resource: Query parameter. Optional. 

312 server_ip: Query parameter. Optional. 

313 

314 Returns: 

315 Raw HTTP response. Expected success: HTTP 200. 

316 

317 Raises: 

318 RWSAuthenticationError: On HTTP 401. 

319 RWSNotFoundError: On HTTP 404. 

320 RWSHTTPError: On any other HTTP >= 400. 

321 # ABB codes: See 

322 

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 )