Coverage for abb_rws_client_python_rw6/rws/ctrl/backup.py: 100%
19 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 Backup Resource → Get backup resources
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_backup_resources(client: RWSClient) -> httpx.Response:
20 """
21 Get backup resources.
23 Route: ``GET /ctrl/backup``
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.
37 Example:
38 ```python
39 >>> await get_backup_resources(client)
40 <Response [200]>
41 ```
42 """
43 return await client.get("/ctrl/backup")
46async def get_backup_actions(
47 client: RWSClient,
48 action: str | None = None,
49) -> httpx.Response:
50 """
51 Get backup actions.
53 Route: ``GET /ctrl/backup``
54 ABB constraints: Not supported in bootserver mode
56 Args:
57 client: Open RWSClient instance.
58 action: Query parameter. Optional.
60 Returns:
61 Raw HTTP response. Expected success: HTTP 200.
63 Raises:
64 RWSAuthenticationError: On HTTP 401.
65 RWSNotFoundError: On HTTP 404.
66 RWSHTTPError: On any other HTTP >= 400.
67 # ABB codes: BAD_REQUEST(400)
69 Example:
70 ```python
71 >>> await get_backup_actions(client)
72 <Response [200]>
73 ```
74 """
75 return await client.get(
76 "/ctrl/backup",
77 params={k: v for k, v in {"action": action}.items() if v is not None},
78 )
81async def create_backup(
82 client: RWSClient,
83 action: str | None = None,
84 environment_variables_such_as_temp_sys: str | None = None,
85 archive: str | None = None,
86) -> httpx.Response:
87 """
88 Create a Backup.
90 Route: ``POST /ctrl/backup``
91 ABB constraints: Requires UAS grant UAS_BACKUP. It is not possible to create backup with the
92 same path and name as an environment variable directory (SYSTEM, HOME, SYSPAR etc). It is
93 not possible create backup under HOME directory. Since backup is an asynchronous task,
94 the location header can be subscribed on to ...
96 Args:
97 client: Open RWSClient instance.
98 action: Query parameter. Optional.
99 environment_variables_such_as_temp_sys: Body parameter. Optional.
100 archive: Body parameter. Optional.
102 Returns:
103 Raw HTTP response. Expected success: HTTP 202.
105 Raises:
106 RWSAuthenticationError: On HTTP 401.
107 RWSNotFoundError: On HTTP 404.
108 RWSHTTPError: On any other HTTP >= 400.
109 # ABB codes: UNAUTHORIZED(401), FORBIDDEN(403), BAD_REQUEST(400), CONFLICT(409)
111 Example:
112 ```python
113 >>> await create_backup(client)
114 <Response [202]>
115 ```
116 """
117 return await client.post(
118 "/ctrl/backup",
119 params={k: v for k, v in {"action": action}.items() if v is not None},
120 data={
121 k: v
122 for k, v in {
123 "environment_variables_such_as_temp_sys": environment_variables_such_as_temp_sys,
124 "archive": archive,
125 }.items()
126 if v is not None
127 },
128 )
131async def post_restore_backup(
132 client: RWSClient,
133 action: str | None = None,
134 path_must_be_part_of_the_controller_fi: str | None = None,
135) -> httpx.Response:
136 """
137 Restore a backup..
139 Route: ``POST /ctrl/backup``
140 ABB constraints: Requires UAS grant Restore a backup Not supported in bootserver mode
142 Args:
143 client: Open RWSClient instance.
144 action: Query parameter. Optional.
145 path_must_be_part_of_the_controller_fi: Body parameter. Optional.
147 Returns:
148 Raw HTTP response. Expected success: HTTP 204.
150 Raises:
151 RWSAuthenticationError: On HTTP 401.
152 RWSNotFoundError: On HTTP 404.
153 RWSHTTPError: On any other HTTP >= 400.
154 # ABB codes: UNSUPPORTED_MEDIA(415), FORBIDDEN(403), BAD_REQUEST(400)
156 Example:
157 ```python
158 >>> await post_restore_backup(client)
159 <Response [204]>
160 ```
161 """
162 return await client.post(
163 "/ctrl/backup",
164 params={k: v for k, v in {"action": action}.items() if v is not None},
165 data={
166 k: v
167 for k, v in {
168 "path_must_be_part_of_the_controller_fi": path_must_be_part_of_the_controller_fi
169 }.items()
170 if v is not None
171 },
172 )
175async def get_check_restore(
176 client: RWSClient,
177 path_must_be_part_of_the_controller_fi: str | None = None,
178) -> httpx.Response:
179 """
180 Check Restore.
182 Route: ``GET /ctrl/backup``
183 ABB constraints: Not supported in bootserver mode
185 Args:
186 client: Open RWSClient instance.
187 path_must_be_part_of_the_controller_fi: Query parameter. Optional.
189 Returns:
190 Raw HTTP response. Expected success: HTTP 200.
192 Raises:
193 RWSAuthenticationError: On HTTP 401.
194 RWSNotFoundError: On HTTP 404.
195 RWSHTTPError: On any other HTTP >= 400.
196 # ABB codes: BAD_REQUEST(400)
198 Example:
199 ```python
200 >>> await get_check_restore(client)
201 <Response [200]>
202 ```
203 """
204 return await client.get(
205 "/ctrl/backup",
206 params={
207 k: v
208 for k, v in {
209 "path_must_be_part_of_the_controller_fi": path_must_be_part_of_the_controller_fi
210 }.items()
211 if v is not None
212 },
213 )
216async def get_backup_state(
217 client: RWSClient,
218 action: str | None = None,
219) -> httpx.Response:
220 """
221 Get Backup State.
223 Route: ``GET /ctrl/backup``
224 ABB constraints: Not supported in bootserver mode
226 Args:
227 client: Open RWSClient instance.
228 action: Query parameter. Optional.
230 Returns:
231 Raw HTTP response. Expected success: HTTP 200.
233 Raises:
234 RWSAuthenticationError: On HTTP 401.
235 RWSNotFoundError: On HTTP 404.
236 RWSHTTPError: On any other HTTP >= 400.
237 # ABB codes: BAD_REQUEST(400)
239 Example:
240 ```python
241 >>> await get_backup_state(client)
242 <Response [200]>
243 ```
244 """
245 return await client.get(
246 "/ctrl/backup",
247 params={k: v for k, v in {"action": action}.items() if v is not None},
248 )
251async def subscribe_on_backup_system_information(
252 client: RWSClient,
253 identifier: str | None = None,
254 identifier_p: str | None = None,
255) -> httpx.Response:
256 """
257 Subscribe on Backup System Information.
259 Route: ``POST /subscription``
260 ABB constraints: if the subscription is created during backup creation of the System
261 (backup.log is in progress),the state will be in "pending". Not supported in bootserver
262 mode. Not supported on virtual controller.
264 Args:
265 client: Open RWSClient instance.
266 identifier: Body parameter. Optional.
267 identifier_p: Body parameter. Optional.
269 Returns:
270 Raw HTTP response. Expected success: HTTP 201.
272 Raises:
273 RWSAuthenticationError: On HTTP 401.
274 RWSNotFoundError: On HTTP 404.
275 RWSHTTPError: On any other HTTP >= 400.
276 # ABB codes: BAD_REQUEST(400) See
278 Example:
279 ```python
280 >>> await subscribe_on_backup_system_information(client)
281 <Response [201]>
282 ```
283 """
284 return await client.post(
285 "/subscription",
286 data={
287 k: v
288 for k, v in {"identifier": identifier, "identifier_p": identifier_p}.items()
289 if v is not None
290 },
291 )
294async def get_backup_system_information(
295 client: RWSClient,
296 backup_path: str | None = None,
297) -> httpx.Response:
298 """
299 Get backup system information.
301 Route: ``GET /ctrl/backup/info/``
302 ABB constraints: Not Supported in bootserver mode
304 Args:
305 client: Open RWSClient instance.
306 backup_path: Query parameter. Optional.
308 Returns:
309 Raw HTTP response. Expected success: HTTP 200.
311 Raises:
312 RWSAuthenticationError: On HTTP 401.
313 RWSNotFoundError: On HTTP 404.
314 RWSHTTPError: On any other HTTP >= 400.
315 # ABB codes: See
317 Example:
318 ```python
319 >>> await get_backup_system_information(client)
320 <Response [200]>
321 ```
322 """
323 return await client.get(
324 "/ctrl/backup/info/",
325 params={k: v for k, v in {"backup_path": backup_path}.items() if v is not None},
326 )