Fossicking around in the shell with the API, I got (which could be useful for making fixtures/test data for unit tests) :
import pprint
import p2api
p = pprint.PrettyPrinter(indent=4)
api = p2api.ApiConnection('production', 'tlister', '<none of your business>')
runs, _ = api.getRuns()
p.pprint(runs)
[ { 'containerId': 4404207,
'delegated': True,
'instrument': 'FORS2',
'ipVersion': 116.07,
'isToO': False,
'itemCount': 16,
'mode': 'SM',
'observingConstraints': { 'fli': 'n',
'seeing': 0.8,
'skyTransparency': 'Clear'},
'owned': False,
'period': 116,
'pi': { 'emailAddress': '<snipped>',
'firstName': 'Colin',
'lastName': 'Snodgrass'},
'progId': '116.28N5.001',
'runId': 116232900,
'scheduledPeriod': 116,
'telescope': 'UT1',
'title': 'Characterising newly discovered distant comets to prepare '
'for the ESA Comet Interceptor mission',
'validFrom': '2025-10-01T16:00:00Z',
'validTo': '2026-05-01T16:00:00Z'}]
# Fetch Run, Container and items in the container
observing_run, _ = api.getRun(runs[0]['runId'])
container_id = observing_run['containerId']
items_in_run_container, _ = api.getItems(container_id)
# Print items (16 OBs, no other `itemType`s)
p.pprint(items_in_run_container)
[ { 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_1',
'obId': 4448538,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': '?',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_2',
'obId': 4448541,
'obStatus': '+',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_1',
'obId': 4448550,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_2',
'obId': 4448553,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_3',
'obId': 4448556,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_4',
'obId': 4448559,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': '?',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_5',
'obId': 4448562,
'obStatus': '+',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': '?',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_6',
'obId': 4448565,
'obStatus': '+',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': '?',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_7',
'obId': 4448568,
'obStatus': '+',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_1',
'obId': 4448574,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_1',
'obId': 4448577,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': '?',
'itemType': 'OB',
'name': 'MOV_TBD_IMG_1',
'obId': 4448613,
'obStatus': 'P',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_2',
'obId': 4448644,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_3',
'obId': 4448647,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': 'A',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_4',
'obId': 4448650,
'obStatus': 'C',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1},
{ 'grade': '?',
'itemType': 'OB',
'name': 'MOV_XXXXXX_IMG_5',
'obId': 4448653,
'obStatus': '+',
'parentContainerId': 4404207,
'runId': 116232900,
'userPriority': 1}]
When using the
tom_esofor a real proposal on the production phase2, I ran into an issue where there is an assumption that there is at least one folder with the OBs in it (as recommended in the p2 tutorial), whereas the real world sample size of 1 (so far) is different. As shown in the screenshot below (I doubt our target names are that secret but heh), when selecting the Run, the next dropdown of Folder Name is blank, preventing further progress.Fossicking around in the shell with the API, I got (which could be useful for making fixtures/test data for unit tests) :