Commit 08fb4803 authored by U-PALLAS\theron's avatar U-PALLAS\theron
Browse files

Modification code

parent 34b724a3
......@@ -27,42 +27,43 @@
# certificat=`cat uga_certificat_prod.pem`
# *************** VARIABLES *********************
### endpoints Ingest external
### curl -X OPTIONS -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/ingest-external/v1/'
# OK endpoint access external OK
# OK access_external: Liste des endpoint de access external OK
#curl -X OPTIONS -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1'
## logbook operation KO
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/logbookoperations'
## OK access-external dipexport : recuperation du DIP dasn fichier / $1 = id de la req de construciton du DIP OK passée avec IHM
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/octet-stream ' ''$url'/access-external/v1/dipexport/'$1'/dip' --output $2
## status
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/status'
## dipexport : POST pour construire le DIP avec le contenu du json DSL KO
#echo "curl -X POST -k -H 'X-Tenant-Id: 0' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '(certificat)' -----END CERTIFICATE-----' ''$url'/access-external/v1/dipexport' --data-binary @$1"
## OK access_external Units recherche d'une unite d'archive par son identifiant (avec dsl1.json)
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/units/'$1'' --data-binary @$2
#curl -X POST -k -H 'X-Tenant-Id: 0' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' ''$url'/access-external/v1/dipexport' --data-binary @$1
## OK access_external units recherche d'une unite d'archive par son identifiant ds le DSL (avec dsl1.1.json)
curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/json' -i ''$url'/access-external/v1/units/' --data-binary @$1
# OK requete / UA avec l'id UA dans le Jso (avec dsl2.json) OK
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/units' --data-binary @$1
## OK dipexport : recuperation du DIP dasn fichier / $1 = id de la req de
# construciton du DIP OK
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/octet-stream ' ''$url'/access-external/v1/dipexport/'$1'/dip' --output $2
## OK recherche d'une unite d'archive par son identifiant (avec dsl1.json)
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/units/'$1'' --data-binary @$2
########################################################################### KO
### KO Ingest external Liste des endpoints
#curl -X OPTIONS -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/ingest-external/v1/'
## OK recherche d'une unite d'archive par son identifiant ds le DSL KO (avec dsl1.1.json)
curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/json' -i ''$url'/access-external/v1/units/' --data-binary @$1
## KO logbookoperation KO
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/logbookoperations'
# requete / UA avec l'id UA dans le Jso (avec dsl2.json) OK
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/units' --data-binary @$1
## KO access-external: Verification de l'etat de l'API avec status
#curl -X GET -k -H 'X-Request-Id: aeeaaaaaacfdatmhaaj2yalz2ifpnpyaaaaq' -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: IN-TNR-0' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url'/access-external/v1/status'
## KO access_external dipexport :POST pour construire le DIP avec le contenu du json DSL
#echo "curl -X POST -k -H 'X-Tenant-Id: 0' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '(certificat)' -----END CERTIFICATE-----' ''$url'/access-external/v1/dipexport' --data-binary @$1"
#curl -X POST -k -H 'X-Tenant-Id: 0' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' ''$url'/access-external/v1/dipexport' --data-binary @$1
# requete / object : KO
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/json' -H 'X-Qualifier: BinaryMaster' -i ''$url'/access-external/v1/units/'$1'/objects' --data-binary @$2
# KO requete / les groupe d'object : KO
#curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/json' -H 'X-Qualifier: BinaryMaster' -i ''$url'/access-external/v1/objects' --data-binary @$1
#curl -X POST -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/json' -H 'X-Access-Contract-Id: CA-000001' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: application/json' -H 'X-Qualifier: BinaryMaster' -i ''$url'/access-external/v1/units/'$1'/objects' --data-binary @$2
......
#!/bin/sh
path_curl=".";
# url des API Vitam:
#url="https://10.6.10.34:"
#url="https://prep-vit-acc-1-1.cines.fr:"
url="https://vitam.cines.fr:"
# ports des API
ing_ext_port="8443";
admin_ext_port="8444";
#Fichier pem du certificat:
# certificat=`cat ./cert/cines_certificat.pem`
certificat=`cat ./cert/cines_certificat.prod.pem`
# certificat=`cat uga_certificat.pem`
reqId=$1;
#$path_curl/curl_GET.sh $certificat $url$ing_ext_port $reqId archivetransferreply
#$path_curl/curl_GET_statut.sh $certificat $url$admin_ext_port $reqId | grep "X-Global-Execution-State" | awk '{print $2}'
curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: CE-000000' -H 'X-Context-Id: CINES_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$certificat' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$url$admin_ext_port'/admin-external/v1/operations/'$1''
#!/bin/sh
curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: CE-000000' -H 'X-Context-Id: CINES_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$1' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$2'/admin-external/v1/operations/'$3''
curl -X GET -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: CE-000000' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$1' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$2'/admin-external/v1/operations/'$3''
......
#!/bin/sh
curl -X POST -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: CE-000000' -H 'X-Context-Id: CINES_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$1' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$4'/ingest-external/v1/ingests' --data-binary @$2/$3 > $2/out/$3-POST.out
curl -k -X POST -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: CE-000000' -H 'X-Context-Id: CINES_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$1' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$4'/ingest-external/v1/ingests' -m 60 -H 'X-Manifest-Digest-Value: 74c068ec79d780a511c374d88e43a10de1330994ee8c60e527431e65f8d86aa6' -H 'X-Manifest-Digest-Algo: SHA-256' --data-binary @$2/$3 > $2/out/$3-POST.out
#curl -X POST -k -H 'X-Tenant-Id: 0' -H 'Content-Type: application/octet-stream' -H 'X-Access-Contract-Id: CE-000000' -H 'X-Context-Id: DEFAULT_WORKFLOW' -H 'X-Action: RESUME' -H 'X-SSL-CLIENT-CERT: -----BEGIN CERTIFICATE----- '$1' -----END CERTIFICATE-----' -H 'Accept: */*' -i ''$4'/ingest-external/v1/ingests' --data-binary @$2/$3 > $2/out/$3-POST.out
......
......@@ -15,6 +15,7 @@
url="https://10.6.10.34:"
#url="https://prep-vit-acc-1-1.cines.fr:"
url="https://vitam.cines.fr:"
# url="https://pp-vit-acc-1-1.cines.fr:"
# ports des API
ing_ext_port="8443";
......@@ -22,8 +23,8 @@ url="https://10.6.10.34:"
#Fichier pem du certificat:
certificat=`cat ./cert/cines_certificat.pem`
certificat=`cat ./cert/cines_certificat.prod.pem`
# certificat=`cat ./cert/cines_certificat.pem`
certificat=`cat ./cert/cines_certificat.prod.pem`
# certificat=`cat uga_certificat.pem`
# *************** VARIABLES *********************
......@@ -61,7 +62,8 @@ report="STATUT";j=0;flagSt=0;etat="COMPLETED"
# Compte le nombre de statut "COMPLETED"
nbrCompleted=`cat $1/out/$report.out | grep COMPLETED | wc -l`
echo "Fin de la récupération des statuts des Versements de $1: $nbrCompleted en statut COMPLETED / $nbrSip attendus"
echo "Fin de la récupération des statuts des Versements de $1:"
echo "$nbrCompleted en statut COMPLETED / $nbrSip attendus"
}
......@@ -118,6 +120,7 @@ fi
# Ecriture dans le fichier de sortie des statuts finaux (pour le dossier des SIP)
echo "$dateVers $sip $reqId $statutPost $etatFinal" >> $1/out/$report.out;
echo "$dateVers $sip $reqId $statutPost $etatFinal"
# Move dans SUCCESS ou REJETS selon valeur de $etatfinal:
case $etatFinal in
OK) mv $1/$sip $1/SUCCES;;
......@@ -166,7 +169,7 @@ report="POST";
fi
# crPost=`grep Accepted $path_sip-$sip-POST.out | awk {'print $1"-"$2"-"$3'}`
reqId=`grep X-Request-Id $path_sip/out/$sip-POST.out | awk {'print $2'}`
reqId=`echo "${reqId%?}"` # suppression du dernier car ^M de la chaine $reqId
# Si utilisation \ linux: reqId=`echo "${reqId%?}"` # suppression du dernier car ^M de la chaine $reqId
echo " `date +%Y/%m/%d-%H:%M:%S` $sip $reqId $crPost" >> $path_sip/out/$report.out
rm $path_sip/out/$sip-POST.out # Suppression du fichier resultat du post pour le sip
let nbrPost++;
......
{
"$query": [
{ "$match": { "Title": "Programme" }
}
],
"$filter": {},
"$projection": {}
}
{
"$roots": [
"aeaqaaaaaafdat3yabwyyalzupxx3faaaaca"
],
"$query": [
{ "$match": { "Title": "Programme" },
"$depth": 0 }
],
"$filter": {},
"$projection": {}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment