Skip to content

Commit

Permalink
Update event sending docs
Browse files Browse the repository at this point in the history
Align the docs to #368 changes
  • Loading branch information
cardil authored Oct 2, 2024
1 parent 3f209e4 commit 444b1dd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,44 +73,44 @@ $ kn event build \

To send and event you should utilize `send` subcommand. The `send` command
leverages the same builder-like interface as `build` command does. You could
send an event to public address of your application by using `--to-url` option,
or to supported in-cluster resources by using `--to` option.
send an event to public address of your application or to supported
in-cluster resources by using `--to` option.

#### Sending to public address

To send event to public address you use `--to-url` option:
To send event to public address you use pass it to the `--to` option:

```sh
$ kn event send \
--field player.id=6354aa60-ddb1-452e-8c13-24893667de20 \
--field player.game=2345 \
--field points=456 \
--type org.example.gaming.foo \
--to-url http://ce-api.foo.example.org/
--to http://ce-api.foo.example.org/
```

> **NOTE**: All argument, except `--to-url` are optional. Use
> **NOTE**: All argument, except `--to` are optional. Use
> `kn event send --help` to see full usage information.
#### Sending to in-cluster resources

Sending event to in-cluster resources is done with a companion Job that is
deployed on your cluster. In that way `kn-event` and send your event even to
Sending events to in-cluster resources is done with a companion *Job* that
is deployed on your cluster. This allows `kn-event` to send your events to
resources that are not publicly accessible.

Send an event to a Knative service `event-display` in namespace `default`:
Send an event to a Knative service `showcase` in current namespace:

```sh
$ kn event send \
--type org.example.kn.ping \
--id $(uuidgen) \
--field event.type=test \
--field event.data=98765 \
--to Service:serving.knative.dev/v1:event-display
--to showcase
```

> **NOTE**: All argument, except `--to-url` are optional. Use
> `kn event send --help` to see full usage information.
> **NOTE**: The --to option follow [the Kn sink format](https://github.com/knative/client/blob/main/docs/cmd/kn_trigger_create.md#options).
> Use `kn event send --help` to see full format description.
## Install

Expand Down

0 comments on commit 444b1dd

Please sign in to comment.