This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
swagger.yml
181 lines (177 loc) · 5.26 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
178
179
180
swagger: "2.0"
info:
description: |
Here is a API to handle Redmine's site wide banner.
Now prototype version.
version: "1.0.0-α"
title: "GlobalBanner API"
termsOfService: "http://swagger.io/terms/"
contact:
email: "[email protected]"
schemes:
- "http"
- "https"
host: "localhost:3000"
paths:
/banners/api/global_banner.json:
get:
summary: "Show Global Banner setting"
description: |
Show Global Banner setting as JSON format stored in a settings table.
Only Redmine Administrator or user assigned to group named **"GlobalBanner_Admin"** can use this api.
The way to authenticate follows Redmine itself.
- Exp. User parameter ?key=YOUR_API_KEY or HTTP Header: X-Redmine-API-Key and so on.
- Please see: http://www.redmine.org/projects/redmine/wiki/Rest_api#Authentication
parameters:
- name: "X-Redmine-API-Key"
in: "header"
description: "Your API KEY"
required: true
type: "string"
responses:
200:
description: "Response in success"
schema:
$ref: '#/definitions/global_banner_body'
401:
description: "Response in Unauthorized."
schema:
type: "object"
properties:
status:
type: "string"
example: "401"
message:
type: "string"
example: "Unauthorized"
put:
summary: "Update Global Banner setting"
description: |
Update Global Banner setting as JSON format stored in a settings table.
Only Redmine Administrator or user assigned to group named **"GlobalBanner_Admin"** can use this api.
The way to authenticate follows Redmine itself.
- Exp. User parameter ?key=YOUR_API_KEY or HTTP Header: X-Redmine-API-Key and so on.
- Please see: http://www.redmine.org/projects/redmine/wiki/Rest_api#Authentication
consumes:
- application/json
parameters:
- name: "X-Redmine-API-Key"
in: "header"
description: "Your API KEY"
required: true
type: "string"
- in: body
name: global_banner
description: Data to update Global Banner.
required: true
schema:
$ref: '#/definitions/global_banner_body'
responses:
200:
description: "Response in success."
schema:
type: "object"
properties:
status:
type: "string"
example: "OK"
message:
type: "string"
example: "updatig the global banner"
401:
description: "Response in Unauthorized."
schema:
type: "object"
properties:
status:
type: "string"
example: "401"
message:
type: "string"
example: "Unauthorized"
500:
description: "Response in internal error."
schema:
type: "object"
properties:
status:
type: "string"
example: "500"
message:
type: "string"
example: "Internal Server Error"
definitions:
global_banner_body:
type: "object"
properties:
global_banner:
$ref: "#/definitions/Globel_banner" # Storeを呼び出す
Globel_banner:
type: "object"
required:
- banner_description
- display_part
- type
properties:
banner_description:
type: string
example: "Message for Global Banner"
display_for:
type: "string"
example: "all"
enum: [all, anonymous, authenticated]
description: >
Display for:
* `all` - For all users
* `anonymous` - For anonymous users
* `authenticated` - For authenticated users
display_part:
type: "string"
example: "both"
enum: [header, footer, both]
description: >
Display part:
* `header` - Display banner on the top
* `footer` - Display banner on the bottom
* `both` - Display banner both header and footer
enable:
type: "string"
example: "true"
enum: [true, false]
end_hour:
type: integer
example: 16
maximum: 23
end_min:
type: integer
example: 31
maximum: 59
end_ymd:
type: "string"
example: "2019-08-21"
related_link:
type: "string"
example: "http://localhost:3000/news"
start_hour:
type: integer
example: 16
maximum: 23
start_min:
type: integer
example: 31
maximum: 59
start_ymd:
type: "string"
example: "2019-08-20"
type:
type: "string"
example: "info"
enum: [info, warn, alert, normal, nodata]
description: >
type:
* `info` - Info style. (Pale blue)
* `warn` - Warning style. (Yellow)
* `alert` - Alert style. (Pale red)
* `normal` - White and without status icon.
use_timer:
type: "string"