fi
# TEST DE CONNEXION
-code=$(curl -s -w "%{http_code}" --max-time 5 --output /dev/null "http://${produit_fqdn_interne}/api/rest/allo/version")
-echo ${produit_fqdn_interne}
+code=$(curl -s -w "%{http_code}" --max-time 5 --output /dev/null "http://${instance_fqdn_interne}/api/rest/allo/version")
+echo ${instance_fqdn_interne}
echo ${code}
if [ "${code}" == 200 ] || [ "${code}" == 301 ]
then
# REQUETE (en insecure pour le moment)
- curl --max-time 10 -k -X GET -H "${response_accept}" "http://${produit_fqdn_interne}/api/rest/allo/version/" --output "response.json" 2> /dev/null
+ curl --max-time 10 -k -X GET -H "${response_accept}" "http://${instance_fqdn_interne}/api/rest/allo/version/" --output "response.json" 2> /dev/null
# LOG DE LA REPONSE
#echo "$(cat response.json)" 2>&1 | tee -a $log_file
if [[ -z $isJSONCorrupted && ${isJSONCorrupted+x} ]]
then
# AJOUT DE LA REFERENCE PRODUIT (nécessite package jq)
- jq '. + { "reference": "'"${produit_reference}"'" }' response.json > tmp1.json
+ jq '. + { "reference": "'"${instance_reference}"'" }' response.json > tmp1.json
# AJOUT DU TYPE D'USAGER
jq '. + { "usager_type": "'"${usager_type}"'" }' tmp1.json > tmp2.json
# AJOUT DU TYPE DE PRODUIT
- jq '. + { "produit_type": "'"${produit_type}"'" }' tmp2.json > request.json
+ jq '. + { "instance_type": "'"${instance_type}"'" }' tmp2.json > request.json
# ENVOI DE L'UPDATE AU SERVEUR
curl -k -X PUT -H "${request_type}" -d "$(cat request.json)" -i "http://${allo_serveur_url}/?action=upload_info" --output "response_server" 2> /dev/null