-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
177 lines (168 loc) · 4.88 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
---
swagger: '2.0'
################################################################################
# API Information #
################################################################################
info:
version: "0.0.1"
title: P-Monitor
description: P-Project official seeder monitor.
termsOfService: http://helloreverb.com/terms/
contact:
name: P-Team
email: contact@p-project.com
url: http://p-project.io
license:
name: MIT
url: http://opensource.org/licenses/MIT
################################################################################
# Host, Base Path, Schemes and Content Types #
################################################################################
host: p-monitor.io
basePath: /api
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
################################################################################
# Security #
################################################################################
securityDefinitions:
basicAuth:
type: basic
description: HTTP Basic Authentication. Works over `HTTP` and `HTTPS`
################################################################################
# Parameters #
################################################################################
parameters:
torrent_hash:
name: torrent_hash
in: path
description: The torrent hash
type: string
required: true
################################################################################
# Paths #
################################################################################
paths:
/torrents/:
get:
security:
- basicAuth: []
summary: Torrents
description: |
The Torrents endpoint returns a list of torrents
responses:
200:
description: An array of torrent_hash
schema:
type: array
items:
$ref: '#/definitions/Torrent'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
parameters:
- name: torrent
in: body
description: the new torrent to declare
required: true
schema:
$ref: '#/definitions/Torrent'
security:
- basicAuth: []
summary: Torrents
description: |
Declare a new torrent
responses:
200:
description: ok
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/torrents/{torrent_hash}:
parameters:
- $ref: '#/parameters/torrent_hash'
get:
security:
- basicAuth: []
summary: Torrents
description: |
The Torrents endpoint returns a torrent based on the query
responses:
200:
description: Torrent
schema:
type: object
properties:
torrent:
$ref: '#/definitions/Torrent'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
security:
- basicAuth: []
summary: Torrents
description: |
Notify torrent not being seeded by connected user
responses:
200:
description: ok
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
parameters:
- name: torrent
in: body
description: The modified torrent
required: true
schema:
$ref: '#/definitions/Torrent'
security:
- basicAuth: []
summary: Torrents
description: |
Modify an existing torrent. Require to be the initial seeder
responses:
200:
description: ok
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
################################################################################
# Definitions #
################################################################################
definitions:
Torrent:
type: object
properties:
torrent_hash:
type: string
description: Unique hash representing the torrent
torrent_name:
type: string
description: Torrent name
num_peers:
type: integer
description: The number of peers
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string