1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-30 16:21:59 +00:00
ohmyzsh/plugins/localstack/localstack.plugin.zsh
2024-09-05 19:40:19 +02:00

37 lines
No EOL
703 B
Bash

# CLI support for LOCALSTACK interaction
#
# See README.md for details
lsk() {
case $1 in
sqs-send)
shift
sqs-send "$@"
;;
*)
echo "Command not found: $1"
return 1
;;
esac
}
# Send SQS function
#
# This function sends a given message in sqs to a given queue, when used Localstack
#
# Use:
# sqs-send <queue> <message>
#
# Parameters
# <queue> A given queue
# <message> A content of message em json archive
#
# Example
# sqs-send user user.json
sqs-send(){
if [ -z "$1" ]; then
echo "Use: sqs-send <queue> <payload>"
return 1
fi
curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat $2)"
}