Esempio n. 1
0
 def get(self):
     api_root = base_url() + 'api/v1/'
     websocket_root = base_ws_uri() + EVENTS_ENDPOINT
     docs_url = [
         'https://docs.bigchaindb.com/projects/server/en/v',
         version.__version__,
         '/http-client-server-api.html',
     ]
     return flask.jsonify({
         '_links': {
             'docs': ''.join(docs_url),
             'self': api_root,
             'statuses': api_root + 'statuses/',
             'transactions': api_root + 'transactions/',
             'streams_v1': websocket_root,
         },
     })
Esempio n. 2
0
 def get(self):
     api_root = base_url() + 'api/v1/'
     websocket_root = base_ws_uri() + EVENTS_ENDPOINT
     docs_url = [
         'https://docs.bigchaindb.com/projects/server/en/v',
         version.__version__,
         '/http-client-server-api.html',
     ]
     return flask.jsonify({
         '_links': {
             'docs': ''.join(docs_url),
             'self': api_root,
             'statuses': api_root + 'statuses/',
             'transactions': api_root + 'transactions/',
             'streams_v1': websocket_root,
         },
     })
Esempio n. 3
0
def get_api_v1_info(api_prefix):
    """Return a dict with all the information specific for the v1 of the
    api.
    """
    websocket_root = base_ws_uri() + EVENTS_ENDPOINT
    docs_url = [
        'https://docs.bigchaindb.com/projects/server/en/v',
        version.__version__,
        '/http-client-server-api.html',
    ]

    return {
        'docs': ''.join(docs_url),
        'transactions': '{}transactions/'.format(api_prefix),
        'assets': '{}assets/'.format(api_prefix),
        'outputs': '{}outputs/'.format(api_prefix),
        'streams': websocket_root,
        'metadata': '{}metadata/'.format(api_prefix),
    }
Esempio n. 4
0
def get_api_v1_info(api_prefix):
    """Return a dict with all the information specific for the v1 of the
    api.
    """
    websocket_root = base_ws_uri() + EVENTS_ENDPOINT
    docs_url = [
        'https://docs.bigchaindb.com/projects/server/en/v',
        version.__version__,
        '/http-client-server-api.html',
    ]

    return {
        'docs': ''.join(docs_url),
        'transactions': '{}transactions/'.format(api_prefix),
        'statuses': '{}statuses/'.format(api_prefix),
        'assets': '{}assets/'.format(api_prefix),
        'outputs': '{}outputs/'.format(api_prefix),
        'streams': websocket_root,
        'metadata': '{}metadata/'.format(api_prefix),
    }