-
Notifications
You must be signed in to change notification settings - Fork 7
Archived Bundles
The archived bundle webservices is a set of webservices that exposes bundles that have been archived and allows for their subsequent retrieval.
Archived files can be retrieved either by their bundle id or by their bundle dataset and name pair. All bundles are archived by default to "/var/lib/oba/bundles/". To view or retrieve files within this path, the following webservices can be utilized:
- /api/bundle/latest
- /api/bundle/latest/final
- /api/bundle/archive/list-datasets
- /api/bundle/archive/list-by-name/{dataset}/{name}
- /api/bundle/archive/list-by-id/{id}
- /api/bundle/archive/get-by-name/{dataset}/{name}/{file}
- /api/bundle/archive/get-by-id/{id}/{file}
(and not part of the archived services but closely related)
- /api/bundle/list -- currently deployed bundles
- /api/bundle/staged/list -- currently staged bundles (next service change or have yet to pass QA and hence not deployed)
where
{dataset} represents the bundle directory name (eg: NOV14_SCH_UPDATE_3) {name} represents the bundle name (eg: NOV_U6) {id} represents the bundle id (eg: 701ba314-c89c-47c5-9dd9-5514f61b078d) {file} represents the file to be retrieved (eg: output_gtfs/19_ICT_June2014_google_transit_mod.zip)
Note that {file} can include forward slashes to denote files that exist in subdirectories of the bundle's base directory.
latest: Returns the id, dataset, and name attributes of the latest bundle available for deployment.
latest-final: Returns the list of gtfs (final) files available for deployment.
list-datasets: This webservice retrieves the list of all archived bundles, exposing their dataset, bundle name, and bundle id if the metadata.json file exists within the bundle's outputs directory (this excludes bundles that failed to build, as they would not have the metadata.json file present to extract this information).
http://admin.staging.obast.org:9999/api/bundle/archive/list-datasets
[{"dataset":"SEPT14_1","name":"SEPT14_1_PRE"},{"dataset":"SEPT14_1","name":"demo"},{"dataset":"NOV14_BROKEN","name":"a"},{"dataset":"NOV14_BROKEN","name":"test"},{"dataset":"NOV_ET_UPDATE_2","name":"NOV_U2"},{"dataset":"NOV_ET_UPDATE_2","name":"NOV_KCM_U2"},{"dataset":"NOV_ET_UPDATE_2","name":"NOV_U3"},{"dataset":"NOV_ET_UPDATE_2","name":"NOV_KCM_U1"},{"dataset":"NOV_ET_UPDATE_2","name":"NOV14_U2"},{"dataset":"NOV_ET_UPDATE_2","name":"NOV_KCM_UPDATE_1"},{"dataset":"NOV_ET_UPDATE_2","name":"test"},{"dataset":"JUN14_2","name":"1"},{"dataset":"JUN14_2","name":"2"},{"dataset":"JUN14_2_RAW","name":"1"},{"dataset":"JUN14_2_RAW","name":"18"},{"dataset":"JUN14_2_RAW","name":"q"},{"dataset":"JUN14_2_RAW","name":"18-1"},{"dataset":"JUN14_MERGED","name":"1"},{"dataset":"JUN14_MERGED","name":"JUN14_M_1"},{"dataset":"JUN14","name":"Jun14_Test"},{"dataset":"JUN14","name":"demo"},{"dataset":"SEPT_UPDATE","name":"sab_test"},{"dataset":"SEPT_UPDATE","name":"test_sept"},{"dataset":"SEPT_UPDATE","name":"SEPT14_U1"},{"dataset":"SEPT14_2","name":"BundleSwappingTest04"},{"dataset":"SEPT14_2","name":"BundleSwapTest06"},{"dataset":"SEPT14_2","name":"BundleSwapTest07"},{"dataset":"SEPT14_2","name":"BundleSwappingTest03"},{"dataset":"SEPT14_2","name":"BundleSwappingTest07"},{"dataset":"SEPT14_2","name":"SEPT14_2_PRE"},{"dataset":"SEPT14_2","name":"TestBundleSwapping06"},{"dataset":"SEPT14_2","name":"BundleSwappingTest01"},{"dataset":"NOV_KCM_UPDATE_1","name":"NOV_KCM_U2"},{"dataset":"NOV_KCM_UPDATE_1","name":"NOV_KCM_U1"},{"dataset":"NOV_KCM_UPDATE_1","name":"NOV14_U2"},{"dataset":"NOV_KCM_UPDATE_1","name":"NOV_KCM_UPDATE_1"},{"dataset":"NOV_KCM_UPDATE_1","name":"test"},{"dataset":"NOV14_UPDATE","name":"NOV14_U1"},{"dataset":"NOV14_UPDATE","name":"Nov14_u_661"},{"dataset":"JUN14_UPDATE","name":"1"},{"dataset":"JUN14_UPDATE","name":"JUN14_U_r01_b01"},{"dataset":"JUN14_UPDATE","name":"2"},{"dataset":"BundleTestJP2","name":"Test_JP5"},{"dataset":"BundleTestJP2","name":"Test_JP2"},{"dataset":"BundleTestJP2","name":"Test_JP3"},{"dataset":"BundleTestJP2","name":"Test_JP4"},{"dataset":"BundleTestJP2","name":"test_jp2"},{"dataset":"BundleTestJP1","name":"Test_JP1"},{"dataset":"NOV14_SCH_UPDATE_3","name":"NOV14_u5"},{"id":"701ba314-c89c-47c5-9dd9-5514f61b078d","dataset":"NOV14_SCH_UPDATE_3","name":"NOV_U6"},{"dataset":"NOV14_SCH_UPDATE_3","name":"NOV14_U4"}]
list-by-name: Given the dataset and name of the bundle, this webservice returns the list of all of files in the bundle's base directory and all subdirectories.
list-by-id: Given the bundle id (which can be found in the metadata.json file in the outputs directory), this webservice returns the list of all of files in the bundle's base directory and all subdirectories.
http://admin.staging.obast.org:9999/api/bundle/archive/list-by-name/NOV14_SCH_UPDATE_3/NOV_U6 ... which is the equivalent to http://admin.staging.obast.org:9999/api/bundle/archive/list-by-id/701ba314-c89c-47c5-9dd9-5514f61b078d
["output_gtfs/19_ICT_June2014_google_transit_mod.zip","output_gtfs/3_Google_Transit_mod.zip","output_gtfs/29_google_transit_mod.zip","output_gtfs/1_google_transit_daily_mod.zip","output_gtfs/97_ET_mod.zip","output_gtfs/40_STSimple_14Fall_mod.zip","output_gtfs/98_SCH_for_OBA_Nov2014_mod.zip","NOV_U6.tar.gz","inputs/1_google_transit_daily.zip","inputs/19_ICT_June2014_google_transit.zip","inputs/29_CT_Routes_Stops_GISData_Sept2014.zip","inputs/98_SCH_for_OBA_Nov2014.zip","inputs/97_ET.zip","inputs/29_CT_BusSchedule_HastusData_xml_Sept2014.zip","inputs/3_Google_Transit.zip","inputs/40_STSimple_14Fall.zip","outputs/1_google_transit_daily_mod_mod.zip","outputs/gtfs_validation_pre.csv","outputs/19_ICT_June2014_google_transit_mod.zip","outputs/3_Google_Transit_mod.zip","outputs/change_log.csv","outputs/29_google_transit_mod.zip","outputs/stop_verification.csv","outputs/1_google_transit_daily_mod.zip","outputs/97_ET_mod.zip","outputs/3_Google_Transit_mod_mod.zip","outputs/gtfs_validation_post.csv","outputs/metadata.json","outputs/bundleBuilder.out.txt","outputs/diff_log.csv","outputs/gtfs_stats.csv","outputs/gtfs_trips_with_missing_shape_ids.csv","outputs/40_STSimple_14Fall_mod.zip","outputs/98_SCH_for_OBA_Nov2014_mod.zip","outputs/summary.csv"]
get-by-name: Given the dataset and name of the bundle as well as a file to retrieve, this webservice returns the contents of the file
http://admin.staging.obast.org:9999/api/bundle/archive/get-by-name/NOV14_SCH_UPDATE_3/NOV_U6/output_gtfs/19_ICT_June2014_google_transit_mod.zip if invoked from a browser, this endpoint would return the contents of the zip file converted into a character string using utf-8 encoding. However, we can download this file by saving the page as a local file through a browser, or we can directly retrieve this file from the command line through a wget call.
get-by-id: Given the id of a bundle as well as a file to retrieve, this webservice returns the contents of the file
to mimic the response we retrieved in the previous example, we would call this action with the bundle's id as its parameters: http://admin.staging.obast.org:9999/api/bundle/archive/get-by-id/701ba314-c89c-47c5-9dd9-5514f61b078d/output_gtfs/19_ICT_June2014_google_transit_mod.zip