Skip to content

Commit 0b361f5

Browse files
committed
Add default dataset related redispatch endpoints
1 parent d83b144 commit 0b361f5

13 files changed

Lines changed: 762 additions & 528 deletions

apify-api/openapi/components/objects/datasets/dataset-items.yaml

Lines changed: 440 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
sharedGet: &sharedGet
2+
responses:
3+
"200":
4+
description: ""
5+
content:
6+
application/json:
7+
schema:
8+
$ref: ../../schemas/datasets/DatasetStatisticsResponse.yaml
9+
"400":
10+
$ref: ../../responses/BadRequest.yaml
11+
"401":
12+
$ref: ../../responses/Unauthorized.yaml
13+
"403":
14+
$ref: ../../responses/Forbidden.yaml
15+
"404":
16+
$ref: ../../responses/NotFound.yaml
17+
"405":
18+
$ref: ../../responses/MethodNotAllowed.yaml
19+
"429":
20+
$ref: ../../responses/TooManyRequests.yaml
21+
22+
getById:
23+
<<: *sharedGet
24+
tags:
25+
- Storage/Datasets
26+
summary: Get dataset statistics
27+
description: |
28+
Returns statistics for given dataset.
29+
30+
Provides only [field statistics](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics).
31+
32+
operationId: dataset_statistics_get
33+
parameters:
34+
- $ref: "../../parameters/storageParameters.yaml#/datasetId"
35+
36+
getDefault:
37+
<<: *sharedGet
38+
tags:
39+
- Default storages
40+
summary: Get default dataset statistics
41+
description: |
42+
Returns statistics for the Actor run's default dataset.
43+
44+
This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the
45+
[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint.
46+
operationId: actorRun_dataset_statistics_get
47+
parameters:
48+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
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+
sharedGet: &sharedGet
16+
responses:
17+
<<: *commonErrors
18+
"200":
19+
description: ""
20+
headers: {}
21+
content:
22+
application/json:
23+
schema:
24+
$ref: ../../schemas/datasets/DatasetResponse.yaml
25+
deprecated: false
26+
27+
getById:
28+
<<: *sharedGet
29+
tags:
30+
- Storage/Datasets
31+
summary: Get dataset
32+
description: |
33+
Returns dataset object for given dataset ID.
34+
35+
This does not return dataset items, only information about the storage itself.
36+
To retrieve dataset items, use the [List dataset items](/api/v2/dataset-items-get) endpoint.
37+
38+
:::note
39+
40+
Keep in mind that attributes `itemCount` and `cleanItemCount` are not propagated right away after data are pushed into a dataset.
41+
42+
:::
43+
44+
There is a short period (up to 5 seconds) during which these counters may not match with exact counts in dataset items.
45+
operationId: dataset_get
46+
parameters:
47+
- $ref: "../../parameters/storageParameters.yaml#/datasetId"
48+
- name: token
49+
in: query
50+
description: |
51+
API authentication token. It is required only when using the `username~dataset-name` format for `datasetId`.
52+
style: form
53+
explode: true
54+
schema:
55+
type: string
56+
example: soSkq9ekdmfOslopH
57+
x-legacy-doc-urls:
58+
- https://docs.apify.com/api/v2#/reference/datasets/dataset/get-dataset
59+
- https://docs.apify.com/api/v2#/reference/datasets/get-dataset
60+
- https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_get
61+
x-js-parent: DatasetClient
62+
x-js-name: get
63+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#get
64+
x-py-parent: DatasetClientAsync
65+
x-py-name: get
66+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#get
67+
68+
getDefault:
69+
<<: *sharedGet
70+
tags:
71+
- Default storages
72+
summary: Get default dataset
73+
description: |
74+
Returns the default dataset associated with an Actor run.
75+
76+
This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the
77+
[Get dataset](/api/v2/dataset-get) endpoint.
78+
79+
operationId: actorRun_dataset_get
80+
parameters:
81+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
82+
83+
sharedPut: &sharedPut
84+
requestBody:
85+
description: ""
86+
content:
87+
application/json:
88+
schema:
89+
$ref: ../../schemas/datasets/UpdateDatasetRequest.yaml
90+
required: true
91+
responses:
92+
<<: *commonErrors
93+
"200":
94+
description: ""
95+
headers: {}
96+
content:
97+
application/json:
98+
schema:
99+
$ref: ../../schemas/datasets/DatasetResponse.yaml
100+
"413":
101+
$ref: ../../responses/PayloadTooLarge.yaml
102+
"415":
103+
$ref: ../../responses/UnsupportedMediaType.yaml
104+
deprecated: false
105+
106+
putById:
107+
<<: *sharedPut
108+
tags:
109+
- Storage/Datasets
110+
summary: Update dataset
111+
description: |
112+
Updates a dataset's name and general resource access level using a value specified by a JSON object passed in the PUT payload.
113+
The response is the updated dataset object, as returned by the [Get dataset](/api/v2/dataset-get) API endpoint.
114+
operationId:
115+
dataset_put
116+
parameters:
117+
- $ref: "../../parameters/storageParameters.yaml#/datasetId"
118+
x-legacy-doc-urls:
119+
- https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset
120+
- https://docs.apify.com/api/v2#/reference/datasets/update-dataset
121+
- https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_put
122+
x-js-parent: DatasetClient
123+
x-js-name: update
124+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#update
125+
x-py-parent: DatasetClientAsync
126+
x-py-name: update
127+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#update
128+
129+
putDefault:
130+
<<: *sharedPut
131+
tags:
132+
- Default storages
133+
summary: Update default dataset
134+
description: |
135+
Updates the default dataset associated with an Actor run.
136+
137+
This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the
138+
[Put dataset](/api/v2/dataset-put) endpoint.
139+
140+
operationId: actorRun_dataset_put
141+
parameters:
142+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"
143+
144+
sharedDelete: &sharedDelete
145+
responses:
146+
<<: *commonErrors
147+
"204":
148+
$ref: ../../responses/NoContent.yaml
149+
deprecated: false
150+
151+
deleteById:
152+
<<: *sharedDelete
153+
tags:
154+
- Storage/Datasets
155+
summary: Delete dataset
156+
description: Deletes a specific dataset.
157+
operationId: dataset_delete
158+
parameters:
159+
- $ref: "../../parameters/storageParameters.yaml#/datasetId"
160+
x-legacy-doc-urls:
161+
- https://docs.apify.com/api/v2#/reference/datasets/dataset/delete-dataset
162+
- https://docs.apify.com/api/v2#/reference/datasets/delete-dataset
163+
- https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_delete
164+
x-js-parent: DatasetClient
165+
x-js-name: delete
166+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#delete
167+
168+
deleteDefault:
169+
<<: *sharedDelete
170+
tags:
171+
- Default storages
172+
summary: Delete default dataset
173+
description: Deletes default dataset associated with an Actor run.
174+
operationId: actorRun_dataset_delete
175+
parameters:
176+
- $ref: "../../parameters/runAndBuildParameters.yaml#/runId"

apify-api/openapi/components/tags.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -406,20 +406,6 @@
406406
407407
:::
408408
x-trait: true
409-
- name: Tools
410-
x-displayName: Tools - Introduction
411-
description: |
412-
The API endpoints described in this section provide utility tools for encoding,
413-
signing, and verifying data, as well as inspecting HTTP request details.
414-
415-
- **Browser info** (`/v2/browser-info`) - Returns details about the incoming HTTP request,
416-
including the client IP address, country code, and headers. Accepts any HTTP method
417-
(GET, POST, PUT, DELETE) so you can use it to test proxy behavior and verify that
418-
client IP addresses are anonymized correctly.
419-
- **Encode and sign** (`/v2/tools/encode-and-sign`) - Encodes and signs a JSON object,
420-
tying it to the authenticated user's identity.
421-
- **Decode and verify** (`/v2/tools/decode-and-verify`) - Decodes and verifies a value
422-
previously created by the encode-and-sign endpoint.
423409
- name: Users
424410
x-displayName: Users - Introduction
425411
x-legacy-doc-urls:
@@ -436,3 +422,12 @@
436422
description: The API endpoints described in this section return information about
437423
user accounts.
438424
x-trait: true
425+
- name: Tools
426+
x-displayName: Tools - Introduction
427+
description: |
428+
The API endpoints described in this section provide utility tools for encoding,
429+
signing, and verifying data, as well as inspecting HTTP request details.
430+
- name: Default storages
431+
x-displayName: Default storages - Introduction
432+
description: |
433+
The API endpoints described in this section are convenience endpoints that provide access to Actor run's default storages (dataset, key-value store, and request queue) without the need to resolve the storage ID first.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@
4141
- name: Tools
4242
tags:
4343
- Tools
44+
- name: Convenience endpoints
45+
tags:
46+
- Default storages

apify-api/openapi/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,12 @@ paths:
550550
$ref: paths/actor-runs/actor-runs@{runId}@resurrect.yaml
551551
"/v2/actor-runs/{runId}/charge":
552552
$ref: paths/actor-runs/actor-runs@{runId}@charge.yaml
553+
"/v2/actor-runs/{runId}/dataset":
554+
$ref: paths/actor-runs/actor-runs@{runId}@dataset.yaml
555+
"/v2/actor-runs/{runId}/dataset/items":
556+
$ref: "paths/actor-runs/actor-runs@{runId}@dataset@items.yaml"
557+
"/v2/actor-runs/{runId}/dataset/statistics":
558+
$ref: "paths/actor-runs/actor-runs@{runId}@dataset@statistics.yaml"
553559
/v2/actor-builds:
554560
$ref: paths/actor-builds/actor-builds.yaml
555561
"/v2/actor-builds/{buildId}":
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
get:
2+
$ref: "../../components/objects/datasets/dataset.yaml#/getDefault"
3+
put:
4+
$ref: "../../components/objects/datasets/dataset.yaml#/putDefault"
5+
delete:
6+
$ref: "../../components/objects/datasets/dataset.yaml#/deleteDefault"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
get:
2+
$ref: "../../components/objects/datasets/dataset-items.yaml#/getDefault"
3+
head:
4+
$ref: "../../components/objects/datasets/dataset-items.yaml#/headDefault"
5+
post:
6+
$ref: "../../components/objects/datasets/dataset-items.yaml#/postDefault"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
get:
2+
$ref: "../../components/objects/datasets/dataset-statistics.yaml#/getDefault"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
post:
2+
tags:
3+
- Actors
4+
summary: Validate input
5+
description: |
6+
Validates the provided input against the Actor's input schema for the specified build.
7+
8+
The endpoint checks whether the JSON payload conforms to the input schema
9+
defined in the Actor's build. If no `build` query parameter is provided,
10+
the `latest` build tag is used by default.
11+
operationId: act_validateInput_post
12+
security: []
13+
parameters:
14+
- $ref: "../../components/parameters/runAndBuildParameters.yaml#/actorId"
15+
- name: build
16+
in: query
17+
description: |
18+
Optional tag or number of the Actor build to use for input schema validation.
19+
By default, the `latest` build tag is used.
20+
required: false
21+
style: form
22+
explode: true
23+
schema:
24+
type: string
25+
example: latest
26+
requestBody:
27+
description: JSON input to validate against the Actor's input schema.
28+
content:
29+
application/json:
30+
schema:
31+
type: object
32+
required: true
33+
responses:
34+
"200":
35+
description: ""
36+
headers: {}
37+
content:
38+
application/json:
39+
schema:
40+
type: object
41+
required:
42+
- valid
43+
properties:
44+
valid:
45+
type: boolean
46+
description: Whether the input is valid according to the Actor's input schema.
47+
"400":
48+
$ref: ../../components/responses/BadRequest.yaml
49+
"404":
50+
$ref: ../../components/responses/NotFound.yaml
51+
"405":
52+
$ref: ../../components/responses/MethodNotAllowed.yaml
53+
"413":
54+
$ref: ../../components/responses/PayloadTooLarge.yaml
55+
"415":
56+
$ref: ../../components/responses/UnsupportedMediaType.yaml
57+
"429":
58+
$ref: ../../components/responses/TooManyRequests.yaml
59+
deprecated: false

0 commit comments

Comments
 (0)