Skip to content

Commit 634d355

Browse files
JoshVanLyaron2
andauthored
Update Job HTTP request API (#4349)
According to dapr/dapr#8083 Signed-off-by: joshvanl <[email protected]> Co-authored-by: Yaron Schneider <[email protected]>
1 parent 9128eeb commit 634d355

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

daprdocs/content/en/reference/api/jobs_api.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ At least one of `schedule` or `dueTime` must be provided, but they can also be p
3232
Parameter | Description
3333
--------- | -----------
3434
`name` | Name of the job you're scheduling
35-
`data` | A protobuf message `@type`/`value` pair. `@type` must be of a [well-known type](https://protobuf.dev/reference/protobuf/google.protobuf). `value` is the serialized data.
35+
`data` | A JSON serialized value or object.
3636
`schedule` | An optional schedule at which the job is to be run. Details of the format are below.
3737
`dueTime` | An optional time at which the job should be active, or the "one shot" time, if other scheduling type fields are not provided. Accepts a "point in time" string in the format of RFC3339, Go duration string (calculated from creation time), or non-repeating ISO8601.
3838
`repeats` | An optional number of times in which the job should be triggered. If not set, the job runs indefinitely or until expiration.
@@ -67,11 +67,8 @@ Entry | Description | Equivalent
6767

6868
```json
6969
{
70-
"data": {
71-
"@type": "type.googleapis.com/google.protobuf.StringValue",
72-
"value": "someData"
73-
},
74-
"dueTime": "30s"
70+
"data": "some data",
71+
"dueTime": "30s"
7572
}
7673
```
7774

@@ -90,18 +87,14 @@ The following example curl command creates a job, naming the job `jobforjabba` a
9087
```bash
9188
$ curl -X POST \
9289
http://localhost:3500/v1.0-alpha1/jobs/jobforjabba \
93-
-H "Content-Type: application/json"
90+
-H "Content-Type: application/json" \
9491
-d '{
95-
"data": {
96-
"@type": "type.googleapis.com/google.protobuf.StringValue",
97-
"value": "Running spice"
98-
},
92+
"data": "{\"value\":\"Running spice\"}",
9993
"schedule": "@every 1m",
10094
"repeats": 5
10195
}'
10296
```
10397

104-
10598
## Get job data
10699

107100
Get a job from its name.
@@ -137,10 +130,7 @@ $ curl -X GET http://localhost:3500/v1.0-alpha1/jobs/jobforjabba -H "Content-Typ
137130
"name": "jobforjabba",
138131
"schedule": "@every 1m",
139132
"repeats": 5,
140-
"data": {
141-
"@type": "type.googleapis.com/google.protobuf.StringValue",
142-
"value": "Running spice"
143-
}
133+
"data": 123
144134
}
145135
```
146136
## Delete a job

0 commit comments

Comments
 (0)