Skip to content

Commit 521b1cb

Browse files
authored
Merge branch 'master' into feat/code-samples-webhooks
2 parents 8d83e2f + 8f36cb5 commit 521b1cb

File tree

19 files changed

+158
-26
lines changed

19 files changed

+158
-26
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
title: ChargeRunRequest
2+
required:
3+
- eventName
4+
- eventCount
5+
type: object
6+
properties:
7+
eventName:
8+
type: string
9+
example: ANALYZE_PAGE
10+
eventCount:
11+
type: number
12+
example: 1

apify-api/openapi/components/schemas/request-queues/GetHeadAndLockResponse.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ properties:
1111
example: 1000
1212
queueModifiedAt:
1313
type: string
14+
description: The modifiedAt is updated whenever the queue is modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the queue.
1415
example: '2018-03-14T23:00:00.000Z'
16+
queueHasLockedRequests:
17+
type: boolean
18+
description: Whether the queue contains requests locked by any client (either the one calling the endpoint or a different one).
19+
example: true
20+
clientKey:
21+
type: string
22+
example: client-one
1523
hadMultipleClients:
1624
type: boolean
1725
example: true

apify-api/openapi/components/schemas/request-queues/RequestQueue.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ properties:
2525
example: '2019-12-12T07:34:14.202Z'
2626
modifiedAt:
2727
type: string
28-
example: '2019-12-13T08:36:13.202Z'
28+
description: The modifiedAt is updated whenever the queue is modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the queue.
29+
example: '2030-12-13T08:36:13.202Z'
2930
accessedAt:
3031
type: string
3132
example: '2019-12-14T08:36:13.202Z'

apify-api/openapi/components/tags.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@
620620
x-displayName: Resurrect run
621621
x-parent-tag-name: Actor runs
622622
x-trait: 'true'
623+
- name: Actor runs/Charge events in run
624+
x-displayName: Charge events in run
625+
x-parent-tag-name: Actor runs
626+
x-trait: 'true'
623627
- name: Actor runs/Update status message
624628
x-displayName: Update status message
625629
x-parent-tag-name: Actor runs

apify-api/openapi/components/x-tag-groups.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Actor runs/Metamorph run
4141
- Actor runs/Reboot run
4242
- Actor runs/Resurrect run
43+
- Actor runs/Charge events in run
4344
- Actor runs/Update status message
4445
- name: Actor builds
4546
tags:

apify-api/openapi/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,8 @@ paths:
544544
$ref: paths/actor-runs/actor-runs@{runId}@reboot.yaml
545545
'/v2/actor-runs/{runId}/resurrect':
546546
$ref: paths/actor-runs/actor-runs@{runId}@resurrect.yaml
547+
'/v2/actor-runs/{runId}/charge':
548+
$ref: paths/actor-runs/actor-runs@{runId}@charge.yaml
547549
/v2/actor-builds:
548550
$ref: paths/actor-builds/actor-builds.yaml
549551
'/v2/actor-builds/{buildId}':
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
post:
2+
tags:
3+
- Actor runs/Charge events in run
4+
summary: Charge events in run
5+
description: |
6+
Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event).
7+
The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured,
8+
the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with.
9+
10+
Note that pay per events Actors are still in alpha. Please, reach out to us with any questions or feedback.
11+
operationId: PostChargeRun
12+
parameters:
13+
- name: runId
14+
in: path
15+
required: true
16+
schema:
17+
type: string
18+
example: 3KH8gEpp4d8uQSe8T
19+
description: Run ID.
20+
- name: idempotency-key
21+
in: header
22+
required: false
23+
schema:
24+
type: string
25+
example: 2024-12-09T01:23:45.000Z-random-uuid
26+
description: Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors.
27+
requestBody:
28+
description: 'Define which event, and how many times, you want to charge for.'
29+
content:
30+
application/json:
31+
schema:
32+
$ref: "../../components/schemas/actor-runs/ChargeRunRequest.yaml"
33+
example:
34+
eventName: 'ANALYZE_PAGE'
35+
eventCount: 1
36+
required: true
37+
responses:
38+
'201':
39+
description: 'The charge was successful. Note that you still have to make sure in your Actor that the total charge for the run respects the maximum value set by the user, as the API does not check this. Above the limit, the charges reported as successful in API will not be added to your payouts, but you will still bear the associated costs. Use the Apify charge manager or SDK to avoid having to deal with this manually.'
40+
deprecated: false
41+
x-js-parent: RunClient
42+
x-js-name: charge
43+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#charge
44+
x-py-parent: RunClientAsync
45+
x-py-name: charge
46+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#charge

apify-api/openapi/paths/request-queues/request-queues@{queueId}@[email protected]

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ post:
66
Returns the given number of first requests from the queue and locks them for
77
the given time.
88
9-
If this endpoint locks the request, no other client will be able to get and
9+
If this endpoint locks the request, no other client or run will be able to get and
1010
lock these requests.
1111
12-
1312
The response contains the `hadMultipleClients` boolean field which indicates
1413
that the queue was accessed by more than one client (with unique or empty
1514
`clientKey`).

apify-api/openapi/paths/request-queues/request-queues@{queueId}@requests@{requestId}@lock.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ put:
3737
- name: clientKey
3838
in: query
3939
description: |
40-
A unique identifier of the client accessing the request queue. It must
41-
be a string between 1 and 32 characters long. This identifier is used to
42-
ensure one client is not to able delete or prolong
43-
44-
a request from another client.
40+
A unique identifier of the client accessing the request queue. It must
41+
be a string between 1 and 32 characters long. This identifier is used to for locking
42+
and unlocking requests. You can delete or prolong lock only for requests that were locked by by same
43+
client key or from the same Actor run.
4544
style: form
4645
explode: true
4746
schema:
@@ -121,11 +120,10 @@ delete:
121120
- name: clientKey
122121
in: query
123122
description: |
124-
A unique identifier of the client accessing the request queue. It must
125-
be a string between 1 and 32 characters long. This identifier is used to
126-
ensure one client is not to able delete or prolong
127-
128-
a request from another client.
123+
A unique identifier of the client accessing the request queue. It must
124+
be a string between 1 and 32 characters long. This identifier is used to for locking
125+
and unlocking requests. You can delete or prolong lock only for requests that were locked by by same
126+
client key or from the same Actor run.
129127
style: form
130128
explode: true
131129
schema:

nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,7 @@ server {
324324
}
325325
# Redirect rule for "upgrading-to-v03" to "upgrading-to-v0x"
326326
rewrite ^/python/docs/upgrading/upgrading-to-v03$ /python/docs/upgrading/upgrading-to-v0x permanent;
327+
328+
# Redirect rule so that /python/docs actually leads somewhere
329+
rewrite ^/python/docs/?$ /python/docs/quick-start;
327330
}

0 commit comments

Comments
 (0)