Skip to content

Commit b5f343b

Browse files
authored
docs(openapi): Add undocumented rq endpoints (#2440)
### Description - Add undocumented, but public API endpoints related to the request queue: - Actor run default rq - last Actor run default rq - Abstract reusable parts of nearly duplicate endpoints and use references. (More undocumented endpoints will be added in follow-up PRs) ### Issues Partially implements: #2286
1 parent a69cf05 commit b5f343b

File tree

37 files changed

+1491
-854
lines changed

37 files changed

+1491
-854
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
commonErrors: &commonErrors
2+
"400":
3+
$ref: ../../responses/BadRequest.yaml
4+
"401":
5+
$ref: ../../responses/Unauthorized.yaml
6+
"403":
7+
$ref: ../../responses/Forbidden.yaml
8+
"404":
9+
$ref: ../../responses/NotFound.yaml
10+
"405":
11+
$ref: ../../responses/MethodNotAllowed.yaml
12+
"429":
13+
$ref: ../../responses/TooManyRequests.yaml
14+
15+
sharedTagById: &sharedTagById
16+
tags:
17+
- Storage/Request queues/Requests locks
18+
19+
sharedTagDefault: &sharedTagDefault
20+
tags:
21+
- Default request queue
22+
23+
sharedTagLastRun: &sharedTagLastRun
24+
tags:
25+
- Last Actor run's default request queue
26+
27+
sharedPost: &sharedPost
28+
responses:
29+
"201":
30+
description: ""
31+
headers: {}
32+
content:
33+
application/json:
34+
schema:
35+
$ref: ../../schemas/request-queues/HeadAndLockResponse.yaml
36+
<<: *commonErrors
37+
deprecated: false
38+
39+
postById:
40+
<<: [*sharedPost, *sharedTagById]
41+
summary: Get head and lock
42+
description: |
43+
Returns the given number of first requests from the queue and locks them for
44+
the given time.
45+
46+
If this endpoint locks the request, no other client or run will be able to get and
47+
lock these requests.
48+
49+
The response contains the `hadMultipleClients` boolean field which indicates
50+
that the queue was accessed by more than one client (with unique or empty
51+
`clientKey`).
52+
operationId: requestQueue_head_lock_post
53+
parameters:
54+
- $ref: "../../parameters/requestQueueParameters.yaml#/queueId"
55+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockSecs"
56+
- $ref: "../../parameters/requestQueueParameters.yaml#/headLockLimit"
57+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
58+
x-legacy-doc-urls:
59+
- https://docs.apify.com/api/v2#/reference/request-queues/queue-head-with-locks/get-head-and-lock
60+
- https://docs.apify.com/api/v2#/reference/request-queues/get-head-and-lock
61+
- https://docs.apify.com/api/v2#tag/Request-queuesQueue-head-with-locks/operation/requestQueue_head_lock_post
62+
x-js-parent: RequestQueueClient
63+
x-js-name: listAndLockHead
64+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#listAndLockHead
65+
x-py-parent: RequestQueueClientAsync
66+
x-py-name: list_and_lock_head
67+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_and_lock_head
68+
69+
postDefault:
70+
<<: [*sharedPost, *sharedTagDefault]
71+
summary: Get and lock default request queue head
72+
description: |
73+
Returns the given number of first requests from the default request queue of the Actor run
74+
and locks them for the given time.
75+
76+
This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
77+
[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint.
78+
operationId: actorRun_requestQueue_head_lock_post
79+
parameters:
80+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
81+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockSecs"
82+
- $ref: "../../parameters/requestQueueParameters.yaml#/headLockLimit"
83+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
84+
85+
postLastRun:
86+
<<: [*sharedPost, *sharedTagLastRun]
87+
summary: Get and lock last run's default request queue head
88+
description: |
89+
Returns the given number of first requests from the default request queue of the last Actor run
90+
and locks them for the given time.
91+
92+
This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the
93+
[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint.
94+
operationId: act_runs_last_requestQueue_head_lock_post
95+
parameters:
96+
- $ref: "../../parameters/runAndBuildParameters.yaml#/actorId"
97+
- $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun"
98+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockSecs"
99+
- $ref: "../../parameters/requestQueueParameters.yaml#/headLockLimit"
100+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
commonErrors: &commonErrors
2+
"400":
3+
$ref: ../../responses/BadRequest.yaml
4+
"401":
5+
$ref: ../../responses/Unauthorized.yaml
6+
"403":
7+
$ref: ../../responses/Forbidden.yaml
8+
"404":
9+
$ref: ../../responses/NotFound.yaml
10+
"405":
11+
$ref: ../../responses/MethodNotAllowed.yaml
12+
"429":
13+
$ref: ../../responses/TooManyRequests.yaml
14+
15+
sharedTagById: &sharedTagById
16+
tags:
17+
- Storage/Request queues/Requests locks
18+
19+
sharedTagDefault: &sharedTagDefault
20+
tags:
21+
- Default request queue
22+
23+
sharedTagLastRun: &sharedTagLastRun
24+
tags:
25+
- Last Actor run's default request queue
26+
27+
sharedGet: &sharedGet
28+
responses:
29+
"200":
30+
description: ""
31+
headers: {}
32+
content:
33+
application/json:
34+
schema:
35+
$ref: ../../schemas/request-queues/HeadResponse.yaml
36+
<<: *commonErrors
37+
deprecated: false
38+
39+
getById:
40+
<<: [*sharedGet, *sharedTagById]
41+
summary: Get head
42+
description: |
43+
Returns given number of first requests from the queue.
44+
45+
The response contains the `hadMultipleClients` boolean field which indicates
46+
that the queue was accessed by more than one client (with unique or empty
47+
`clientKey`).
48+
This field is used by [Apify SDK](https://sdk.apify.com) to determine
49+
whether the local cache is consistent with the request queue, and thus
50+
optimize performance of certain operations.
51+
operationId: requestQueue_head_get
52+
parameters:
53+
- $ref: "../../parameters/requestQueueParameters.yaml#/queueId"
54+
- $ref: "../../parameters/requestQueueParameters.yaml#/headLimit"
55+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
56+
x-legacy-doc-urls:
57+
- https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head
58+
- https://docs.apify.com/api/v2#/reference/request-queues/get-head
59+
- https://docs.apify.com/api/v2#tag/Request-queuesQueue-head/operation/requestQueue_head_get
60+
x-js-parent: RequestQueueClient
61+
x-js-name: listHead
62+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#listHead
63+
x-py-parent: RequestQueueClientAsync
64+
x-py-name: list_head
65+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_head
66+
67+
getDefault:
68+
<<: [*sharedGet, *sharedTagDefault]
69+
summary: Get default request queue head
70+
description: |
71+
Returns the given number of first requests from the default request queue of the Actor run.
72+
73+
This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
74+
[Get head](/api/v2/request-queue-head-get) endpoint.
75+
operationId: actorRun_requestQueue_head_get
76+
parameters:
77+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
78+
- $ref: "../../parameters/requestQueueParameters.yaml#/headLimit"
79+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
80+
81+
getLastRun:
82+
<<: [*sharedGet, *sharedTagLastRun]
83+
summary: Get last run's default request queue head
84+
description: |
85+
Returns the given number of first requests from the default request queue of the last Actor run.
86+
87+
This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the
88+
[Get head](/api/v2/request-queue-head-get) endpoint.
89+
operationId: act_runs_last_requestQueue_head_get
90+
parameters:
91+
- $ref: "../../parameters/runAndBuildParameters.yaml#/actorId"
92+
- $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun"
93+
- $ref: "../../parameters/requestQueueParameters.yaml#/headLimit"
94+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
commonErrors: &commonErrors
2+
"400":
3+
$ref: ../../responses/BadRequest.yaml
4+
"401":
5+
$ref: ../../responses/Unauthorized.yaml
6+
"403":
7+
$ref: ../../responses/Forbidden.yaml
8+
"404":
9+
$ref: ../../responses/NotFound.yaml
10+
"405":
11+
$ref: ../../responses/MethodNotAllowed.yaml
12+
"429":
13+
$ref: ../../responses/TooManyRequests.yaml
14+
15+
sharedTagById: &sharedTagById
16+
tags:
17+
- Storage/Request queues/Requests locks
18+
19+
sharedTagDefault: &sharedTagDefault
20+
tags:
21+
- Default request queue
22+
23+
sharedTagLastRun: &sharedTagLastRun
24+
tags:
25+
- Last Actor run's default request queue
26+
27+
sharedPut: &sharedPut
28+
responses:
29+
"200":
30+
description: ""
31+
headers: {}
32+
content:
33+
application/json:
34+
schema:
35+
$ref: ../../schemas/request-queues/ProlongRequestLockResponse.yaml
36+
<<: *commonErrors
37+
deprecated: false
38+
39+
putById:
40+
<<: [*sharedPut, *sharedTagById]
41+
summary: Prolong request lock
42+
description: |
43+
Prolongs request lock. The request lock can be prolonged only by the client
44+
that has locked it using [Get and lock head
45+
operation](#/request-queue-head-lock-post).
46+
47+
The clientKey identifier is used for locking and unlocking requests.
48+
You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run.
49+
operationId: requestQueue_request_lock_put
50+
parameters:
51+
- $ref: "../../parameters/requestQueueParameters.yaml#/queueId"
52+
- $ref: "../../parameters/requestQueueParameters.yaml#/requestId"
53+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockSecs"
54+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
55+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockForefront"
56+
x-legacy-doc-urls:
57+
- https://docs.apify.com/api/v2#/reference/request-queues/request-lock/prolong-request-lock
58+
- https://docs.apify.com/api/v2#/reference/request-queues/prolong-request-lock
59+
- https://docs.apify.com/api/v2#tag/Request-queuesRequest-lock/operation/requestQueue_request_lock_put
60+
x-js-parent: RequestQueueClient
61+
x-js-name: prolongRequestLock
62+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#prolongRequestLock
63+
x-py-parent: RequestQueueClientAsync
64+
x-py-name: prolong_request_lock
65+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#prolong_request_lock
66+
67+
putDefault:
68+
<<: [*sharedPut, *sharedTagDefault]
69+
summary: Prolong lock on request in default request queue
70+
description: |
71+
Prolongs a request lock in the default request queue of the Actor run.
72+
73+
This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
74+
[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint.
75+
operationId: actorRun_requestQueue_request_lock_put
76+
parameters:
77+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
78+
- $ref: "../../parameters/requestQueueParameters.yaml#/requestId"
79+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockSecs"
80+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
81+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockForefront"
82+
83+
putLastRun:
84+
<<: [*sharedPut, *sharedTagLastRun]
85+
summary: Prolong lock on request in last run's default request queue
86+
description: |
87+
Prolongs a request lock in the default request queue of the last Actor run.
88+
89+
This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the
90+
[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint.
91+
operationId: act_runs_last_requestQueue_request_lock_put
92+
parameters:
93+
- $ref: "../../parameters/runAndBuildParameters.yaml#/actorId"
94+
- $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun"
95+
- $ref: "../../parameters/requestQueueParameters.yaml#/requestId"
96+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockSecs"
97+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
98+
- $ref: "../../parameters/requestQueueParameters.yaml#/lockForefront"
99+
100+
sharedDelete: &sharedDelete
101+
responses:
102+
<<: *commonErrors
103+
"204":
104+
$ref: ../../responses/NoContent.yaml
105+
deprecated: false
106+
107+
deleteById:
108+
<<: [*sharedDelete, *sharedTagById]
109+
summary: Delete request lock
110+
description: |
111+
Deletes a request lock. The request lock can be deleted only by the client
112+
that has locked it using [Get and lock head
113+
operation](#/request-queue-head-lock-post).
114+
115+
The clientKey identifier is used for locking and unlocking requests.
116+
You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run.
117+
operationId: requestQueue_request_lock_delete
118+
parameters:
119+
- $ref: "../../parameters/requestQueueParameters.yaml#/queueId"
120+
- $ref: "../../parameters/requestQueueParameters.yaml#/requestId"
121+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
122+
- $ref: "../../parameters/requestQueueParameters.yaml#/deleteForefront"
123+
x-legacy-doc-urls:
124+
- https://docs.apify.com/api/v2#/reference/request-queues/request-lock/delete-request-lock
125+
- https://docs.apify.com/api/v2#/reference/request-queues/delete-request-lock
126+
- https://docs.apify.com/api/v2#tag/Request-queuesRequest-lock/operation/requestQueue_request_lock_delete
127+
x-js-parent: RequestQueueClient
128+
x-js-name: deleteRequestLock
129+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#deleteRequestLock
130+
x-py-parent: RequestQueueClientAsync
131+
x-py-name: delete_request_lock
132+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#delete_request_lock
133+
134+
deleteDefault:
135+
<<: [*sharedDelete, *sharedTagDefault]
136+
summary: Delete lock on request in default request queue
137+
description: |
138+
Deletes a request lock in the default request queue of the Actor run.
139+
140+
This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
141+
[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint.
142+
operationId: actorRun_requestQueue_request_lock_delete
143+
parameters:
144+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
145+
- $ref: "../../parameters/requestQueueParameters.yaml#/requestId"
146+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
147+
- $ref: "../../parameters/requestQueueParameters.yaml#/deleteForefront"
148+
149+
deleteLastRun:
150+
<<: [*sharedDelete, *sharedTagLastRun]
151+
summary: Delete lock on request in last run's default request queue
152+
description: |
153+
Deletes a request lock in the default request queue of the last Actor run.
154+
155+
This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the
156+
[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint.
157+
operationId: act_runs_last_requestQueue_request_lock_delete
158+
parameters:
159+
- $ref: "../../parameters/runAndBuildParameters.yaml#/actorId"
160+
- $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun"
161+
- $ref: "../../parameters/requestQueueParameters.yaml#/requestId"
162+
- $ref: "../../parameters/requestQueueParameters.yaml#/clientKey"
163+
- $ref: "../../parameters/requestQueueParameters.yaml#/deleteForefront"

0 commit comments

Comments
 (0)