mirror of
https://github.com/valitydev/holmes.git
synced 2024-11-06 01:45:25 +00:00
4cdec0411f
* Switch proto upstreams to valitydev: valitydev/bender-proto@38ce3ff valitydev/binbase-proto@9db92d9 valitydev/cds-proto@ed9f907 valitydev/damsel@d384c12 valitydev/fistful-proto@c45166d valitydev/limiter-proto@8c08550 valitydev/machinegun-proto@af57ba1 valitydev/msgpack-proto@8742c7a * Rewrite Dockerfile * Include protocols as full-fledged git repos * Add GH Actions CI workflow
39 lines
1014 B
Bash
Executable File
39 lines
1014 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CWD="$(dirname $0)"
|
|
DAMSEL="${CWD}/../damsel"
|
|
|
|
USAGE=$(cat <<EOF
|
|
Usage: ${SCRIPTNAME} plan-id batch
|
|
Prepares and then rolls back a plan made up of the single posting batch provided by
|
|
the user.
|
|
plan-id Posting plan ID (string)
|
|
batch Posting batch (json object, see [2])
|
|
|
|
More information:
|
|
[1]: https://github.com/valitydev/damsel
|
|
[2]: https://github.com/valitydev/damsel/blob/d384c125/proto/accounter.thrift#L70
|
|
EOF
|
|
)
|
|
|
|
function usage {
|
|
echo "${USAGE}"
|
|
exit 127
|
|
}
|
|
|
|
[ -f woorlrc ] && source woorlrc
|
|
|
|
PLANID="${1}"
|
|
[ -z "${PLANID}" ] && usage
|
|
BATCH="${2}"
|
|
[ -z "${BATCH}" ] && usage
|
|
|
|
ACCOUNTER="http://${SHUMWAY:-shumway}:${SHUMWAY_PORT:-8022}/accounter"
|
|
|
|
"${WOORL[@]:-woorl}" -s "${DAMSEL}/proto/accounter.thrift" \
|
|
"${ACCOUNTER}" Accounter Hold \
|
|
"{\"id\": \"${PLANID}\", \"batch\": ${BATCH}}" && \
|
|
"${WOORL[@]:-woorl}" -s "${DAMSEL}/proto/accounter.thrift" \
|
|
"${ACCOUNTER}" Accounter RollbackPlan \
|
|
"{\"id\": \"${PLANID}\", \"batch_list\": [${BATCH}]}"
|