Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix event create flags #98

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Flags:

### Running the Server

See [the docs](docs/how-to/start-server/README.md) for how to start EPR
and its dependencies.
See [the docs](docs/how-to/start-server/README.md) for how to start EPR and its
dependencies.

### Interacting with the Server

Expand Down Expand Up @@ -178,6 +178,11 @@ curl -X POST -H "content-type:application/json" -d '{"query":"query FindEventRec
curl -X POST -H "content-type:application/json" -d '{"query":"query FindEventReceiverGroups($id: ID!){event_receiver_groups(id: $id) {id,name,type,version,description,enabled,event_receiver_ids,created_at,updated_at}}","variables":{"id":"01HKX90FKWQZ49F6H5V5NQT95Z"}}' http://localhost:8042/api/v1/graphql/query
```

## Links

- [EPR Python Client](https://github.com/xbcsmith/epr-python)
- [EPR Workshop](https://github.com/xbcsmith/epr-workshop)

## Contributing

We welcome your contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/event/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func runCreateEvent(_ *cobra.Command, _ []string) error {
platform := viper.GetString("platform-id")
pkg := viper.GetString("package")
success := viper.GetBool("success")
eventReceiverID := viper.GetString("receiver-id")
eventReceiverID := viper.GetString("event-receiver-id")
payload := viper.GetString("payload")
dryrun := viper.GetBool("dry-run")
noindent := viper.GetBool("no-indent")
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/FAQ.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# FAQ
# FAQ
2 changes: 1 addition & 1 deletion docs/reference/standards.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Standards
# Standards
27 changes: 15 additions & 12 deletions docs/tutorials/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Overview

In this tutorial we will run the Event Provenance Registry (EPR) Server with
Redpanda Message broker and PostgreSQL database. We will create an event receiver, an event receiver group, and a few events.
Redpanda Message broker and PostgreSQL database. We will create an event
receiver, an event receiver group, and a few events.

## Requirements

Expand Down Expand Up @@ -378,8 +379,8 @@ mutation {
In the graphql window create a query with the following:

```graphql
query{
events(event: {name: "foo", version: "1.0.0"}) {
query {
events(event: { name: "foo", version: "1.0.0" }) {
id
name
version
Expand Down Expand Up @@ -460,8 +461,7 @@ In the graphql window create a query with the following:

```graphql
query {
event_receivers(event_receiver: {name: "the_clash", version: "1.0.0"})
{
event_receivers(event_receiver: { name: "the_clash", version: "1.0.0" }) {
id
name
version
Expand Down Expand Up @@ -503,7 +503,8 @@ As follows:

### Query using the GraphQL with Curl

We need to craft a GraphQL query. First thing we need is an event receiver. The event receiver acts as a classification and gate for events.
We need to craft a GraphQL query. First thing we need is an event receiver. The
event receiver acts as a classification and gate for events.

We can find and event receiver by id using the following graphql query:

Expand All @@ -518,7 +519,8 @@ We can find and event receiver by id using the following graphql query:
}
```

We can query the event receiver information using a POST on the graphql endpoint as follows:
We can query the event receiver information using a POST on the graphql endpoint
as follows:

```bash
curl -X POST -H "content-type:application/json" -d '{"query":"query ($er: FindEventReceiverInput!){event_receivers(event_receiver: $er) {id,name,type,version,description}}","variables":{"er":{"id":"01HPW652DSJBHR5K4KCZQ97GJP"}}}' http://localhost:8042/api/v1/graphql/query
Expand All @@ -538,7 +540,8 @@ We can query for an event by name and version using the following graphql query:
}
```

We can query the event receiver information using a POST on the graphql endpoint as follows:
We can query the event receiver information using a POST on the graphql endpoint
as follows:

```bash
curl -X POST -H "content-type:application/json" -d '{"query":"query ($e : FindEventInput!){events(event: $e) {id,name,version,release,platform_id,package,description,success,event_receiver_id}}","variables":{"e": {"name":"foo","version":"1.0.0"}}}' http://localhost:8042/api/v1/graphql/query
Expand All @@ -548,7 +551,8 @@ curl -X POST -H "content-type:application/json" -d '{"query":"query ($e : FindEv
curl -X POST -H "content-type:application/json" -d '{"query":"query {events(event: {name: \"foo\", version: \"1.0.0\"}) {id,name,version,release,platform_id,package,description,success,event_receiver_id}}}' http://localhost:8042/api/v1/graphql/query
```

We can query for an event receiver group by name and version using the following graphql query:
We can query for an event receiver group by name and version using the following
graphql query:

```json
{
Expand All @@ -562,10 +566,9 @@ We can query for an event receiver group by name and version using the following
}
```

We can query the event receiver information using a POST on the graphql endpoint as follows:
We can query the event receiver information using a POST on the graphql endpoint
as follows:

```bash
curl -X POST -H "content-type:application/json" -d '{"query":"query ($erg: FindEventReceiverGroupInput!){event_receiver_groups(event_receiver_group: $erg) {id,name,type,version,description}}","variables":{"erg": {"name":"foobar","version":"1.0.0"}}}' http://localhost:8042/api/v1/graphql/query
```


8 changes: 6 additions & 2 deletions docs/tutorials/watcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

## Overview

In this tutorial we will delve into the utilization of the EPR watcher SDK to craft a watcher, which actively listens for events originating from the EPR server. Watchers serve the purpose of monitoring messages within Redpanda, initiating actions based on these messages, and subsequently dispatching event notifications to the EPR Server.
In this tutorial we will delve into the utilization of the EPR watcher SDK to
craft a watcher, which actively listens for events originating from the EPR
server. Watchers serve the purpose of monitoring messages within Redpanda,
initiating actions based on these messages, and subsequently dispatching event
notifications to the EPR Server.

This tutorial depends on the [Quickstart](../quickstart/README.md) being
completed.
Expand Down Expand Up @@ -48,7 +52,7 @@ func main() {
watcher.ConsumeRecords(customMatcher)
}

ffunc customMatcher(msg *message.Message) bool {
func customMatcher(msg *message.Message) bool {
return msg.Type == "foo.bar"
}

Expand Down
Loading