...
 
Commits (12)
This diff is collapsed.
Citation Notice version 1.0
This Citation Notice is part of the LOFAR stager API software suite.
Parties that use ASTRON Software resulting in papers and/or publications are requested to refer to the DOI(s) that correspond(s) to the version(s) of the ASTRON Software used:
<List of DOIs>
Parties that use ASTRON Software for purposes that do not result in publications (e.g. commercial parties) are asked to inform ASTRON about their use of ASTRON Software, by sending an email to including the DOIs mentioned above in the message.
If you use (part of) this software please attribute the use to ASTRON as indicated in the file NOTICE in the root of the source code repository.
# Copyright 2019 Stichting Nederlandse Wetenschappelijk Onderzoek Instituten,
# ASTRON Netherlands Institute for Radio Astronomy
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is the Stager API wrapper module for the Lofar LTA staging service.
#
# It uses an xmlrpc proxy to talk and authenticate to the remote service. Your account credentials will be read from
......@@ -7,11 +20,11 @@
# !! This is to ensure that when we change the remote interface, your scripts don't break and you will only have to
# !! upgrade this module.
__version__ = "1.3"
__version__ = "1.4"
import datetime
from os.path import expanduser
from astropy.utils.compat.futures import process
# Python2/3 dependent stuff
from sys import version_info
......@@ -52,11 +65,11 @@ LtaStager = proxy.LtaStager
# ---
def stage(surls):
""" Stage list of SURLs """
def stage(surls, send_notifications=True):
""" Stage list of SURLs, optionally enable/disable email notifications """
if isinstance(surls, str):
surls = [surls]
stageid = proxy.LtaStager .add_getid(surls)
stageid = proxy.LtaStager.add_getid(surls, send_notifications)
return stageid
def get_status(stageid):
......@@ -67,6 +80,18 @@ def abort(stageid):
""" Abort running request / release data of a finished request with given ID """
return proxy.LtaStager.abort(stageid)
def get_surls_requested(stageid):
""" Get a list of all files that are requested via a running request with given ID """
return proxy.LtaStager.getrequestedurls(stageid)
def get_surls_pending(stageid):
""" Get a list of all files that are not yet online for a running request with given ID """
return proxy.LtaStager.getoutstandingurls(stageid)
def get_surls_failed(stageid):
""" Get a list of all files that have failed in a running request with given ID """
return proxy.LtaStager.getfailedurls(stageid)
def get_surls_online(stageid):
""" Get a list of all files that are already online for a running request with given ID """
return proxy.LtaStager.getstagedurls(stageid)
......