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:
Troy McConaghy 2017-04-18 14:48:54 +02:00 committed by GitHub
commit e58102b5db
13 changed files with 31 additions and 39 deletions

2
.gitignore vendored
View File

@ -78,7 +78,7 @@ ntools/one-m/ansible/ansible.cfg
# Just in time documentation
docs/server/source/schema
docs/server/source/drivers-clients/samples
docs/server/source/http-samples
# Terraform state files
# See https://stackoverflow.com/a/41482391

View File

@ -1,8 +1,6 @@
"""This module provides the blueprint for the blocks API endpoints.
For more information please refer to the documentation on ReadTheDocs:
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
http-client-server-api.html
For more information please refer to the documentation: http://bigchaindb.com/http-api
"""
from flask import current_app
from flask_restful import Resource, reqparse

View File

@ -35,7 +35,7 @@ class ApiV1Index(Resource):
docs_url = [
'https://docs.bigchaindb.com/projects/server/en/v',
version.__version__,
'/drivers-clients/http-client-server-api.html',
'/http-client-server-api.html',
]
return flask.jsonify({
'_links': {

View File

@ -1,8 +1,6 @@
"""This module provides the blueprint for the statuses API endpoints.
For more information please refer to the documentation on ReadTheDocs:
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
http-client-server-api.html
For more information please refer to the documentation: http://bigchaindb.com/http-api
"""
from flask import current_app
from flask_restful import Resource, reqparse

View File

@ -1,8 +1,6 @@
"""This module provides the blueprint for some basic API endpoints.
For more information please refer to the documentation on ReadTheDocs:
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
http-client-server-api.html
For more information please refer to the documentation: http://bigchaindb.com/http-api
"""
import logging

View File

@ -1,8 +1,6 @@
"""This module provides the blueprint for the votes API endpoints.
For more information please refer to the documentation on ReadTheDocs:
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
http-client-server-api.html
For more information please refer to the documentation: http://bigchaindb.com/http-api
"""
from flask import current_app
from flask_restful import Resource, reqparse

View File

@ -53,7 +53,7 @@ At a high level, one can communicate with a BigchainDB cluster (set of nodes) us
</style>
<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 class="buttondiv">
<a class="button" href="http://docs.bigchaindb.com/projects/py-driver/en/latest/index.html">Python Driver Docs</a>

View File

@ -269,7 +269,7 @@ def main():
ctx['block_list'] = pretty_json(block_list)
base_path = os.path.join(os.path.dirname(__file__),
'source/drivers-clients/samples')
'source/http-samples')
if not os.path.exists(base_path):
os.makedirs(base_path)

View File

@ -14,12 +14,11 @@ community projects listed below.
.. toctree::
:maxdepth: 1
http-client-server-api
The Python Driver <https://docs.bigchaindb.com/projects/py-driver/en/latest/index.html>
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
nevertheless be very useful.

View File

@ -22,7 +22,7 @@ or ``https://example.com:9984``
then you should get an HTTP response
with something like the following in the body:
.. literalinclude:: samples/index-response.http
.. literalinclude:: http-samples/index-response.http
:language: http
@ -35,7 +35,7 @@ or ``https://example.com:9984/api/v1/``,
then you should get an HTTP response
that allows you to discover the BigchainDB API endpoints:
.. literalinclude:: samples/api-index-response.http
.. literalinclude:: http-samples/api-index-response.http
:language: http
@ -58,12 +58,12 @@ Transactions
**Example request**:
.. literalinclude:: samples/get-tx-id-request.http
.. literalinclude:: http-samples/get-tx-id-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-tx-id-response.http
.. literalinclude:: http-samples/get-tx-id-response.http
:language: http
:resheader Content-Type: ``application/json``
@ -110,12 +110,12 @@ Transactions
**Example request**:
.. literalinclude:: samples/get-tx-by-asset-request.http
.. literalinclude:: http-samples/get-tx-by-asset-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-tx-by-asset-response.http
.. literalinclude:: http-samples/get-tx-by-asset-response.http
:language: http
:resheader Content-Type: ``application/json``
@ -139,12 +139,12 @@ Transactions
**Example request**:
.. literalinclude:: samples/post-tx-request.http
.. literalinclude:: http-samples/post-tx-request.http
:language: http
**Example response**:
.. literalinclude:: samples/post-tx-response.http
.. literalinclude:: http-samples/post-tx-response.http
:language: http
:resheader Content-Type: ``application/json``
@ -227,12 +227,12 @@ Statuses
**Example request**:
.. literalinclude:: samples/get-statuses-tx-request.http
.. literalinclude:: http-samples/get-statuses-tx-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-statuses-tx-valid-response.http
.. literalinclude:: http-samples/get-statuses-tx-valid-response.http
:language: http
:resheader Content-Type: ``application/json``
@ -250,17 +250,17 @@ Statuses
**Example request**:
.. literalinclude:: samples/get-statuses-block-request.http
.. literalinclude:: http-samples/get-statuses-block-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-statuses-block-invalid-response.http
.. literalinclude:: http-samples/get-statuses-block-invalid-response.http
:language: http
**Example response**:
.. literalinclude:: samples/get-statuses-block-valid-response.http
.. literalinclude:: http-samples/get-statuses-block-valid-response.http
:language: http
:resheader Content-Type: ``application/json``
@ -298,12 +298,12 @@ Blocks
**Example request**:
.. literalinclude:: samples/get-block-request.http
.. literalinclude:: http-samples/get-block-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-block-response.http
.. literalinclude:: http-samples/get-block-response.http
:language: http
@ -353,12 +353,12 @@ Blocks
**Example request**:
.. literalinclude:: samples/get-block-txid-request.http
.. literalinclude:: http-samples/get-block-txid-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-block-txid-response.http
.. literalinclude:: http-samples/get-block-txid-response.http
:language: http
:resheader Content-Type: ``application/json``
@ -384,12 +384,12 @@ Votes
**Example request**:
.. literalinclude:: samples/get-vote-request.http
.. literalinclude:: http-samples/get-vote-request.http
:language: http
**Example response**:
.. literalinclude:: samples/get-vote-response.http
.. literalinclude:: http-samples/get-vote-response.http
:language: http
:resheader Content-Type: ``application/json``

View File

@ -11,6 +11,7 @@ BigchainDB Server Documentation
production-nodes/index
dev-and-test/index
server-reference/index
http-client-server-api
websocket-event-stream-api
drivers-clients/index
clusters-feds/index

View File

@ -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
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.)

View File

@ -23,7 +23,7 @@ def test_api_root_endpoint(client):
def test_api_v1_endpoint(client):
res = client.get('/api/v1')
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 == {
'_links': {