diff --git a/SAS/TMSS/client/lib/tmss_http_rest_client.py b/SAS/TMSS/client/lib/tmss_http_rest_client.py index 92ce074dc55de14ef1dfa2ca12b63e76e2dc2c2d..aa7b17b90d6152c6582572df63f69030ddc2145d 100644 --- a/SAS/TMSS/client/lib/tmss_http_rest_client.py +++ b/SAS/TMSS/client/lib/tmss_http_rest_client.py @@ -691,11 +691,12 @@ class TMSSsession(object): scheduling_unit['specifications_doc'] = self.get_schedulingunit_draft_specifications_doc(scheduling_unit_draft_id) return scheduling_unit - def get_schedulingunit_blueprint(self, scheduling_unit_blueprint_id: str, extended: bool=True, include_specifications_doc: bool=False) -> dict: + def get_schedulingunit_blueprint(self, scheduling_unit_blueprint_id: str, extended: bool=False, slim: bool=False, include_specifications_doc: bool=False) -> dict: '''get the schedulingunit_blueprint as dict for the given scheduling_unit_blueprint_id. When extended==True then you get the full scheduling_unit,task,subtask tree. + When slim==True then you get a slimmed-down version of the scheduling_unit with the most relevant info. When include_specifications_doc==True then an exported/generated spcifications_doc is included representing the task graph and its settings.''' - scheduling_unit = self.get_path_as_json_object('scheduling_unit_blueprint%s/%s' % ('_extended' if extended else '', scheduling_unit_blueprint_id)) + scheduling_unit = self.get_path_as_json_object('scheduling_unit_blueprint%s/%s' % ('_extended' if extended else '_slim' if slim else '', scheduling_unit_blueprint_id)) if include_specifications_doc: scheduling_unit['specifications_doc'] = self.get_schedulingunit_blueprint_specifications_doc(scheduling_unit_blueprint_id) return scheduling_unit @@ -900,3 +901,9 @@ class TMSSsession(object): returns the new sibling scheduling_unit_blueprint upon success, or raises.""" return self.post_to_path_and_get_result_as_json_object('scheduling_unit_blueprint/%s/create_lofar2_sibling' % (scheduling_unit_blueprint_id), retry_count=retry_count) + + def get_stations(self, retry_count: int=DEFAULT_RETRY_COUNT) -> {}: + '''get a dict of all lofar stations and their properties (currently only lat/long and version)''' + return self.get_path_as_json_object('/util/stations', retry_count=retry_count) + +