import requests


def registry(url, resource='/registry'):
    """Retrieve the chip spec registry

    Args:
        url (str): protocol://host:port/path
        resource (str): /registry/resource/path (default: /registry)

    Returns:
        list

    Example:
        >>> chipmunk.registry(url='http://host:port/path')
         [{'data_fill': '-9999',
           'data_mask': {},
           'data_range': [],
           'data_scale': None,
           'data_shape': [100, 100],
           'data_type': 'INT16',
           'data_units': None,
           'info': 'band 5 top-of-atmosphere reflectance',
           'tags': ['swir1', 'b5', 'tab5', 'lt05', 'lt05_tab5', 'ta'],
           'ubid': 'LT05_TAB5'},
          {'data_fill': '-9999',
           'data_mask': {},
           'data_range': [],
           'data_scale': None,
           'data_shape': [100, 100],
           'data_type': 'INT16',
           'data_units': None,
           'info': 'band 7 top-of-atmosphere reflectance',
           'tags': ['lt05_tab7', 'b7', 'lt05', 'swir2', 'tab7', 'ta'],
           'ubid': 'LT05_TAB7'}, ...]
    """
    
    return requests.get(url="{}{}".format(url, resource)).json()