API から気象データにアクセスしていて、Apache nifi を使用して、最初の API によって返された json 配列内のすべての都市の気象データを取得したいですか?
基本的に、2 つの API を介してデータにアクセスしています。
この API は、JSON 配列要素に米国内のすべての都市のリストを含む JSON 配列を返します。
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"conditions": 1
}
, "results": [
{
"name": "Keyhole",
"city": "Keyhole",
"state": "WY",
"country": "US",
"country_iso3166":"US",
"country_name":"USA",
"zmw": "82721.7.99999",
"l": "/q/zmw:82721.7.99999"
}
,
{
"name": "Cuchara Valley Airport At La Veta",
"city": "Cuchara Valley Airport At La Veta",
"state": "CO",
"country": "US",
"country_iso3166":"US",
"country_name":"USA",
"zmw": "81055.6.99999",
"l": "/q/zmw:81055.6.99999"
}
,
ここで、この配列を反復処理し、州と都市の情報を使用して、以下のような別の API で使用したいと考えています。
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"conditions": 1
}
}
, "current_observation": {
"image": {
"url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png",
"title":"Weather Underground",
"link":"http://www.wunderground.com"
},
"display_location": {
"full":"San Francisco, CA",
"city":"San Francisco",
"state":"CA",
"state_name":"California",
"country":"US",
"country_iso3166":"US",
"zip":"94101",
"magic":"1",
"wmo":"99999",
"latitude":"37.77500916",
"longitude":"-122.41825867",
"elevation":"47.00000000"
},
"observation_location": {
"full":"SOMA - Near Van Ness, San Francisco, California",
"city":"SOMA - Near Van Ness, San Francisco",
"state":"California",
"country":"US",
"country_iso3166":"US",
"latitude":"37.773285",
"longitude":"-122.417725",
"elevation":"49 ft"
},...
したがって、基本的には、最初の API から取得する州と都市のすべての組み合わせに対して、2 番目の API をループで実行する必要があります。
これまでに作成した基本的な NiFi フローは、この質問に添付されているとおりですが、機能していません。誰かが私がここで間違っていることを理解するのを手伝ってもらえますか?