Initial checkins

This commit is contained in:
stephb9959
2021-08-20 23:05:09 -07:00
parent eab1fd660e
commit 63f68f29f3
7 changed files with 142 additions and 5 deletions

View File

@@ -129,11 +129,22 @@ setroot() {
jq < ${result_file}
}
addentity() {
payload="{ \"name\" : \"$1\", \"description\" : \"sub entity.\", \"parent\" : \"0000-0000-0000\", \"notes\" : [ {\"note\" : \"CLI added\"} ] }";
curl ${FLAGS} -X POST "https://${OWPROV}/api/v1/entity/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-H "accept: application/json" \
-d "$payload" > ${result_file}
jq < ${result_file}
}
shopt -s nocasematch
case "$1" in
"login") login; help ; logout ;;
"getroot") login; getroot; logout;;
"setroot") login; setroot; logout;;
"addentity") login; addentity "$2" ; logout;;
*) help ;;
esac