Guest User

Untitled

a guest
Jul 28th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.13 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
  4. version: "1.0.0"
  5. title: "Swagger Petstore"
  6. termsOfService: "http://swagger.io/terms/"
  7. contact:
  8. email: "apiteam@swagger.io"
  9. license:
  10. name: "Apache 2.0"
  11. url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  12. host: "petstore.swagger.io"
  13. basePath: "/v1"
  14. tags:
  15. - name: "Notifications"
  16. description: "Everything about the notifications"
  17. - name: "Rules"
  18. description: "Everything about the rules"
  19. schemes:
  20. - "https"
  21. - "http"
  22. paths:
  23. /v1/notifications/getNotificationsCount:
  24. get:
  25. tags:
  26. - "Notifications"
  27. summary: "Get current number of notifications"
  28. description: "Uses the channel and time range to fetch all from notifications table joined to channelLookUp, to create a json object for each channel {channel, sum} where sum = notifications channel"
  29. operationId: "getNotificationsCount"
  30. consumes:
  31. - "application/json"
  32. - "application/xml"
  33. produces:
  34. - "application/json"
  35. - "application/xml"
  36. parameters:
  37. - in: "body"
  38. name: "RangeAndChannel"
  39. description: ""
  40. schema:
  41. type: "string"
  42. properties:
  43. channel:
  44. type: "string"
  45. from_date:
  46. type: "string"
  47. format: "date-time"
  48. to_date:
  49. type: "string"
  50. format: "date-time"
  51. responses:
  52. 200:
  53. description: "Success"
  54. schema:
  55. type: "array"
  56. items:
  57. type: "object"
  58. properties:
  59. channel_id:
  60. type: "integer"
  61. channel:
  62. type: "string"
  63. sum:
  64. type: "string"
  65.  
  66. /v1/RulesController/addRule:
  67. post:
  68. tags:
  69. - "Rules"
  70. summary: "Add new rule"
  71. description: "this request takes the rule json and creates a new rule"
  72. operationId: "addRule"
  73. consumes:
  74. - "application/json"
  75. - "application/xml"
  76. produces:
  77. - "application/json"
  78. - "application/xml"
  79. parameters:
  80. - in: "body"
  81. name: "rule"
  82. description: ""
  83. schema:
  84. type: "object"
  85. properties:
  86. rank:
  87. type: "string"
  88. title:
  89. type: "string"
  90. conditions:
  91. type: "array"
  92. items:
  93. type: "object"
  94. properties:
  95. model:
  96. type: "string"
  97. attribute:
  98. type: "string"
  99. value:
  100. type: "string"
  101. operator:
  102. type: "string"
  103. responses:
  104. 201:
  105. description: "Success"
  106. 400:
  107. description: "Failure"
  108.  
  109.  
  110. /v1/RulesController/deleteRule:
  111. post:
  112. tags:
  113. - "Rules"
  114. summary: "Get current number of notifications"
  115. description: "Uses the channel and time range to Fetch all from notifications table joined to channelLookUp, to create a json object for each channel {channel, sum} where sum = notifications channel"
  116. operationId: "deleteRule"
  117. consumes:
  118. - "application/json"
  119. - "application/xml"
  120. produces:
  121. - "application/json"
  122. - "application/xml"
  123. parameters:
  124. - in: "body"
  125. name: "Rule_id"
  126. description: ""
  127. schema:
  128. type: "object"
  129. properties:
  130. id:
  131. type: "integer"
  132. responses:
  133. 200:
  134. description: "Success"
  135. 400:
  136. description: "Failed to delete"
  137.  
  138.  
  139. /v1/notifications/editRuleTitle:
  140. post:
  141. tags:
  142. - "Rules"
  143. summary: "Edit an already existing rule"
  144. description: ""
  145. operationId: "editRuleTitle"
  146. consumes:
  147. - "application/json"
  148. - "application/xml"
  149. produces:
  150. - "application/json"
  151. - "application/xml"
  152. parameters:
  153. - in: "body"
  154. name: "edit_rule"
  155. description: ""
  156. schema:
  157. type: "string"
  158. properties:
  159. id:
  160. type: "string"
  161. title:
  162. type: "string"
  163. actions:
  164. type: "string"
  165. responses:
  166. 200:
  167. description: "Success"
  168. 400:
  169. description: "Failed"
  170.  
  171.  
  172. /v1/notifications/deleteCondition:
  173. post:
  174. tags:
  175. - "Rules"
  176. summary: "Delete condition using condition id"
  177. description: ""
  178. operationId: "deleteCondition"
  179. consumes:
  180. - "application/json"
  181. - "application/xml"
  182. produces:
  183. - "application/json"
  184. - "application/xml"
  185. parameters:
  186. - in: "body"
  187. name: "condition_id"
  188. description: ""
  189. schema:
  190. type: "string"
  191. properties:
  192. id:
  193. type: "string"
  194. responses:
  195. 200:
  196. description: "Success"
  197. 400:
  198. description: "Failed"
  199.  
  200.  
  201. securityDefinitions:
  202. petstore_auth:
  203. type: "oauth2"
  204. authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  205. flow: "implicit"
  206. scopes:
  207. write:pets: "modify pets in your account"
  208. read:pets: "read your pets"
  209. api_key:
  210. type: "apiKey"
  211. name: "api_key"
  212. in: "header"
  213. definitions:
  214. Order:
  215. type: "object"
  216. properties:
  217. id:
  218. type: "integer"
  219. format: "int64"
  220. petId:
  221. type: "integer"
  222. format: "int64"
  223. quantity:
  224. type: "integer"
  225. format: "int32"
  226. shipDate:
  227. type: "string"
  228. format: "date-time"
  229. status:
  230. type: "string"
  231. description: "Order Status"
  232. enum:
  233. - "placed"
  234. - "approved"
  235. - "delivered"
  236. complete:
  237. type: "boolean"
  238. default: false
  239. xml:
  240. name: "Order"
  241. Category:
  242. type: "object"
  243. properties:
  244. id:
  245. type: "integer"
  246. format: "int64"
  247. name:
  248. type: "string"
  249. xml:
  250. name: "Category"
  251. User:
  252. type: "object"
  253. properties:
  254. id:
  255. type: "integer"
  256. format: "int64"
  257. username:
  258. type: "string"
  259. firstName:
  260. type: "string"
  261. lastName:
  262. type: "string"
  263. email:
  264. type: "string"
  265. password:
  266. type: "string"
  267. phone:
  268. type: "string"
  269. userStatus:
  270. type: "integer"
  271. format: "int32"
  272. description: "User Status"
  273. xml:
  274. name: "User"
  275. Tag:
  276. type: "object"
  277. properties:
  278. id:
  279. type: "integer"
  280. format: "int64"
  281. name:
  282. type: "string"
  283. xml:
  284. name: "Tag"
  285. Pet:
  286. type: "object"
  287. required:
  288. - "name"
  289. - "photoUrls"
  290. properties:
  291. id:
  292. type: "integer"
  293. format: "int64"
  294. category:
  295. $ref: "#/definitions/Category"
  296. name:
  297. type: "string"
  298. example: "doggie"
  299. photoUrls:
  300. type: "array"
  301. xml:
  302. name: "photoUrl"
  303. wrapped: true
  304. items:
  305. type: "string"
  306. tags:
  307. type: "array"
  308. xml:
  309. name: "tag"
  310. wrapped: true
  311. items:
  312. $ref: "#/definitions/Tag"
  313. status:
  314. type: "string"
  315. description: "pet status in the store"
  316. enum:
  317. - "available"
  318. - "pending"
  319. - "sold"
  320. xml:
  321. name: "Pet"
  322. ApiResponse:
  323. type: "object"
  324. properties:
  325. code:
  326. type: "integer"
  327. format: "int32"
  328. type:
  329. type: "string"
  330. message:
  331. type: "string"
  332. externalDocs:
  333. description: "Find out more about Swagger"
  334. url: "http://swagger.io"
Add Comment
Please, Sign In to add comment