-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
142 lines (141 loc) · 3.53 KB
/
swagger.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
swagger: '2.0'
info:
title: uspeak API
description: Free speech for all
version: 1.69.42
host: uspeak.io
schemes:
- https
basePath: /api/v1
produces:
- application/json
paths:
/status:
get:
description: Returns the status of the current node
responses:
'200':
description: Successful Status Response
schema:
$ref: '#/definitions/StatusInfo'
'/tangle/random':
get:
description: Get a list of random sites
responses:
'200':
description: Results were found
schema:
title: results
type: array
items:
$ref: '#/definitions/Site'
'/tangle/{hash}':
get:
description: Returns the site with the specified hash
parameters:
- name: hash
in: path
type: string
required: true
description: Base64 encoded hash of the site
responses:
'200':
description: Site was found
schema:
$ref: '#/definitions/Site'
'404':
description: No site found
schema:
$ref: '#/definitions/Error'
post:
description: Create a new site
consumes:
- application/json
parameters:
- name: hash
in: path
type: string
description: 'Actually the type of the site to add. Stupid swagger limitations...'
required: true
- in: body
name: body
description: Site object to be added
required: true
schema:
$ref: '#/definitions/Site'
responses:
'201':
description: Site was created
'400':
description: Invalid nonce
/tangle:
get:
description: Queries for sites
parameters:
- in: query
name: q
description: Text to perform a full-post search for
type: string
responses:
'200':
description: Results were found
schema:
title: results
type: array
items:
$ref: '#/definitions/Site'
definitions:
StatusInfo:
type: object
properties:
address:
type: string
description: Hostname/IP of the node serving this information
version:
type: string
description: Version Identifier of the running node.
length:
type: integer
description: Count of sites this node stores
connections:
type: array
items:
type: string
description: List of nodes this one is connected to
Site:
type: object
properties:
hash:
type: string
description: Base64 encoded hash of the site
bubblebabble:
type: string
description: Bubblebabble encoded hash of the site
validates:
type: array
items:
type: string
description: Base64 encoded hashes of the sites which this site validate
type:
type: string
description: Type of the stored data (Post/Image)
content:
type: string
description: Hashed site content
weight:
type: integer
description: Count of sites validating (directly or indirectly) this site
nonce:
type: integer
description: Calculated nonce
data:
type: object
description: Object specific schema
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string