Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ properties:
type: number
nullable: true
example: 128
restartOnError:
type: boolean
nullable: true
example: false
2 changes: 1 addition & 1 deletion apify-api/openapi/components/schemas/actors/Actor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ properties:
example: My favourite actor!
restartOnError:
type: boolean
nullable: true
example: false
deprecated: true # Use defaultRunOptions.restartOnError instead
isPublic:
type: boolean
example: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ properties:
example: My actor is the best
restartOnError:
type: boolean
nullable: true
example: false
deprecated: true # Use defaultRunOptions.restartOnError instead
versions:
type: array
items:
Expand All @@ -46,6 +46,4 @@ properties:
description: ''
nullable: true
defaultRunOptions:
oneOf:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: @B4nan, why do we declare the nullable fields in some cases like this ?
It results in a bit weird notation in docs, see screenshot.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, the openapi schema was generated from apiary some time ago, could have been a quirk in the conversion script

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual type accepted by the API? Is it "DefaultRunOptions or null"?

I'm asking so that I can check out if there's a better way to express this. But you're right that this looks suspicious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question ... it actually is not nullable, as setting DefaultRunOptions to null will fail both creation and update of the Actor.

So it case of update and create schema, it should be only optional, but not nullable 🤔
I guess not listing it in required but not setting it as nullable should be good enough.

Will try later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Now it should better reflect the behaviour of the API.

Side note: I'm planning to revisit the DefaultRunOptions and make API accept partial DefaultRunOptions, so that user can specify only the defaults they actually want to customize and get our internal defaults for the rest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks for investigating 🙂

- nullable: true
- $ref: ./DefaultRunOptions.yaml
$ref: ./DefaultRunOptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ properties:
memoryMbytes:
type: number
example: 2048
restartOnError:
type: boolean
example: false
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
title: ActUpdate
required:
- name
- isPublic
- versions
type: object
properties:
name:
Expand All @@ -29,8 +25,8 @@ properties:
example: My Actor
restartOnError:
type: boolean
nullable: true
example: false
deprecated: true # Use defaultRunOptions.restartOnError instead
versions:
type: array
items:
Expand All @@ -47,9 +43,7 @@ properties:
description: ''
nullable: true
defaultRunOptions:
oneOf:
- nullable: true
- $ref: ./DefaultRunOptions.yaml
$ref: ./DefaultRunOptions.yaml
taggedBuilds:
type: object
description: |
Expand All @@ -71,3 +65,7 @@ properties:
example:
latest:
buildId: z2EryhbfhgSyqj6Hn
required:
- name
- isPublic
- versions
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ properties:
type: number
nullable: true
example: 1024
restartOnError:
type: boolean
nullable: true
example: false
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ post:
example: 10
description: |
Optional maximum cost of the run, in USD. Used for pay-per-event Actors. The value can only be increased beyond the value specified when the Actor run was started.
- name: restartOnError
in: query
required: false
schema:
type: boolean
example: false
description: |
Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before.
responses:
'200':
description: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,15 @@ post:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ post:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ post:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down
4 changes: 2 additions & 2 deletions apify-api/openapi/paths/actors/acts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ post:
isPublic: false
seoTitle: My Actor
seoDescription: My Actor is the best
restartOnError: false
versions:
- versionNumber: '0.0'
sourceType: SOURCE_FILES
Expand All @@ -161,6 +160,7 @@ post:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
required: true
responses:
'201':
Expand All @@ -183,7 +183,6 @@ post:
name: MyActor
username: jane35
description: My favourite Actor!
restartOnError: false
isPublic: false
createdAt: '2019-07-08T11:27:57.401Z'
modifiedAt: '2019-07-08T14:01:05.546Z'
Expand Down Expand Up @@ -225,6 +224,7 @@ post:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
exampleRunInput:
body: '{ "helloWorld": 123 }'
contentType: application/json; charset=utf-8
Expand Down
6 changes: 3 additions & 3 deletions apify-api/openapi/paths/actors/acts@{actorId}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ get:
name: MyActor
username: jane35
description: My favourite Actor!
restartOnError: false
isPublic: false
createdAt: '2019-07-08T11:27:57.401Z'
modifiedAt: '2019-07-08T14:01:05.546Z'
Expand Down Expand Up @@ -70,6 +69,7 @@ get:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
exampleRunInput:
body: '{ "helloWorld": 123 }'
contentType: application/json; charset=utf-8
Expand Down Expand Up @@ -140,7 +140,6 @@ put:
seoTitle: My Actor
seoDescription: My Actor is the best
title: My Actor
restartOnError: false
versions:
- versionNumber: '0.0'
sourceType: SOURCE_FILES
Expand All @@ -159,6 +158,7 @@ put:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
required: true
responses:
'200':
Expand All @@ -175,7 +175,6 @@ put:
name: MyActor
username: jane35
description: My favourite Actor!
restartOnError: false
isPublic: false
createdAt: '2019-07-08T11:27:57.401Z'
modifiedAt: '2019-07-08T14:01:05.546Z'
Expand Down Expand Up @@ -217,6 +216,7 @@ put:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
exampleRunInput:
body: '{ "helloWorld": 123 }'
contentType: application/json; charset=utf-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ post:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down Expand Up @@ -490,6 +499,15 @@ get:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down
18 changes: 18 additions & 0 deletions apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ post:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down Expand Up @@ -255,6 +264,15 @@ get:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down
9 changes: 9 additions & 0 deletions apify-api/openapi/paths/actors/acts@{actorId}@runs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ post:
type: number
format: double
example: 5
- name: restartOnError
in: query
description: |
Determines whether the run will be restarted if it fails.
style: form
explode: true
schema:
type: boolean
example: false
- name: build
in: query
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ post:
type: number
format: double
example: 256
- name: restartOnError
in: query
description: |
Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before.
style: form
explode: true
schema:
type: boolean
example: false
responses:
'200':
description: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Here's a table of key system environment variables:
| `ACTOR_INPUT_KEY` | Key of the record in the default key-value store that holds the [Actor input](/platform/actors/running/input-and-output#input). |
| `ACTOR_MAX_PAID_DATASET_ITEMS` | For paid-per-result Actors, the user-set limit on returned results. Do not exceed this limit. |
| `ACTOR_MAX_TOTAL_CHARGE_USD` | For pay-per-event Actors, the user-set limit on run cost. Do not exceed this limit. |
| `ACTOR_RESTART_ON_ERROR` | If **1**, the Actor run will be restarted if it fails. |
| `APIFY_HEADLESS` | If **1**, web browsers inside the Actor should run in headless mode (no windowing system available). |
| `APIFY_IS_AT_HOME` | Contains **1** if the Actor is running on Apify servers. |
| `ACTOR_MEMORY_MBYTES` | Size of memory allocated for the Actor run, in megabytes. Can be used to optimize memory usage or finetuning of low-level external libraries. |
Expand Down
Loading