-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
155 lines (147 loc) · 4.34 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:
description: |
This is the documentation for Cloudy Time Machine's public-facing, REST API.
The permanent location for this file is within the [api](https://github.com/piggybacktrips/piggyback-api) Github repository.
version: "1.0.0"
title: Cloudy Time Machine REST API
contact:
name: Ross Kukulinski
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
host: cloudytimemachine.com
#host: localhost:9000
basePath: /api
schemes:
- http
paths:
/snapshots:
post:
tags:
- snapshot
summary: Request a new snapshot
description: Requests a new snapshot to be captured that will be queued for processing. Response includes the unique snapshot ID that can be used for getting complete details for it later
operationId: requestSnapshot
produces:
- application/json
parameters:
- in: body
name: body
description: Snapshot Request
required: true
schema:
$ref: "#/definitions/SnapshotRequest"
responses:
"400":
description: BadRequestError
schema:
$ref: "#/definitions/ErrorMessage"
"429":
description: RateLimitedError
schema:
$ref: "#/definitions/ErrorMessage"
"201":
description: successful operation
schema:
$ref: "#/definitions/Snapshot"
get:
tags:
- snapshot
summary: Get all snapshots
description: Returns an array of completed snapshots based on the requested parameters. Users may not specify both `host` AND `url`. `startTime` defaults to the beginning of recorded time and `endTime` defaults to the current time.
operationId: getsnapshots
produces:
- application/json
parameters:
- in: query
name: count
description: Number of snapshots to return
required: false
default: 5
type: number
- in: query
name: host
description: Limit snapshots to this host
required: false
type: string
- in: query
name: url
description: Complete URL to request snapshots for
required: false
type: string
- in: query
name: startTime
description: Beginning of window to return snapshots from
required: false
type: number
- in: query
name: endTime
description: End of window to return snapshots from
required: false
type: number
responses:
"404":
description: NotFoundError
schema:
$ref: "#/definitions/ErrorMessage"
"200":
description: successful operation
schema:
type: array
items:
$ref: "#/definitions/Snapshot"
definitions:
ErrorMessage:
type: object
properties:
message:
type: string
description: Human readable error message
code:
type: string
description: Error code name
Snapshot:
type: object
properties:
id:
type: string
description: UUID of the Snapshot
status:
type: string
enum: ['PENDING', 'IN_PROGRESS', 'FAILED', 'SUCCESSFUL']
description: Current status of this snapshot
requestedAt:
type: integer
format: int32
description: Timestamp when this Snapshot was was requested
createdAt:
type: integer
format: int32
description: Timestamp when the snapshot was completed
host:
type: string
description: The host of the reuqested URL
path:
type: string
description: URL Path that was requested
requestedUrl:
type: string
format: url
description: The complete url that was requested
originalImage:
type: string
format: url
description: The URL to the full size screenshot of the page
thumbnailImage:
type: string
format: url
description: The URL to the thumbnail sized screenshot of the page
SnapshotRequest:
type: object
properties:
requestedUrl:
type: string
format: url
description: The complete url that should be snapshotted