Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added default build endpoint #1423

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apify-api/openapi/components/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
x-trait: 'true'
description: '**[DEPRECATED]** API endpoints related to build of the actor were
moved under new namespace [`actor-builds`](#/reference/actor-builds).'
- name: Actors/Default build object
x-displayName: Default build object
x-parent-tag-name: Actor builds
x-trait: 'true'
- name: Actors/Abort build
x-displayName: Abort build
x-parent-tag-name: Actors
Expand Down
1 change: 1 addition & 0 deletions apify-api/openapi/components/x-tag-groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Actors/Webhook collection
- Actors/Build collection
- Actors/Build object
- Actors/Default build object
- Actors/Abort build
- Actors/Run collection
- Actors/Run actor synchronously
Expand Down
2 changes: 2 additions & 0 deletions apify-api/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ paths:
$ref: 'paths/actors/acts@{actorId}@builds.yaml'
'/v2/acts/{actorId}/builds/{buildId}':
$ref: 'paths/actors/acts@{actorId}@builds@{buildId}.yaml'
'/v2/acts/{actorId}/builds/default':
$ref: 'paths/actors/acts@{actorId}@[email protected]'
'/v2/acts/{actorId}/builds/{buildId}/abort':
$ref: 'paths/actors/acts@{actorId}@builds@{buildId}@abort.yaml'
'/v2/acts/{actorId}/runs':
Expand Down
76 changes: 76 additions & 0 deletions apify-api/openapi/paths/actors/acts@{actorId}@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
get:
tags:
- Actors/Default build object
summary: Get default build
description: |
Get the default build for an Actor.

Use the optional `waitForFinish` parameter to synchronously wait for the build to finish.
This avoids the need for periodic polling when waiting for the build to complete.

This endpoint does not require an authentication token. Instead, calls are authenticated using the build's unique ID.
However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden.
operationId: act_build_default_get
security:
- apiKeyActorBuilds: []
- httpBearerActorBuilds: []
parameters:
- name: actorId
in: path
description: Actor ID or a tilde-separated owner's username and Actor name.
required: true
style: simple
schema:
type: string
example: janedoe~my-actor
- name: waitForFinish
in: query
description: |
The maximum number of seconds the server waits for the build to finish.
If the build finishes within this time, the returned build object will have a terminal status (e.g. `SUCCEEDED`),
otherwise it will have a transitional status (e.g. `RUNNING`).

By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS -->
style: form
explode: true
schema:
type: number
format: double
example: 60
responses:
'200':
description: ''
headers: {}
content:
application/json:
schema:
$ref: '../../components/schemas/actor-builds/GetBuildResponse.yaml'
example:
data:
id: HG7ML7M8z78YcAPEB
actId: janedoe~my-actor
userId: klmdEpoiojmdEMlk3
startedAt: '2019-11-30T07:34:24.202Z'
finishedAt: '2019-12-12T09:30:12.202Z'
status: SUCCEEDED
meta:
origin: WEB
clientIp: 172.234.12.34
userAgent: Mozilla/5.0 (iPad)
stats:
durationMillis: 1000
runTimeSecs: 45.718
computeUnits: 0.012699444444444444
options:
useCache: false
betaPackages: false
memoryMbytes: 1024
diskMbytes: 2048
usage:
ACTOR_COMPUTE_UNITS: 0.08
usageTotalUsd: 0.02
usageUsd:
ACTOR_COMPUTE_UNITS: 0.02
inputSchema: '{\n \"title\": \"Schema for ... }'
readme: '# Magic Actor\nThis Actor is magic.'
buildNumber: 0.1.1
Loading