TASKPM/scripts/rest-clients/import-work-reports.sh
Susana Montes Pedreira 4fe334f33c ItEr50S13AdaptacionServiciosRESTItEr49S18 : Adapting of WorkReportServiceRest to GenericServiceRest.
This patch should be applied after the following patches :
ItEr50S13AdaptacionServiciosRESTItEr49S18 : Adds class validations.
ItEr50S13AdaptacionServiciosRESTItEr49S18 : Refactoring the create way a work report line.

    It is need a work report to create a work report line , and now the work report line
    does not change its work report.
2010-03-15 10:56:38 +01:00

33 lines
695 B
Bash
Executable file

#!/bin/sh
. ./rest-common-env.sh
printf "Login name: "
read loginName
printf "Password: "
read password
baseServiceURL=$DEVELOPMENT_BASE_SERVICE_URL
certificate=$DEVELOPMENT_CERTIFICATE
for i in "$@"
do
if [ "$i" = "--prod" ]; then
baseServiceURL=$PRODUCTION_BASE_SERVICE_URL
certificate=$PRODUCTION_CERTIFICATE
else
file=$i
fi
done
if [ "$file" = "" ]; then
printf "Missing file\n" 1>&2
exit 1
fi
authorization=`./base64.sh $loginName:$password`
curl -sv -X POST $certificate -d @$file \
--header "Content-type: application/xml" \
--header "Authorization: Basic $authorization" \
$baseServiceURL/workreports | tidy -xml -i -q -utf8