0
# Build Management
1
2
Actor build operations including triggering builds, monitoring progress, and accessing build artifacts. Builds create executable versions of Actors from source code.
3
4
## Capabilities
5
6
### Build Operations
7
8
```python { .api }
9
class BuildClient:
10
def get(self) -> dict | None:
11
"""Get build information including status and logs."""
12
13
def delete(self) -> None:
14
"""Delete build."""
15
16
def abort(self) -> dict:
17
"""Abort running build."""
18
19
def get_open_api_definition(self) -> dict | None:
20
"""Get OpenAPI definition for the build."""
21
22
def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
23
"""Wait for build completion.
24
25
Args:
26
wait_secs: Maximum wait time in seconds
27
"""
28
29
def log(self) -> LogClient:
30
"""Get build log client."""
31
32
class BuildClientAsync:
33
"""Async version of BuildClient with identical methods."""
34
35
class BuildCollectionClient:
36
def list(
37
self,
38
*,
39
limit: int | None = None,
40
offset: int | None = None,
41
desc: bool | None = None
42
) -> ListPage[dict]:
43
"""List Actor builds.
44
45
Args:
46
limit: Maximum number of builds
47
offset: Pagination offset
48
desc: Sort in descending order
49
"""
50
51
class BuildCollectionClientAsync:
52
"""Async version of BuildCollectionClient with identical methods."""
53
```
54
55
## Usage Examples
56
57
```python
58
from apify_client import ApifyClient
59
60
client = ApifyClient('your-api-token')
61
62
# Trigger Actor build
63
actor = client.actor('my-actor-id')
64
build = actor.build(version_number='1.2.3', tag='production')
65
66
# Monitor build progress
67
build_client = client.build(build['id'])
68
result = build_client.wait_for_finish(wait_secs=600)
69
70
if result and result['status'] == 'SUCCEEDED':
71
print("Build completed successfully")
72
else:
73
print("Build failed or timed out")
74
```