In [1]:
!wget http://pydap/downloadme.csv
--2019-10-28 09:12:13--  http://pydap/downloadme.csv
Resolving pydap (pydap)... 172.19.0.5
Connecting to pydap (pydap)|172.19.0.5|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-10-28 09:12:13 ERROR 404: Not Found.

In [2]:
!wget http://apache/downloadme.csv
--2019-10-28 09:12:18--  http://apache/downloadme.csv
Resolving apache (apache)... 172.19.0.2
Connecting to apache (apache)|172.19.0.2|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14 [text/csv]
Saving to: ‘downloadme.csv’

downloadme.csv      100%[===================>]      14  --.-KB/s    in 0s      

2019-10-28 09:12:18 (975 KB/s) - ‘downloadme.csv’ saved [14/14]

In [5]:
from pydap.client import open_url
dataset = open_url('http://hyrax:8080/opendap/SN99938.nc')
In [6]:
dataset
Out[6]:
<DatasetType with children 'time', 'latitude', 'longitude', 'air_pressure_at_sea_level', 'surface_air_pressure_2m', 'air_temperature_2m', 'air_pressure_at_sea_level_qnh', 'wind_speed_10m', 'wind_from_direction_10m', 'relative_humidity'>
In [7]:
from pydap.client import open_url
dataset = open_url('http://pydap:9090/SN99938.nc')
---------------------------------------------------------------------------
ConnectionRefusedError                    Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
    159             conn = connection.create_connection(
--> 160                 (self._dns_host, self.port), self.timeout, **extra_kw)
    161 

/opt/conda/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     79     if err is not None:
---> 80         raise err
     81 

/opt/conda/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     69                 sock.bind(source_address)
---> 70             sock.connect(sa)
     71             return sock

ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    602                                                   body=body, headers=headers,
--> 603                                                   chunked=chunked)
    604 

/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    354         else:
--> 355             conn.request(method, url, **httplib_request_kw)
    356 

/opt/conda/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1228         """Send a complete request to the server."""
-> 1229         self._send_request(method, url, body, headers, encode_chunked)
   1230 

/opt/conda/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
   1274             body = _encode(body, 'body')
-> 1275         self.endheaders(body, encode_chunked=encode_chunked)
   1276 

/opt/conda/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked)
   1223             raise CannotSendHeader()
-> 1224         self._send_output(message_body, encode_chunked=encode_chunked)
   1225 

/opt/conda/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked)
   1015         del self._buffer[:]
-> 1016         self.send(msg)
   1017 

/opt/conda/lib/python3.7/http/client.py in send(self, data)
    955             if self.auto_open:
--> 956                 self.connect()
    957             else:

/opt/conda/lib/python3.7/site-packages/urllib3/connection.py in connect(self)
    182     def connect(self):
--> 183         conn = self._new_conn()
    184         self._prepare_conn(conn)

/opt/conda/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
    168             raise NewConnectionError(
--> 169                 self, "Failed to establish a new connection: %s" % e)
    170 

NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f7bf15a07f0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    448                     retries=self.max_retries,
--> 449                     timeout=timeout
    450                 )

/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    640             retries = retries.increment(method, url, error=e, _pool=self,
--> 641                                         _stacktrace=sys.exc_info()[2])
    642             retries.sleep()

/opt/conda/lib/python3.7/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    398         if new_retry.is_exhausted():
--> 399             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    400 

MaxRetryError: HTTPConnectionPool(host='pydap', port=9090): Max retries exceeded with url: /SN99938.nc.dds (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7bf15a07f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
<ipython-input-7-00d203d8584d> in <module>
      1 from pydap.client import open_url
----> 2 dataset = open_url('http://pydap:9090/SN99938.nc')

/opt/conda/lib/python3.7/site-packages/pydap/client.py in open_url(url, application, session, output_grid, timeout, verify)
     65     """
     66     dataset = DAPHandler(url, application, session, output_grid,
---> 67                          timeout=timeout, verify=verify).dataset
     68 
     69     # attach server-side functions

/opt/conda/lib/python3.7/site-packages/pydap/handlers/dap.py in __init__(self, url, application, session, output_grid, timeout, verify)
     53         ddsurl = urlunsplit((scheme, netloc, path + '.dds', query, fragment))
     54         r = GET(ddsurl, application, session, timeout=timeout,
---> 55                 verify=verify)
     56         raise_for_status(r)
     57         dds = safe_charset_text(r)

/opt/conda/lib/python3.7/site-packages/pydap/net.py in GET(url, application, session, timeout, verify)
     27 
     28     response = follow_redirect(url, application=application, session=session,
---> 29                                timeout=timeout, verify=verify)
     30     # Decode request response (i.e. gzip)
     31     response.decode_content()

/opt/conda/lib/python3.7/site-packages/pydap/net.py in follow_redirect(url, application, session, timeout, verify)
     71 
     72     req = create_request(url, session=session, timeout=timeout,
---> 73                          verify=verify)
     74     return get_response(req, application, verify=verify)
     75 

/opt/conda/lib/python3.7/site-packages/pydap/net.py in create_request(url, session, timeout, verify)
    127         return create_request_from_session(url, requests.Session(),
    128                                            timeout=timeout,
--> 129                                            verify=verify)
    130 
    131 

/opt/conda/lib/python3.7/site-packages/pydap/net.py in create_request_from_session(url, session, timeout, verify)
    136         with closing(session.head(url, allow_redirects=True,
    137                                   timeout=timeout,
--> 138                                   verify=verify)) as head:
    139             req = Request.blank(head.url)
    140             req.environ['webob.client.timeout'] = timeout

/opt/conda/lib/python3.7/site-packages/requests/sessions.py in head(self, url, **kwargs)
    566 
    567         kwargs.setdefault('allow_redirects', False)
--> 568         return self.request('HEAD', url, **kwargs)
    569 
    570     def post(self, url, data=None, json=None, **kwargs):

/opt/conda/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    531         }
    532         send_kwargs.update(settings)
--> 533         resp = self.send(prep, **send_kwargs)
    534 
    535         return resp

/opt/conda/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
    644 
    645         # Send the request
--> 646         r = adapter.send(request, **kwargs)
    647 
    648         # Total elapsed time of the request (approximately)

/opt/conda/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    514                 raise SSLError(e, request=request)
    515 
--> 516             raise ConnectionError(e, request=request)
    517 
    518         except ClosedPoolError as e:

ConnectionError: HTTPConnectionPool(host='pydap', port=9090): Max retries exceeded with url: /SN99938.nc.dds (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7bf15a07f0>: Failed to establish a new connection: [Errno 111] Connection refused'))