Skip to content

Commit e327d87

Browse files
authored
docs: add missing actor-tasks endpoint (#1510)
add missing actor-tasks endpoint add TODO's to be discussed regarding categorization & linking add missing endpoint to openapi.yaml
1 parent 7370617 commit e327d87

File tree

2 files changed

+159
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)