initial commit
322
scripts/demo.json
Normal file
@@ -0,0 +1,322 @@
|
||||
[
|
||||
{
|
||||
"api": "/v1/data/",
|
||||
"content": [
|
||||
{
|
||||
"name": "Mundi Sentienl 3 SRAL Images",
|
||||
"short_description": "Mundi Sentinels 3 SAR Altiemter image",
|
||||
"logo": "./local_imgs/Mundi Sentienl 3 SRAL Images.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"example": "string",
|
||||
"ftype": "string",
|
||||
"location": "string",
|
||||
"type": "data"
|
||||
},
|
||||
{
|
||||
"name": "Mundi Sentienl 3 OLCI Images",
|
||||
"short_description": "Mundi Sentinels 3 Ocean and land color Altiemter image",
|
||||
"logo": "./local_imgs/Mundi Sentienl 3 OLCI Images.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"example": "string",
|
||||
"ftype": "string",
|
||||
"location": "string",
|
||||
"type": "data"
|
||||
},
|
||||
{
|
||||
"name": "Meteo-France forecasts",
|
||||
"short_description": "Meteo France weather forecasts",
|
||||
"logo": "./local_imgs/Meteo-France forecasts.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"example": "string",
|
||||
"ftype": "string",
|
||||
"location": "string",
|
||||
"type": "data"
|
||||
},
|
||||
{
|
||||
"name": "Meteo-France wind archive",
|
||||
"short_description": "Meteo France wind archive",
|
||||
"logo": "./local_imgs/Meteo-France wind archive.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"example": "string",
|
||||
"ftype": "string",
|
||||
"location": "string",
|
||||
"type": "data"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"api": "/v1/computing/",
|
||||
"content": [
|
||||
{
|
||||
"name": "SAR High points",
|
||||
"short_description": "SAR Altimeter High points extraction Software",
|
||||
"logo": "./local_imgs/SAR High points.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "computing",
|
||||
"owner": "IRT",
|
||||
"price": 300,
|
||||
"license": "GPLv2",
|
||||
"execution_requirements": {
|
||||
"cpus": 1,
|
||||
"ram": 1024,
|
||||
"storage": 300,
|
||||
"gpus": 1,
|
||||
"disk_io": "30 MB/s",
|
||||
"parallel": true,
|
||||
"scaling_model": 2
|
||||
},
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"name": "Flammable vegetation slicer",
|
||||
"short_description": "Analyze land cover and define optimum vegetation slices to prevent fire propagation",
|
||||
"logo": "./local_imgs/Flammable vegetation slicer.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "computing",
|
||||
"execution_requirements": {
|
||||
"cpus": 3,
|
||||
"ram": 4096,
|
||||
"storage": 30000,
|
||||
"disk_io": "30 MB/s",
|
||||
"parallel": true,
|
||||
"scaling_model": 2
|
||||
},
|
||||
"owner": "Gob.fr",
|
||||
"price": 330,
|
||||
"license": "Copyright",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"name": "Long term fire risk mitigation planner",
|
||||
"short_description": "Long term fire risk mitigation planner : provides list of actions to be performed to mitigate fire propagation",
|
||||
"logo": "./local_imgs/Long term fire risk mitigation planner.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "computing",
|
||||
"execution_requirements": {
|
||||
"cpus": 2,
|
||||
"ram": 1024,
|
||||
"disk_io": "30 MB/s",
|
||||
"parallel": false,
|
||||
"scaling_model": 2
|
||||
},
|
||||
"owner": "Gob.fr",
|
||||
"price": 30,
|
||||
"license": "GPLv3",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"name": "Fire propagation simulator",
|
||||
"short_description": "Fire propagation simulator",
|
||||
"logo": "./local_imgs/Fire propagation simulator.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "computing",
|
||||
"execution_requirements": {
|
||||
"cpus": 4,
|
||||
"ram": 8192,
|
||||
"storage": 30000,
|
||||
"gpus": 1,
|
||||
"disk_io": "30 MB/s",
|
||||
"parallel": true,
|
||||
"scaling_model": 2
|
||||
},
|
||||
"owner": "Gob.fr",
|
||||
"price": 39,
|
||||
"license": "GPLv3",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"name": "Environment builder",
|
||||
"short_description": "build simulated environment from real environmental data and fire mitigation rules ",
|
||||
"logo": "./local_imgs/Environment builder.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "computing",
|
||||
"execution_requirements": {
|
||||
"cpus": 1,
|
||||
"ram": 2049,
|
||||
"storage": 500,
|
||||
"gpus": 4,
|
||||
"disk_io": "30 MB/s",
|
||||
"parallel": true,
|
||||
"scaling_model": 2
|
||||
},
|
||||
"owner": "Gob.fr",
|
||||
"price": 39,
|
||||
"license": "GPLv3",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"api": "/v1/storage/",
|
||||
"content": [
|
||||
{
|
||||
"name": "IRT risk database",
|
||||
"short_description": "IRT Database instance",
|
||||
"logo": "./local_imgs/IRT risk database.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "database",
|
||||
"DCacronym": "DC_myDC",
|
||||
"size": 4000,
|
||||
"encryption": false,
|
||||
"redundancy": "RAID5",
|
||||
"throughput": "r:200,w:150",
|
||||
"bookingPrice": 60,
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"name": "IRT local file storage",
|
||||
"short_description": "S3 compliant IRT file storage",
|
||||
"logo": "./local_imgs/IRT local file storage.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "storage",
|
||||
"DCacronym": "DC_myDC",
|
||||
"size": 40000,
|
||||
"encryption": false,
|
||||
"redundancy": "RAID5S",
|
||||
"throughput": "r:300,w:350",
|
||||
"bookingPrice": 90,
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"api": "/v1/datacenter/",
|
||||
"content": [
|
||||
{
|
||||
"name": "Mundi datacenter",
|
||||
"acronym": "DC_myDC",
|
||||
"hosts": [
|
||||
"localhost:49618",
|
||||
"oc-catalog:49618"
|
||||
],
|
||||
"short_description": "Mundi Opencloud Instance",
|
||||
"logo": "./local_imgs/Mundi datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "IRT",
|
||||
"cpu": {
|
||||
"cores": 8,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 16384,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": [
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CNES datacenter",
|
||||
"acronym": "DC_superDC1",
|
||||
"hosts": [
|
||||
"localhost:49619",
|
||||
"dc1:49618"
|
||||
],
|
||||
"short_description": "CNES Opencloud Instance",
|
||||
"logo": "./local_imgs/CNES datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "IRT",
|
||||
"cpu": {
|
||||
"cores": 32,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 100000,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": []
|
||||
},
|
||||
{
|
||||
"name": "Meteo France datacenter",
|
||||
"acronym": "DC_superDC2",
|
||||
"hosts": [
|
||||
"localhost:49620",
|
||||
"dc2:49618"
|
||||
],
|
||||
"short_description": "Meteo France Opencloud Instance",
|
||||
"logo": "./local_imgs/Meteo France datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "Meteo France",
|
||||
"cpu": {
|
||||
"cores": 16,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 32786,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": [
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
135
scripts/demo_dc2.json
Normal file
@@ -0,0 +1,135 @@
|
||||
[
|
||||
{
|
||||
"api": "/v1/datacenter/",
|
||||
"content": [
|
||||
{
|
||||
"name": "Mundi datacenter",
|
||||
"acronym": "DC_myDC",
|
||||
"hosts": [
|
||||
"localhost:49618",
|
||||
"oc-catalog:49618"
|
||||
],
|
||||
"short_description": "Mundi Opencloud Instance",
|
||||
"logo": "./local_imgs/Mundi datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "IRT",
|
||||
"cpu": {
|
||||
"cores": 8,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 16384,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": [
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CNES datacenter",
|
||||
"acronym": "DC_superDC1",
|
||||
"hosts": [
|
||||
"localhost:49619",
|
||||
"dc1:49618"
|
||||
],
|
||||
"short_description": "CNES Opencloud Instance",
|
||||
"logo": "./local_imgs/CNES datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "IRT",
|
||||
"cpu": {
|
||||
"cores": 32,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 100000,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": []
|
||||
},
|
||||
{
|
||||
"name": "Meteo France datacenter",
|
||||
"acronym": "DC_superDC2",
|
||||
"hosts": [
|
||||
"localhost:49620",
|
||||
"dc2:49618"
|
||||
],
|
||||
"short_description": "Meteo France Opencloud Instance",
|
||||
"logo": "./local_imgs/Meteo France datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "Meteo France",
|
||||
"cpu": {
|
||||
"cores": 16,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 32786,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": [
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
135
scripts/demo_dc3.json
Normal file
@@ -0,0 +1,135 @@
|
||||
[
|
||||
{
|
||||
"api": "/v1/datacenter/",
|
||||
"content": [
|
||||
{
|
||||
"name": "Mundi datacenter",
|
||||
"acronym": "DC_myDC",
|
||||
"hosts": [
|
||||
"localhost:49618",
|
||||
"oc-catalog:49618"
|
||||
],
|
||||
"short_description": "Mundi Opencloud Instance",
|
||||
"logo": "./local_imgs/Mundi datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "IRT",
|
||||
"cpu": {
|
||||
"cores": 8,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 16384,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": [
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CNES datacenter",
|
||||
"acronym": "DC_superDC1",
|
||||
"hosts": [
|
||||
"localhost:49619",
|
||||
"dc1:49618"
|
||||
],
|
||||
"short_description": "CNES Opencloud Instance",
|
||||
"logo": "./local_imgs/CNES datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "IRT",
|
||||
"cpu": {
|
||||
"cores": 32,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 100000,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": []
|
||||
},
|
||||
{
|
||||
"name": "Meteo France datacenter",
|
||||
"acronym": "DC_superDC2",
|
||||
"hosts": [
|
||||
"localhost:49620",
|
||||
"dc2:49618"
|
||||
],
|
||||
"short_description": "Meteo France Opencloud Instance",
|
||||
"logo": "./local_imgs/Meteo France datacenter.png",
|
||||
"description": "A very long description of what this data is",
|
||||
"type": "datacenter",
|
||||
"bookingPrice": 650,
|
||||
"owner": "Meteo France",
|
||||
"cpu": {
|
||||
"cores": 16,
|
||||
"architecture": "x86",
|
||||
"shared": false
|
||||
},
|
||||
"ram": {
|
||||
"size": 32786,
|
||||
"ecc": false
|
||||
},
|
||||
"gpu": [
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
},
|
||||
{
|
||||
"cuda_cores": 10496,
|
||||
"model": "RTX 3090 FE",
|
||||
"memory": 24000,
|
||||
"tensor_cores": 328
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
15
scripts/generate_selfapi.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/env bash
|
||||
set -xe # Don't continue if first command fail
|
||||
|
||||
docker run \
|
||||
--rm \
|
||||
--user=$UID \
|
||||
--network=host \
|
||||
-v ${PWD}:/local \
|
||||
swaggerapi/swagger-codegen-cli:2.4.18 \
|
||||
generate -i /local/swagger/swagger.json -l go -o /local/selfapi_bak
|
||||
|
||||
if [ -d selfapi_bak ]; then
|
||||
rm -fr selfapi
|
||||
mv selfapi_bak selfapi
|
||||
fi
|
||||
BIN
scripts/local_imgs/CNES datacenter.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
scripts/local_imgs/Environment builder.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
scripts/local_imgs/Fire propagation simulator.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
scripts/local_imgs/Flammable vegetation slicer.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
scripts/local_imgs/IRT local file storage.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
scripts/local_imgs/IRT risk database.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
scripts/local_imgs/Long term fire risk mitigation planner.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
scripts/local_imgs/Meteo France datacenter.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
scripts/local_imgs/Meteo-France forecasts.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
scripts/local_imgs/Meteo-France wind archive.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
scripts/local_imgs/Mundi Sentienl 3 OLCI Images.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
scripts/local_imgs/Mundi Sentienl 3 SRAL Images.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
scripts/local_imgs/Mundi datacenter.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
scripts/local_imgs/SAR High points.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
62
scripts/populate_models.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
# Must specify a JSON with a following structure:
|
||||
|
||||
# [
|
||||
# {
|
||||
# "api": "endpoint",
|
||||
# "content": [
|
||||
# {} //obj to populate
|
||||
# ]
|
||||
# },
|
||||
# ]
|
||||
|
||||
ENDPOINT="http://localhost:49618"
|
||||
if [[ $DOCKER_ENVIRONMENT ]]; then
|
||||
ENDPOINT="http://oc-catalog:49618"
|
||||
fi
|
||||
|
||||
if [[ $DOCKER_ENDPOINT ]]; then
|
||||
ENDPOINT="$DOCKER_ENDPOINT"
|
||||
fi
|
||||
|
||||
[[ -z $1 ]] && { echo "Must specify a json path"; exit 1; }
|
||||
[[ ! -f $1 ]] && { echo "$1 is not a file"; exit 1; }
|
||||
cat "$1" | jq empty || { echo "$1 is not a valid JSON"; exit 1; }
|
||||
|
||||
########
|
||||
|
||||
while read row; do
|
||||
TRGT_ENDPOINT=$(echo $row | jq -r '.api')
|
||||
|
||||
while read item; do
|
||||
|
||||
img_data=$(echo $item | jq -r '.logo')
|
||||
# If is a path, replace with base64 encoded image
|
||||
if [[ $img_data =~ ^\./.* ]]; then
|
||||
if [[ ! -f ./scripts/"$img_data" ]]; then
|
||||
echo "File ./scripts/$img_data doesn't exist"; exit 1
|
||||
fi
|
||||
|
||||
item=$(echo $item | jq ".logo |= \"$(base64 -w0 ./scripts/"$img_data")\"")
|
||||
fi
|
||||
|
||||
echo `echo $item | jq -r '.name'` to $ENDPOINT${TRGT_ENDPOINT}
|
||||
|
||||
answer=$(curl --fail "$ENDPOINT${TRGT_ENDPOINT}" \
|
||||
-X POST \
|
||||
--data-binary "$item")
|
||||
|
||||
if [[ $? -ne 0 || "$answer" == *"<html>"* ]]; then
|
||||
echo -e "\nERROR: Some error ocurred when submitting"
|
||||
exit 1
|
||||
fi
|
||||
done < <(echo "$row" | jq -c '.content[]')
|
||||
done < <(jq -c '.[]' $1)
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo "All models submitted correctly!"
|
||||