Skip to content

Commit

Permalink
Fix send script
Browse files Browse the repository at this point in the history
  • Loading branch information
Callisto13 committed Oct 22, 2021
1 parent d4e2e3d commit dc46054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ To created a MicroVM:

```
./hack/scripts/send.sh \
--method CreateMicroVM \
< hack/scripts/payload/CreateMicroVM.json
--method CreateMicroVM
```

In the terminal where you started the Reignite server, you should see in the logs that the MircoVM
Expand Down
10 changes: 6 additions & 4 deletions hack/scripts/send.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ port=9090
service="microvm.services.api.v1alpha1.MicroVM"
method="ListMicroVMs"

if ! which grpcurl >/dev/null 2>/dev/null; then
if ! which grpc-client-cli >/dev/null 2>/dev/null; then
echo "!!! grpcurl is not installed. Please install this awesome tool." >&2
echo "" >&2
echo " go install github.com/vadimi/grpc-client-cli/cmd/[email protected]" >&2
Expand Down Expand Up @@ -57,9 +57,11 @@ done

pushd "$(dirname "${0}")" > /dev/null

grpcurl -d @ \
-plaintext "${host}:${port}" \
"${service}/${method}" \
# I know using < is better than | but every time I tried the grpc-client-cli
# failed to parse the json with 'invalid character' errors so :shrug_emoji:
cat "payload/${method}.json" | grpc-client-cli \
-s "${service} -m ${method}" \
"${host}:${port}" \
< "payload/${method}.json"

popd > /dev/null

0 comments on commit dc46054

Please sign in to comment.