logos & stars
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 628 B |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Vérifier si la variable "issuer" est fournie en argument
|
||||
if [ -z "$1" ]; then
|
||||
echo "Veuillez fournir la variable 'issuer' en argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Stocker la variable "issuer" fournie en argument
|
||||
issuer=$1
|
||||
|
||||
# Construire le JSON avec la variable "issuer"
|
||||
json_data='{
|
||||
"size": 25,
|
||||
"_source": ["id", "kind", "level"],
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"term": {"kind": "STAR"}}
|
||||
],
|
||||
"must": [
|
||||
{
|
||||
"term": {
|
||||
"issuer": "'"$issuer"'"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}'
|
||||
|
||||
# URL cible
|
||||
url="https://data.gchange.fr/like/record/_search"
|
||||
|
||||
# Envoyer la requête POST avec curl
|
||||
response=$(curl -X POST -H "Content-Type: application/json" -d "$json_data" "$url")
|
||||
|
||||
# Afficher la réponse
|
||||
echo "$response"
|