여러대의 테스트 서버가 있고

각각의 응답이 잘 오는지 테스트 해보기 위해

간단히 batch 파일로...


echo 명령어를 통하여 hosts파일을 각각 변경하고

ipconfig /flushdns을 통해 hosts를 바로 인식


그리고 wegt을 통하여 api를 호출하고 응답을 txt로 담는다.



@rem hosts file backup
xcopy "%systemroot%\system32\drivers\etc\hosts" ".\" /s /y
echo 192.168.0.1 openapi.seoul.go.kr #testserver-01 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result01.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.2 openapi.seoul.go.kr #testserver-02 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result02.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.3 openapi.seoul.go.kr #testserver-03 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result03.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.4 openapi.seoul.go.kr #testserver-04 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result04.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.5 openapi.seoul.go.kr #testserver-05 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result05.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.6 openapi.seoul.go.kr #testserver-06 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result06.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.7 openapi.seoul.go.kr #testserver-07 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result07.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.8 openapi.seoul.go.kr #testserver-08 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result08.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.9 openapi.seoul.go.kr #testserver-09 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result09.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
echo 192.168.0.10 openapi.seoul.go.kr #testserver-10 > "%systemroot%\system32\drivers\etc\hosts"
ipconfig /flushdns
wget -O result10.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/"
@rem hosts file rollback
xcopy "hosts" "%systemroot%\system32\drivers\etc\" /s /y

+ Recent posts