Skip to content

Commit 9482761

Browse files
VIA-304 SB Add whooping-cough-vaccination.json to test data.
1 parent 835212d commit 9482761

File tree

2 files changed

+766
-4
lines changed

2 files changed

+766
-4
lines changed

wiremock/__files/update-from-int

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ fi
1010

1111
API_KEY="$1"
1212

13-
for file in *-vaccine.json *-children.json *-booster.json; do
13+
for file in *-vaccine.json *-children.json *-booster.json *-vaccination.json; do
1414
if [ -f "$file" ]; then
1515
filename_no_ext="${file%.json}"
1616

17-
curl -s -o "$file" "https://int.api.service.nhs.uk/nhs-website-content/vaccinations/${filename_no_ext}" --header 'Accept: application/json,' --header "apikey: ${API_KEY}"
18-
19-
echo "Updated $file"
17+
if curl -f -s -o "$file" "https://int.api.service.nhs.uk/nhs-website-content/vaccinations/${filename_no_ext}" --header 'Accept: application/json,' --header "apikey: ${API_KEY}"; then
18+
echo "Updated $file from vaccinations/"
19+
else
20+
sleep 5
21+
if curl -f -s -o "$file" "https://int.api.service.nhs.uk/nhs-website-content/pregnancy/keeping-well/${filename_no_ext}" --header 'Accept: application/json,' --header "apikey: ${API_KEY}"; then
22+
echo "Updated $file from pregnancy/keeping-well/"
23+
else
24+
echo "Failed to retrieve $file" >&2
25+
fi
26+
fi
2027
sleep 5
2128
fi
2229
done

0 commit comments

Comments
 (0)