-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathacts@{actorId}@runs@last.yaml
More file actions
177 lines (161 loc) · 7.05 KB
/
acts@{actorId}@runs@last.yaml
File metadata and controls
177 lines (161 loc) · 7.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
get:
tags:
- Actors/Actor runs
summary: Get last run
description: |
This is not a single endpoint, but an entire group of endpoints that lets you to
retrieve and manage the last run of given Actor or any of its default storages.
All the endpoints require an authentication token.
The endpoints accept the same HTTP methods and query parameters as
the respective storage endpoints.
The base path represents the last Actor run object is:
`/v2/acts/{actorId}/runs/last{?token,status}`
Using the `status` query parameter you can ensure to only get a run with a certain status
(e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters
are the same as in the [Run object](#/reference/actors/run-object) endpoint.
In order to access the default storages of the last Actor run, i.e. log, key-value store, dataset and request queue,
use the following endpoints:
* `/v2/acts/{actorId}/runs/last/log{?token,status}`
* `/v2/acts/{actorId}/runs/last/key-value-store{?token,status}`
* `/v2/acts/{actorId}/runs/last/dataset{?token,status}`
* `/v2/acts/{actorId}/runs/last/request-queue{?token,status}`
These API endpoints have the same usage as the equivalent storage endpoints.
For example,
`/v2/acts/{actorId}/runs/last/key-value-store` has the same HTTP method and parameters as the
[Key-value store object](#/reference/key-value-stores/store-object) endpoint.
Additionally, each of the above API endpoints supports all sub-endpoints
of the original one:
#### Key-value store
* `/v2/acts/{actorId}/runs/last/key-value-store/keys{?token,status}` [Key collection](#/reference/key-value-stores/key-collection)
* `/v2/acts/{actorId}/runs/last/key-value-store/records/{recordKey}{?token,status}` [Record](#/reference/key-value-stores/record)
#### Dataset
* `/v2/acts/{actorId}/runs/last/dataset/items{?token,status}` [Item collection](#/reference/datasets/item-collection)
#### Request queue
* `/v2/acts/{actorId}/runs/last/request-queue/requests{?token,status}` [Request collection](#/reference/request-queues/request-collection)
* `/v2/acts/{actorId}/runs/last/request-queue/requests/{requestId}{?token,status}` [Request collection](#/reference/request-queues/request)
* `/v2/acts/{actorId}/runs/last/request-queue/head{?token,status}` [Queue head](#/reference/request-queues/queue-head)
For example, to download data from a dataset of the last succeeded Actor run in XML format,
send HTTP GET request to the following URL:
```
https://api.apify.com/v2/acts/{actorId}/runs/last/dataset/items?token={yourApiToken}&format=xml&status=SUCCEEDED
```
In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL.
operationId: act_runs_last_get
parameters:
- name: actorId
in: path
description: Actor ID or a tilde-separated owner's username and Actor name.
required: true
style: simple
schema:
type: string
example: janedoe~my-actor
- name: status
in: query
description: Filter for the run status.
style: form
explode: true
schema:
type: string
example: SUCCEEDED
- name: waitForFinish
in: query
description: |
The maximum number of seconds the server waits for the run to finish.
By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS -->
If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`),
otherwise it will have a transitional status (e.g. `RUNNING`).
style: form
explode: true
schema:
type: number
format: double
example: 60
responses:
"200":
description: ""
headers: {}
content:
application/json:
schema:
$ref: ../../components/schemas/actor-runs/RunResponse.yaml
example:
data:
id: HG7ML7M8z78YcAPEB
actId: HDSasDasz78YcAPEB
userId: 7sT5jcggjjA9fNcxF
actorTaskId: KJHSKHausidyaJKHs
startedAt: "2019-11-30T07:34:24.202Z"
finishedAt: "2019-12-12T09:30:12.202Z"
status: RUNNING
statusMessage: Actor is running
isStatusMessageTerminal: false
meta:
origin: WEB
clientIp: 172.234.12.34
userAgent: Mozilla/5.0 (iPad)
stats:
inputBodyLen: 240
migrationCount: 0
restartCount: 0
resurrectCount: 2
memAvgBytes: 267874071.9
memMaxBytes: 404713472
memCurrentBytes: 0
cpuAvgUsage: 33.75321011075384
cpuMaxUsage: 169.65073553494125
cpuCurrentUsage: 0
netRxBytes: 103508042
netTxBytes: 4854600
durationMillis: 248472
runTimeSecs: 248.472
metamorph: 0
computeUnits: 0.13804
options:
build: latest
timeoutSecs: 300
memoryMbytes: 1024
diskMbytes: 2048
buildId: 7sT5jcggjjA9fNcxF
exitCode: 0
generalAccess: RESTRICTED
defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ
defaultDatasetId: wmKPijuyDnPZAPRMk
defaultRequestQueueId: FL35cSF7jrxr3BY39
buildNumber: 0.0.36
containerUrl: "https://g8kd8kbc5ge8.runs.apify.net"
isContainerServerReady: true
gitBranchName: master
usage:
ACTOR_COMPUTE_UNITS: 3
DATASET_READS: 4
DATASET_WRITES: 4
KEY_VALUE_STORE_READS: 5
KEY_VALUE_STORE_WRITES: 3
KEY_VALUE_STORE_LISTS: 5
REQUEST_QUEUE_READS: 2
REQUEST_QUEUE_WRITES: 1
DATA_TRANSFER_INTERNAL_GBYTES: 1
DATA_TRANSFER_EXTERNAL_GBYTES: 3
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34
PROXY_SERPS: 3
usageTotalUsd: 0.2654
usageUsd:
ACTOR_COMPUTE_UNITS: 0.072
DATASET_READS: 0.0004
DATASET_WRITES: 0.0002
KEY_VALUE_STORE_READS: 0.0006
KEY_VALUE_STORE_WRITES: 0.002
KEY_VALUE_STORE_LISTS: 0.004
REQUEST_QUEUE_READS: 0.005
REQUEST_QUEUE_WRITES: 0.02
DATA_TRANSFER_INTERNAL_GBYTES: 0.0004
DATA_TRANSFER_EXTERNAL_GBYTES: 0.0002
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16
PROXY_SERPS: 0.0006
"400":
$ref: ../../components/responses/BadRequest.yaml
deprecated: false
x-legacy-doc-urls:
- https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages/get-last-run
- https://docs.apify.com/api/v2#tag/ActorsLast-run-object-and-its-storages/operation/act_runs_last_get