Retrieve external data


I have seen there is a toolbox function for this purpose:

However, It does not seem to work with: url="" which is the same you are using in documentation examples like: How to call a service with the CDS API

The app:

import cdstoolbox as ct

@ct.application(title='Download data')
def download_application():
    data = ct.cdm.external_retrieve(
    return data

The error: 

Traceback (most recent call last):
  File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/", line 59, in handle_request
    result = cached(context.method, proc, context, context.args, context.kwargs)
  File "/opt/cdstoolbox/cdscompute/cdscompute/", line 108, in cached
    result = proc(context, *context.args, **context.kwargs)
  File "/opt/cdstoolbox/cdscompute/cdscompute/", line 124, in __call__
    return p(*args, **kwargs)
  File "/opt/cdstoolbox/cdscompute/cdscompute/", line 60, in __call__
    return self.proc(context, *args, **kwargs)
  File "/home/cds/cdsservices/services/cdm/", line 42, in external_retrieve
    raise ValueError("URL is not allowed")
ValueError: URL is not allowed

Could you provide a working example of this functionality?

Thank you beforehand,

Antonio Pérez

Hi Antonio,

Currently this functionality is normally restricted to 'internal' CDS developers only i.e. users cannot access arbitrary external files from the Toolbox,