Update Job HTTP request API (#4349)

According to https://github.com/dapr/dapr/pull/8083

Signed-off-by: joshvanl <me@joshvanl.dev>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
This commit is contained in:
Josh van Leeuwen 2024-09-14 01:37:34 +01:00 committed by GitHub
parent 9128eebb36
commit 634d355d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 16 deletions

View File

@ -32,7 +32,7 @@ At least one of `schedule` or `dueTime` must be provided, but they can also be p
Parameter | Description Parameter | Description
--------- | ----------- --------- | -----------
`name` | Name of the job you're scheduling `name` | Name of the job you're scheduling
`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. `data` | A JSON serialized value or object.
`schedule` | An optional schedule at which the job is to be run. Details of the format are below. `schedule` | An optional schedule at which the job is to be run. Details of the format are below.
`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. `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.
`repeats` | An optional number of times in which the job should be triggered. If not set, the job runs indefinitely or until expiration. `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
```json ```json
{ {
"data": { "data": "some data",
"@type": "type.googleapis.com/google.protobuf.StringValue", "dueTime": "30s"
"value": "someData"
},
"dueTime": "30s"
} }
``` ```
@ -90,18 +87,14 @@ The following example curl command creates a job, naming the job `jobforjabba` a
```bash ```bash
$ curl -X POST \ $ curl -X POST \
http://localhost:3500/v1.0-alpha1/jobs/jobforjabba \ http://localhost:3500/v1.0-alpha1/jobs/jobforjabba \
-H "Content-Type: application/json" -H "Content-Type: application/json" \
-d '{ -d '{
"data": { "data": "{\"value\":\"Running spice\"}",
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "Running spice"
},
"schedule": "@every 1m", "schedule": "@every 1m",
"repeats": 5 "repeats": 5
}' }'
``` ```
## Get job data ## Get job data
Get a job from its name. Get a job from its name.
@ -137,10 +130,7 @@ $ curl -X GET http://localhost:3500/v1.0-alpha1/jobs/jobforjabba -H "Content-Typ
"name": "jobforjabba", "name": "jobforjabba",
"schedule": "@every 1m", "schedule": "@every 1m",
"repeats": 5, "repeats": 5,
"data": { "data": 123
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "Running spice"
}
} }
``` ```
## Delete a job ## Delete a job