Skip to content

Commit c86f8cb

Browse files
committed
docs: add missing actor-tasks endpoint
add missing actor-tasks endpoint add TODO's to be discussed regarding categorization & linking add missing endpoint to openapi.yaml
1 parent 07e9623 commit c86f8cb

File tree

2 files changed

+163
-0
lines changed

2 files changed

+163
-0
lines changed

apify-api/openapi/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ paths:
537537
$ref: 'paths/actor-tasks/actor-tasks@{actorTaskId}@run-sync.yaml'
538538
'/v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items':
539539
$ref: 'paths/actor-tasks/actor-tasks@{actorTaskId}@run-sync-get-dataset-items.yaml'
540+
'/v2/actor-tasks/{actorTaskId}/runs/last':
541+
$ref: 'paths/actor-tasks/actor-tasks@{actorTaskId}@[email protected]'
540542
/v2/actor-runs:
541543
$ref: paths/actor-runs/actor-runs.yaml
542544
'/v2/actor-runs/{runId}':
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
get:
2+
tags:
3+
- Actor tasks
4+
summary: Get last run
5+
description: |
6+
This is not a single endpoint, but an entire group of endpoints that lets you to
7+
retrieve and manage the last run of given actor task or any of its default storages.
8+
All the endpoints require an authentication token.
9+
10+
The endpoints accept the same HTTP methods and query parameters as
11+
the respective storage endpoints.
12+
The base path represents the last actor task run object is:
13+
14+
TODO confirm correct endpoint here, current seems to be deprecated
15+
16+
`/v2/actor-tasks/{actorTaskId}/runs/last{?token,status}`
17+
18+
Using the `status` query parameter you can ensure to only get a run with a certain status
19+
(e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters
20+
are the same as in the [Run object](#/reference/actors/run-object) endpoint.
21+
22+
TODO confirm above link, we changed the categorization and we no longer have separete object categorization, would we link to specific endpoint/ list all endpoints that manipulate object/ remove the whole mention?
23+
24+
In order to access the default storages of the last actor task run, i.e. log, key-value store, dataset and request queue,
25+
use the following endpoints:
26+
27+
* `/v2/actor-tasks/{actorTaskId}/runs/last/log{?token,status}`
28+
* `/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store{?token,status}`
29+
* `/v2/actor-tasks/{actorTaskId}/runs/last/dataset{?token,status}`
30+
* `/v2/actor-tasks/{actorTaskId}/runs/last/request-queue{?token,status}`
31+
32+
These API endpoints have the same usage as the equivalent storage endpoints.
33+
For example,
34+
`/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store` has the same HTTP method and parameters as the
35+
[Key-value store object](/api/v2/storage-key-value-stores) endpoint.
36+
37+
Additionally, each of the above API endpoints supports all sub-endpoints
38+
of the original one:
39+
40+
##### Storage endpoints
41+
42+
* [Dataset - introduction](/api/v2/storage-datasets)
43+
44+
* [Key-value store - introduction](/api/v2/storage-key-value-stores)
45+
46+
* [Request queue - introduction](/api/v2/storage-request-queues)
47+
48+
For example, to download data from a dataset of the last succeeded actor task run in XML format,
49+
send HTTP GET request to the following URL:
50+
51+
```
52+
https://api.apify.com/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items?token={yourApiToken}&format=xml&status=SUCCEEDED
53+
```
54+
55+
In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL.
56+
operationId: actorTask_runs_last_get
57+
parameters:
58+
- name: actorTaskId
59+
in: path
60+
description: Task ID or a tilde-separated owner's username and Actor task name.
61+
required: true
62+
style: simple
63+
schema:
64+
type: string
65+
example: janedoe~my-task
66+
- name: status
67+
in: query
68+
description: Filter for the run status.
69+
style: form
70+
explode: true
71+
schema:
72+
type: string
73+
example: SUCCEEDED
74+
responses:
75+
'200':
76+
description: ''
77+
headers: {}
78+
content:
79+
application/json:
80+
schema:
81+
type: object
82+
required:
83+
- data
84+
properties:
85+
data:
86+
$ref: "../../components/schemas/actor-runs/Run.yaml"
87+
example:
88+
data:
89+
id: HG7ML7M8z78YcAPEB
90+
actId: HDSasDasz78YcAPEB
91+
userId: 7sT5jcggjjA9fNcxF
92+
actorTaskId: KJHSKHausidyaJKHs
93+
startedAt: '2019-11-30T07:34:24.202Z'
94+
finishedAt: '2019-12-12T09:30:12.202Z'
95+
status: RUNNING
96+
statusMessage: Actor is running
97+
isStatusMessageTerminal: false
98+
meta:
99+
origin: WEB
100+
clientIp: 172.234.12.34
101+
userAgent: Mozilla/5.0 (iPad)
102+
stats:
103+
inputBodyLen: 240
104+
restartCount: 0
105+
resurrectCount: 2
106+
memAvgBytes: 267874071.9
107+
memMaxBytes: 404713472
108+
memCurrentBytes: 0
109+
cpuAvgUsage: 33.75321011075384
110+
cpuMaxUsage: 169.65073553494125
111+
cpuCurrentUsage: 0
112+
netRxBytes: 103508042
113+
netTxBytes: 4854600
114+
durationMillis: 248472
115+
runTimeSecs: 248.472
116+
metamorph: 0
117+
computeUnits: 0.13804
118+
options:
119+
build: latest
120+
timeoutSecs: 300
121+
memoryMbytes: 1024
122+
diskMbytes: 2048
123+
buildId: 7sT5jcggjjA9fNcxF
124+
exitCode: 0
125+
defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ
126+
defaultDatasetId: wmKPijuyDnPZAPRMk
127+
defaultRequestQueueId: FL35cSF7jrxr3BY39
128+
buildNumber: 0.0.36
129+
containerUrl: 'https://g8kd8kbc5ge8.runs.apify.net'
130+
isContainerServerReady: true
131+
gitBranchName: master
132+
usage:
133+
ACTOR_COMPUTE_UNITS: 3
134+
DATASET_READS: 4
135+
DATASET_WRITES: 4
136+
KEY_VALUE_STORE_READS: 5
137+
KEY_VALUE_STORE_WRITES: 3
138+
KEY_VALUE_STORE_LISTS: 5
139+
REQUEST_QUEUE_READS: 2
140+
REQUEST_QUEUE_WRITES: 1
141+
DATA_TRANSFER_INTERNAL_GBYTES: 1
142+
DATA_TRANSFER_EXTERNAL_GBYTES?: 3
143+
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34
144+
PROXY_SERPS: 3
145+
usageTotalUsd: 0.2654
146+
usageUsd:
147+
ACTOR_COMPUTE_UNITS: 0.072
148+
DATASET_READS: 0.0004
149+
DATASET_WRITES: 0.0002
150+
KEY_VALUE_STORE_READS: 0.0006
151+
KEY_VALUE_STORE_WRITES: 0.002
152+
KEY_VALUE_STORE_LISTS: 0.004
153+
REQUEST_QUEUE_READS: 0.005
154+
REQUEST_QUEUE_WRITES: 0.02
155+
DATA_TRANSFER_INTERNAL_GBYTES: 0.0004
156+
DATA_TRANSFER_EXTERNAL_GBYTES?: 0.0002
157+
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16
158+
PROXY_SERPS: 0.0006
159+
deprecated: false
160+
x-legacy-doc-urls:
161+
- https://docs.apify.com/api/v2#/reference/actor-tasks/last-run-object-and-its-storages

0 commit comments

Comments
 (0)