mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #1383 from bigchaindb/docs/1170/move-http-api-docs-to-top-level-section
Moved HTTP API docs to top-level page & fixed all links to that page
This commit is contained in:
commit
e58102b5db
2
.gitignore
vendored
2
.gitignore
vendored
@ -78,7 +78,7 @@ ntools/one-m/ansible/ansible.cfg
|
|||||||
|
|
||||||
# Just in time documentation
|
# Just in time documentation
|
||||||
docs/server/source/schema
|
docs/server/source/schema
|
||||||
docs/server/source/drivers-clients/samples
|
docs/server/source/http-samples
|
||||||
|
|
||||||
# Terraform state files
|
# Terraform state files
|
||||||
# See https://stackoverflow.com/a/41482391
|
# See https://stackoverflow.com/a/41482391
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
"""This module provides the blueprint for the blocks API endpoints.
|
"""This module provides the blueprint for the blocks API endpoints.
|
||||||
|
|
||||||
For more information please refer to the documentation on ReadTheDocs:
|
For more information please refer to the documentation: http://bigchaindb.com/http-api
|
||||||
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
|
|
||||||
http-client-server-api.html
|
|
||||||
"""
|
"""
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_restful import Resource, reqparse
|
from flask_restful import Resource, reqparse
|
||||||
|
@ -35,7 +35,7 @@ class ApiV1Index(Resource):
|
|||||||
docs_url = [
|
docs_url = [
|
||||||
'https://docs.bigchaindb.com/projects/server/en/v',
|
'https://docs.bigchaindb.com/projects/server/en/v',
|
||||||
version.__version__,
|
version.__version__,
|
||||||
'/drivers-clients/http-client-server-api.html',
|
'/http-client-server-api.html',
|
||||||
]
|
]
|
||||||
return flask.jsonify({
|
return flask.jsonify({
|
||||||
'_links': {
|
'_links': {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
"""This module provides the blueprint for the statuses API endpoints.
|
"""This module provides the blueprint for the statuses API endpoints.
|
||||||
|
|
||||||
For more information please refer to the documentation on ReadTheDocs:
|
For more information please refer to the documentation: http://bigchaindb.com/http-api
|
||||||
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
|
|
||||||
http-client-server-api.html
|
|
||||||
"""
|
"""
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_restful import Resource, reqparse
|
from flask_restful import Resource, reqparse
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
"""This module provides the blueprint for some basic API endpoints.
|
"""This module provides the blueprint for some basic API endpoints.
|
||||||
|
|
||||||
For more information please refer to the documentation on ReadTheDocs:
|
For more information please refer to the documentation: http://bigchaindb.com/http-api
|
||||||
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
|
|
||||||
http-client-server-api.html
|
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
"""This module provides the blueprint for the votes API endpoints.
|
"""This module provides the blueprint for the votes API endpoints.
|
||||||
|
|
||||||
For more information please refer to the documentation on ReadTheDocs:
|
For more information please refer to the documentation: http://bigchaindb.com/http-api
|
||||||
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
|
|
||||||
http-client-server-api.html
|
|
||||||
"""
|
"""
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_restful import Resource, reqparse
|
from flask_restful import Resource, reqparse
|
||||||
|
@ -53,7 +53,7 @@ At a high level, one can communicate with a BigchainDB cluster (set of nodes) us
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="buttondiv">
|
<div class="buttondiv">
|
||||||
<a class="button" href="http://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/http-client-server-api.html">HTTP API Docs</a>
|
<a class="button" href="http://bigchaindb.com/http-api">HTTP API Docs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttondiv">
|
<div class="buttondiv">
|
||||||
<a class="button" href="http://docs.bigchaindb.com/projects/py-driver/en/latest/index.html">Python Driver Docs</a>
|
<a class="button" href="http://docs.bigchaindb.com/projects/py-driver/en/latest/index.html">Python Driver Docs</a>
|
||||||
|
@ -269,7 +269,7 @@ def main():
|
|||||||
ctx['block_list'] = pretty_json(block_list)
|
ctx['block_list'] = pretty_json(block_list)
|
||||||
|
|
||||||
base_path = os.path.join(os.path.dirname(__file__),
|
base_path = os.path.join(os.path.dirname(__file__),
|
||||||
'source/drivers-clients/samples')
|
'source/http-samples')
|
||||||
if not os.path.exists(base_path):
|
if not os.path.exists(base_path):
|
||||||
os.makedirs(base_path)
|
os.makedirs(base_path)
|
||||||
|
|
||||||
|
@ -14,12 +14,11 @@ community projects listed below.
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
http-client-server-api
|
|
||||||
The Python Driver <https://docs.bigchaindb.com/projects/py-driver/en/latest/index.html>
|
The Python Driver <https://docs.bigchaindb.com/projects/py-driver/en/latest/index.html>
|
||||||
Transaction CLI <https://docs.bigchaindb.com/projects/cli/en/latest/>
|
Transaction CLI <https://docs.bigchaindb.com/projects/cli/en/latest/>
|
||||||
|
|
||||||
|
|
||||||
Community Driven Libraries and Tools
|
Community-Driven Libraries and Tools
|
||||||
------------------------------------
|
------------------------------------
|
||||||
Please note that some of these projects may be work in progress, but may
|
Please note that some of these projects may be work in progress, but may
|
||||||
nevertheless be very useful.
|
nevertheless be very useful.
|
||||||
|
@ -22,7 +22,7 @@ or ``https://example.com:9984``
|
|||||||
then you should get an HTTP response
|
then you should get an HTTP response
|
||||||
with something like the following in the body:
|
with something like the following in the body:
|
||||||
|
|
||||||
.. literalinclude:: samples/index-response.http
|
.. literalinclude:: http-samples/index-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ or ``https://example.com:9984/api/v1/``,
|
|||||||
then you should get an HTTP response
|
then you should get an HTTP response
|
||||||
that allows you to discover the BigchainDB API endpoints:
|
that allows you to discover the BigchainDB API endpoints:
|
||||||
|
|
||||||
.. literalinclude:: samples/api-index-response.http
|
.. literalinclude:: http-samples/api-index-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
|
|
||||||
@ -58,12 +58,12 @@ Transactions
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-tx-id-request.http
|
.. literalinclude:: http-samples/get-tx-id-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-tx-id-response.http
|
.. literalinclude:: http-samples/get-tx-id-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
||||||
@ -110,12 +110,12 @@ Transactions
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-tx-by-asset-request.http
|
.. literalinclude:: http-samples/get-tx-by-asset-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-tx-by-asset-response.http
|
.. literalinclude:: http-samples/get-tx-by-asset-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
||||||
@ -139,12 +139,12 @@ Transactions
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/post-tx-request.http
|
.. literalinclude:: http-samples/post-tx-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/post-tx-response.http
|
.. literalinclude:: http-samples/post-tx-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
||||||
@ -227,12 +227,12 @@ Statuses
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-statuses-tx-request.http
|
.. literalinclude:: http-samples/get-statuses-tx-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-statuses-tx-valid-response.http
|
.. literalinclude:: http-samples/get-statuses-tx-valid-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
||||||
@ -250,17 +250,17 @@ Statuses
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-statuses-block-request.http
|
.. literalinclude:: http-samples/get-statuses-block-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-statuses-block-invalid-response.http
|
.. literalinclude:: http-samples/get-statuses-block-invalid-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-statuses-block-valid-response.http
|
.. literalinclude:: http-samples/get-statuses-block-valid-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
||||||
@ -298,12 +298,12 @@ Blocks
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-block-request.http
|
.. literalinclude:: http-samples/get-block-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-block-response.http
|
.. literalinclude:: http-samples/get-block-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
|
|
||||||
@ -353,12 +353,12 @@ Blocks
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-block-txid-request.http
|
.. literalinclude:: http-samples/get-block-txid-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-block-txid-response.http
|
.. literalinclude:: http-samples/get-block-txid-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
||||||
@ -384,12 +384,12 @@ Votes
|
|||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-vote-request.http
|
.. literalinclude:: http-samples/get-vote-request.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
.. literalinclude:: samples/get-vote-response.http
|
.. literalinclude:: http-samples/get-vote-response.http
|
||||||
:language: http
|
:language: http
|
||||||
|
|
||||||
:resheader Content-Type: ``application/json``
|
:resheader Content-Type: ``application/json``
|
@ -11,6 +11,7 @@ BigchainDB Server Documentation
|
|||||||
production-nodes/index
|
production-nodes/index
|
||||||
dev-and-test/index
|
dev-and-test/index
|
||||||
server-reference/index
|
server-reference/index
|
||||||
|
http-client-server-api
|
||||||
websocket-event-stream-api
|
websocket-event-stream-api
|
||||||
drivers-clients/index
|
drivers-clients/index
|
||||||
clusters-feds/index
|
clusters-feds/index
|
||||||
|
@ -141,7 +141,7 @@ If you used `bigchaindb -y configure mongodb` to create a default local config f
|
|||||||
|
|
||||||
## server.bind, server.loglevel, server.workers & server.threads
|
## server.bind, server.loglevel, server.workers & server.threads
|
||||||
|
|
||||||
These settings are for the [Gunicorn HTTP server](http://gunicorn.org/), which is used to serve the [HTTP client-server API](../drivers-clients/http-client-server-api.html).
|
These settings are for the [Gunicorn HTTP server](http://gunicorn.org/), which is used to serve the [HTTP client-server API](../http-client-server-api.html).
|
||||||
|
|
||||||
`server.bind` is where to bind the Gunicorn HTTP server socket. It's a string. It can be any valid value for [Gunicorn's bind setting](http://docs.gunicorn.org/en/stable/settings.html#bind). If you want to allow IPv4 connections from anyone, on port 9984, use '0.0.0.0:9984'. In a production setting, we recommend you use Gunicorn behind a reverse proxy server. If Gunicorn and the reverse proxy are running on the same machine, then use 'localhost:PORT' where PORT is _not_ 9984 (because the reverse proxy needs to listen on port 9984). Maybe use PORT=9983 in that case because we know 9983 isn't used. If Gunicorn and the reverse proxy are running on different machines, then use 'A.B.C.D:9984' where A.B.C.D is the IP address of the reverse proxy. There's [more information about deploying behind a reverse proxy in the Gunicorn documentation](http://docs.gunicorn.org/en/stable/deploy.html). (They call it a proxy.)
|
`server.bind` is where to bind the Gunicorn HTTP server socket. It's a string. It can be any valid value for [Gunicorn's bind setting](http://docs.gunicorn.org/en/stable/settings.html#bind). If you want to allow IPv4 connections from anyone, on port 9984, use '0.0.0.0:9984'. In a production setting, we recommend you use Gunicorn behind a reverse proxy server. If Gunicorn and the reverse proxy are running on the same machine, then use 'localhost:PORT' where PORT is _not_ 9984 (because the reverse proxy needs to listen on port 9984). Maybe use PORT=9983 in that case because we know 9983 isn't used. If Gunicorn and the reverse proxy are running on different machines, then use 'A.B.C.D:9984' where A.B.C.D is the IP address of the reverse proxy. There's [more information about deploying behind a reverse proxy in the Gunicorn documentation](http://docs.gunicorn.org/en/stable/deploy.html). (They call it a proxy.)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ def test_api_root_endpoint(client):
|
|||||||
def test_api_v1_endpoint(client):
|
def test_api_v1_endpoint(client):
|
||||||
res = client.get('/api/v1')
|
res = client.get('/api/v1')
|
||||||
docs_url = ['https://docs.bigchaindb.com/projects/server/en/vtsttst',
|
docs_url = ['https://docs.bigchaindb.com/projects/server/en/vtsttst',
|
||||||
'/drivers-clients/http-client-server-api.html',
|
'/http-client-server-api.html',
|
||||||
]
|
]
|
||||||
assert res.json == {
|
assert res.json == {
|
||||||
'_links': {
|
'_links': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user