-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswagger.yaml
155 lines (149 loc) · 4.19 KB
/
swagger.yaml
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
swagger: '2.0'
info:
title: WebFetch API
description: Asynchronously fetch HTTP entities
version: "0.0.1"
schemes:
- http
produces:
- application/json
paths:
/:
get:
summary: Status
description: |
Identifies WebFetch server.
responses:
200:
description: An object with an application identifier
schema:
type: object
properties:
application:
type: string
description: WebFetch
/gather:
post:
summary: Initiate fetching one or more HTTP entities.
description: |
Receives an array of HTTP entities as objects and returns an array of objects providing a unique identifier, a hash, and the original request parameters. The unique identifier can be used to retrieve the entity when it has completed downloading.
parameters:
- name: requests
in: body
description: HTTP entities to be gathered.
required: true
schema:
type: array
items:
$ref: '#/definitions/Request'
responses:
200:
description: An array of objects providing job IDs and original parameters.
schema:
$ref: '#/definitions/GatherResponse'
/retrieve/{id}:
get:
summary: Retrieve a gathered HTTP entity (blocking).
description: |
Receives a unique identifier and returns the previously requested HTTP entity. This action will block until the entity has been successfully downloaded.
parameters:
- name: id
in: path
type: string
description: Unique identifier for HTTP entity.
required: true
responses:
200:
description: An object containing HTTP entity elements.
schema:
type: object
items:
$ref: '#/definitions/Retrieved'
/find/{id}:
get:
summary: Retrieve a gathered HTTP entity (non-blocking).
description: |
Receives a unique identifier and returns the previously requested HTTP entity. This action will return immediately and provide a pending status if the entity has not finished downloading.
parameters:
- name: id
in: path
type: string
description: Unique identifier for HTTP entity.
required: true
responses:
200:
description: An object containing HTTP entity elements.
schema:
type: object
items:
$ref: '#/definitions/Found'
definitions:
Request:
type: object
properties:
url:
type: string
description: URL of desired HTTP entity.
method:
type: string
default: GET
description: HTTP method.
headers:
type: object
description: HTTP headers.
query:
type: object
description: Query parameters.
body:
type: string
description: HTTP body.
Retrieved:
type: object
properties:
response:
type: object
description: Requested HTTP entity elements.
properties:
success:
type: boolean
body:
type: string
headers:
type: object
status:
type: integer
response_time:
type: float
Found:
type: object
properties:
response:
type: object
description: Requested HTTP entity elements.
properties:
success:
type: boolean
body:
type: string
headers:
type: object
status:
type: integer
pending:
type: boolean
response_time:
type: float
GatherResponse:
type: array
items:
type: object
properties:
uid:
type: string
description: Unique identifier for requested HTTP entity.
hash:
type: string
description: SHA1 hash of request based on url, query parameters, headers, method [currently this serves no purpose].
request:
type: object
description: Original requested HTTP parameters.