Coverage for abb_rws_client_python_rw6/rws/mastership.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: RobotWare Services → Mastership service → Get Mastership Resources 

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_mastership_resources(client: RWSClient) -> httpx.Response: 

20 """ 

21 Get Mastership Resources. 

22 

23 Route: ``GET /rw/mastership`` 

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: BAD_REQUEST(400) 

37 

38 Example: 

39 ```python 

40 >>> await get_mastership_resources(client) 

41 <Response [200]> 

42 ``` 

43 """ 

44 return await client.get("/rw/mastership") 

45 

46 

47async def get_mastership_actions( 

48 client: RWSClient, 

49 action: str | None = None, 

50) -> httpx.Response: 

51 """ 

52 Get Mastership Actions. 

53 

54 Route: ``GET /rw/mastership`` 

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: BAD_REQUEST(400) 

69 

70 Example: 

71 ```python 

72 >>> await get_mastership_actions(client) 

73 <Response [200]> 

74 ``` 

75 """ 

76 return await client.get( 

77 "/rw/mastership", 

78 params={k: v for k, v in {"action": action}.items() if v is not None}, 

79 ) 

80 

81 

82async def post_mastership_request( 

83 client: RWSClient, 

84 action: str | None = None, 

85) -> httpx.Response: 

86 """ 

87 Mastership request. 

88 

89 Route: ``POST /rw/mastership`` 

90 ABB constraints: Not supported in bootserver mode In manual mode, mastership can be gained 

91 after getting RMMP. 

92 

93 Args: 

94 client: Open RWSClient instance. 

95 action: Query parameter. Optional. 

96 

97 Returns: 

98 Raw HTTP response. Expected success: HTTP 204. 

99 

100 Raises: 

101 RWSAuthenticationError: On HTTP 401. 

102 RWSNotFoundError: On HTTP 404. 

103 RWSHTTPError: On any other HTTP >= 400. 

104 # ABB codes: BAD_REQUEST(400) 

105 

106 Example: 

107 ```python 

108 >>> await post_mastership_request(client) 

109 <Response [204]> 

110 ``` 

111 """ 

112 return await client.post( 

113 "/rw/mastership", 

114 params={k: v for k, v in {"action": action}.items() if v is not None}, 

115 data={}, 

116 ) 

117 

118 

119async def post_mastership_release( 

120 client: RWSClient, 

121 action: str | None = None, 

122) -> httpx.Response: 

123 """ 

124 Mastership release. 

125 

126 Route: ``POST /rw/mastership`` 

127 ABB constraints: Not supported in bootserver mode 

128 

129 Args: 

130 client: Open RWSClient instance. 

131 action: Query parameter. Optional. 

132 

133 Returns: 

134 Raw HTTP response. Expected success: HTTP 204. 

135 

136 Raises: 

137 RWSAuthenticationError: On HTTP 401. 

138 RWSNotFoundError: On HTTP 404. 

139 RWSHTTPError: On any other HTTP >= 400. 

140 # ABB codes: BAD_REQUEST(400) 

141 

142 Example: 

143 ```python 

144 >>> await post_mastership_release(client) 

145 <Response [204]> 

146 ``` 

147 """ 

148 return await client.post( 

149 "/rw/mastership", 

150 params={k: v for k, v in {"action": action}.items() if v is not None}, 

151 data={}, 

152 ) 

153 

154 

155async def post_mastership_subscribe( 

156 client: RWSClient, 

157 identifier: str | None = None, 

158 identifier_p: str | None = None, 

159) -> httpx.Response: 

160 """ 

161 Mastership Subscribe. 

162 

163 Route: ``POST /subscription`` 

164 ABB constraints: Not supported in bootserver mode 

165 

166 Args: 

167 client: Open RWSClient instance. 

168 identifier: Body parameter. Optional. 

169 identifier_p: Body parameter. Optional. 

170 

171 Returns: 

172 Raw HTTP response. Expected success: HTTP 201. 

173 

174 Raises: 

175 RWSAuthenticationError: On HTTP 401. 

176 RWSNotFoundError: On HTTP 404. 

177 RWSHTTPError: On any other HTTP >= 400. 

178 # ABB codes: BAD_REQUEST(400) 

179 

180 Example: 

181 ```python 

182 >>> await post_mastership_subscribe(client) 

183 <Response [201]> 

184 ``` 

185 """ 

186 return await client.post( 

187 "/subscription", 

188 data={ 

189 k: v 

190 for k, v in {"identifier": identifier, "identifier_p": identifier_p}.items() 

191 if v is not None 

192 }, 

193 ) 

194 

195 

196async def get_mastership_domain( 

197 client: RWSClient, 

198 domain_name: str, 

199) -> httpx.Response: 

200 """ 

201 Get Mastership Domain. 

202 

203 Route: ``GET /rw/mastership/{domain-name}`` 

204 ABB constraints: Not supported in bootserver mode 

205 

206 Args: 

207 client: Open RWSClient instance. 

208 domain_name: URL path parameter. 

209 

210 Returns: 

211 Raw HTTP response. Expected success: HTTP 200. 

212 

213 Raises: 

214 RWSAuthenticationError: On HTTP 401. 

215 RWSNotFoundError: On HTTP 404. 

216 RWSHTTPError: On any other HTTP >= 400. 

217 # ABB codes: BAD_REQUEST(400) 

218 

219 Example: 

220 ```python 

221 >>> await get_mastership_domain(client, "domain_name_value") 

222 <Response [200]> 

223 ``` 

224 """ 

