Reads information for a given work pool
Args:
work_pool_name: The name of the work pool to for which to get
information.
Returns:
Information about the requested work pool.
Source code in src/prefect/server/api/clients.py
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223 | async def read_work_pool(self, work_pool_name: str) -> WorkPool:
"""
Reads information for a given work pool
Args:
work_pool_name: The name of the work pool to for which to get
information.
Returns:
Information about the requested work pool.
"""
try:
response = await self._http_client.get(f"/work_pools/{work_pool_name}")
response.raise_for_status()
return WorkPool.model_validate(response.json())
except httpx.HTTPStatusError as e:
if e.response.status_code == status.HTTP_404_NOT_FOUND:
raise ObjectNotFound(http_exc=e) from e
else:
raise
|