225 return await client.get(f"/rw/mastership/{domain_name}") 

226 

227 

228async def get_mastership_domain_actions( 

229 client: RWSClient, 

230 domain_name: str, 

231 action: str | None = None, 

232) -> httpx.Response: 

233 """ 

234 Get Mastership Domain Actions. 

235 

236 Route: ``GET /rw/mastership/{domain-name}`` 

237 ABB constraints: Not supported in bootserver mode 

238 

239 Args: 

240 client: Open RWSClient instance. 

241 domain_name: URL path parameter. 

242 action: Query parameter. Optional. 

243 

244 Returns: 

245 Raw HTTP response. Expected success: HTTP 200. 

246 

247 Raises: 

248 RWSAuthenticationError: On HTTP 401. 

249 RWSNotFoundError: On HTTP 404. 

250 RWSHTTPError: On any other HTTP >= 400. 

251 # ABB codes: BAD_REQUEST(400) 

252 

253 Example: 

254 ```python 

255 >>> await get_mastership_domain_actions(client, "domain_name_value") 

256 <Response [200]> 

257 ``` 

258 """ 

259 return await client.get( 

260 f"/rw/mastership/{domain_name}", 

261 params={k: v for k, v in {"action": action}.items() if v is not None}, 

262 ) 

263 

264 

265async def post_mastership_domain_request( 

266 client: RWSClient, 

267 domain: str, 

268 action: str | None = None, 

269) -> httpx.Response: 

270 """ 

271 Mastership domain request. 

272 

273 Route: ``POST /rw/mastership/{domain}`` 

274 ABB constraints: Not supported in bootserver mode In manual mode, mastership can be gained 

275 after getting RMMP. 

276 

277 Args: 

278 client: Open RWSClient instance. 

279 domain: URL path parameter. 

280 action: Query parameter. Optional. 

281 

282 Returns: 

283 Raw HTTP response. Expected success: HTTP 204. 

284 

285 Raises: 

286 RWSAuthenticationError: On HTTP 401. 

287 RWSNotFoundError: On HTTP 404. 

288 RWSHTTPError: On any other HTTP >= 400. 

289 # ABB codes: NOT_FOUND(404) 

290 

291 Example: 

292 ```python 

293 >>> await post_mastership_domain_request(client, "domain_value") 

294 <Response [204]> 

295 ``` 

296 """ 

297 return await client.post( 

298 f"/rw/mastership/{domain}", 

299 params={k: v for k, v in {"action": action}.items() if v is not None}, 

300 data={}, 

301 ) 

302 

303 

304async def post_mastership_domain_release( 

305 client: RWSClient, 

306 domain: str, 

307 action: str | None = None, 

308) -> httpx.Response: 

309 """ 

310 Mastership Domain release. 

311 

312 Route: ``POST /rw/mastership/{domain}`` 

313 ABB constraints: Not supported in bootserver mode 

314 

315 Args: 

316 client: Open RWSClient instance. 

317 domain: URL path parameter. 

318 action: Query parameter. Optional. 

319 

320 Returns: 

321 Raw HTTP response. Expected success: HTTP 204. 

322 

323 Raises: 

324 RWSAuthenticationError: On HTTP 401. 

325 RWSNotFoundError: On HTTP 404. 

326 RWSHTTPError: On any other HTTP >= 400. 

327 # ABB codes: NOT_FOUND(404) 

328 

329 Example: 

330 ```python 

331 >>> await post_mastership_domain_release(client, "domain_value") 

332 <Response [204]> 

333 ``` 

334 """ 

335 return await client.post( 

336 f"/rw/mastership/{domain}", 

337 params={k: v for k, v in {"action": action}.items() if v is not None}, 

338 data={}, 

339 ) 

340 

341 

342async def post_mastership_domain_subscribe( 

343 client: RWSClient, 

344 identifier: str | None = None, 

345 identifier_p: str | None = None, 

346) -> httpx.Response: 

347 """ 

348 Mastership Domain Subscribe. 

349 

350 Route: ``POST /subscription`` 

351 ABB constraints: Not supported in bootserver mode 

352 

353 Args: 

354 client: Open RWSClient instance. 

355 identifier: Body parameter. Optional. 

356 identifier_p: Body parameter. Optional. 

357 

358 Returns: 

359 Raw HTTP response. Expected success: HTTP 201. 

360 

361 Raises: 

362 RWSAuthenticationError: On HTTP 401. 

363 RWSNotFoundError: On HTTP 404. 

364 RWSHTTPError: On any other HTTP >= 400. 

365 # ABB codes: BAD_REQUEST(400) 

366 

367 Example: 

368 ```python 

369 >>> await post_mastership_domain_subscribe(client) 

370 <Response [201]> 

371 ``` 

372 """ 

373 return await client.post( 

374 "/subscription", 

375 data={ 

376 k: v 

377 for k, v in {"identifier": identifier, "identifier_p": identifier_p}.items() 

378 if v is not None 

379 }, 

380 )