Advertisement
Guest User

Untitled

a guest
Aug 18th, 2016
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.67 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3. title: ndslabs
  4. version: 1.0.1-alpha
  5. basePath: /v1
  6. schemes:
  7. - https
  8. produces:
  9. - application/json
  10. consumes:
  11. - application/json
  12. parameters:
  13. service-id:
  14. name: service-id
  15. in: path
  16. description: The unique service identifier
  17. type: string
  18. required: true
  19. account-id:
  20. name: account-id
  21. in: path
  22. description: The unique account identifier
  23. type: string
  24. required: true
  25. stack-id:
  26. name: stack-id
  27. in: path
  28. description: The unique stack identifier
  29. type: string
  30. required: true
  31. stack-service-id:
  32. name: stack-service-id
  33. in: path
  34. description: The unique stack service identifier
  35. type: string
  36. required: true
  37. vocab-name:
  38. name: vocab-name
  39. in: path
  40. description: Vocabulary name
  41. type: string
  42. required: true
  43. paths:
  44. /authenticate:
  45. post:
  46. description: |
  47. Authenticate a user (login)
  48. parameters:
  49. - name: auth
  50. in: body
  51. description: Auth definition
  52. schema:
  53. $ref: '#/definitions/Auth'
  54. required: true
  55. responses:
  56. '200':
  57. description: OK
  58. schema:
  59. type: object
  60. properties:
  61. data:
  62. $ref: '#/definitions/Token'
  63. '401':
  64. description: Not logged in
  65. delete:
  66. description: |
  67. Logout a user
  68. responses:
  69. '200':
  70. description: OK
  71. schema:
  72. type: object
  73. properties:
  74. data:
  75. $ref: '#/definitions/Token'
  76. /refresh_token:
  77. get:
  78. description: |
  79. Refresh the JWT token
  80. responses:
  81. '200':
  82. description: OK
  83. schema:
  84. type: object
  85. properties:
  86. data:
  87. $ref: '#/definitions/Token'
  88. '401':
  89. description: Not logged in
  90. /check_token:
  91. get:
  92. description: |
  93. Validate the JWT token
  94. responses:
  95. '200':
  96. description: OK
  97. '401':
  98. description: Not logged in
  99. /services:
  100. get:
  101. description: |
  102. Retrieves a site-wide list of available service definitions.
  103. parameters:
  104. - name: catalog
  105. in: query
  106. description: 'Filter list for catalog (user, system, all)'
  107. required: false
  108. type: string
  109. responses:
  110. '200':
  111. description: OK
  112. schema:
  113. type: object
  114. properties:
  115. data:
  116. type: array
  117. items:
  118. $ref: '#/definitions/Service'
  119. post:
  120. description: |
  121. Adds a new service to the service library
  122. parameters:
  123. - name: service
  124. in: body
  125. description: Service definition
  126. schema:
  127. $ref: '#/definitions/Service'
  128. required: true
  129. responses:
  130. '201':
  131. description: Created
  132. '/services/{service-id}':
  133. parameters:
  134. - $ref: '#/parameters/service-id'
  135. get:
  136. description: |
  137. Retrieves the service definition.
  138. responses:
  139. '200':
  140. description: The service object
  141. schema:
  142. type: object
  143. properties:
  144. data:
  145. $ref: '#/definitions/Service'
  146. put:
  147. description: |
  148. Updates a service definition in the service library
  149. parameters:
  150. - name: service
  151. in: body
  152. description: Service definition
  153. schema:
  154. $ref: '#/definitions/Service'
  155. required: true
  156. responses:
  157. '201':
  158. description: Updated
  159. delete:
  160. description: |
  161. Delete a service
  162. responses:
  163. '200':
  164. description: OK
  165. /accounts:
  166. get:
  167. description: |
  168. Retrieves a site-wide list of NDSLabs accounts.
  169. responses:
  170. '200':
  171. description: OK
  172. schema:
  173. type: object
  174. properties:
  175. data:
  176. type: array
  177. items:
  178. $ref: '#/definitions/Account'
  179. '404':
  180. description: Not found
  181. post:
  182. description: |
  183. Adds a new accounts
  184. parameters:
  185. - name: accounts
  186. in: body
  187. description: Account definition
  188. schema:
  189. $ref: '#/definitions/Account'
  190. required: true
  191. responses:
  192. '201':
  193. description: Created
  194. '/accounts/{account-id}':
  195. parameters:
  196. - $ref: '#/parameters/account-id'
  197. get:
  198. description: |
  199. Retrieves basic information about a account.
  200. responses:
  201. '200':
  202. description: OK
  203. schema:
  204. type: object
  205. properties:
  206. data:
  207. $ref: '#/definitions/Account'
  208. put:
  209. description: |
  210. Updates account information
  211. parameters:
  212. - name: account
  213. in: body
  214. description: Account definition
  215. schema:
  216. $ref: '#/definitions/Account'
  217. required: true
  218. responses:
  219. '201':
  220. description: Updated
  221. delete:
  222. description: |
  223. Delete a account
  224. responses:
  225. '200':
  226. description: OK
  227. /stacks:
  228. get:
  229. description: |
  230. Retrieves a list of stacks for this account.
  231. responses:
  232. '200':
  233. description: OK
  234. schema:
  235. type: object
  236. properties:
  237. data:
  238. type: array
  239. items:
  240. $ref: '#/definitions/Stack'
  241. '404':
  242. description: Not found
  243. post:
  244. description: |
  245. Adds a new stack to this account
  246. parameters:
  247. - name: stack
  248. in: body
  249. description: Stack definition
  250. schema:
  251. $ref: '#/definitions/Stack'
  252. required: true
  253. responses:
  254. '201':
  255. description: Created
  256. '/stacks/{stack-id}':
  257. parameters:
  258. - $ref: '#/parameters/stack-id'
  259. get:
  260. description: |
  261. Retrieves the stack definition.
  262. responses:
  263. '200':
  264. description: OK
  265. schema:
  266. type: object
  267. properties:
  268. data:
  269. $ref: '#/definitions/Stack'
  270. put:
  271. description: |
  272. Updates stack information
  273. parameters:
  274. - name: stack
  275. in: body
  276. description: Stack definition
  277. schema:
  278. $ref: '#/definitions/Stack'
  279. required: true
  280. responses:
  281. '201':
  282. description: Updated
  283. delete:
  284. description: |
  285. Delete a stack
  286. responses:
  287. '200':
  288. description: OK
  289. '/stacks/{stack-id}/rename':
  290. parameters:
  291. - $ref: '#/parameters/stack-id'
  292. put:
  293. parameters:
  294. - name: name
  295. description: Stack name
  296. schema:
  297. type: string
  298. in: body
  299. required: true
  300. description: |
  301. Rename the stack
  302. responses:
  303. '201':
  304. description: Updated
  305. '/logs/{stack-service-id}':
  306. parameters:
  307. - $ref: '#/parameters/stack-service-id'
  308. get:
  309. description: |
  310. Retrieves the stack service log.
  311. responses:
  312. '200':
  313. description: OK
  314. schema:
  315. type: object
  316. properties:
  317. data:
  318. $ref: '#/definitions/Log'
  319. '/start/{stack-id}':
  320. parameters:
  321. - $ref: '#/parameters/stack-id'
  322. get:
  323. description: |
  324. Starts the specified stack
  325. responses:
  326. '200':
  327. description: OK
  328. '/stop/{stack-id}':
  329. parameters:
  330. - $ref: '#/parameters/stack-id'
  331. get:
  332. description: |
  333. Stops the specified stack
  334. responses:
  335. '200':
  336. description: OK
  337. /configs:
  338. get:
  339. parameters:
  340. - name: services
  341. in: query
  342. description: services to filter by
  343. required: false
  344. type: array
  345. collectionFormat: csv
  346. items:
  347. type: string
  348. description: |
  349. Retrieves a list of service configuration options
  350. responses:
  351. '200':
  352. description: OK
  353. schema:
  354. type: object
  355. properties:
  356. data:
  357. type: array
  358. items:
  359. $ref: '#/definitions/Config'
  360. /version:
  361. get:
  362. description: |
  363. Retrieve the server version
  364. responses:
  365. '200':
  366. description: OK
  367. schema:
  368. type: object
  369. properties:
  370. data:
  371. type: string
  372. /register:
  373. post:
  374. description: |
  375. Register
  376. parameters:
  377. - name: account
  378. in: body
  379. description: Account definition
  380. schema:
  381. $ref: '#/definitions/Account'
  382. required: true
  383. responses:
  384. '201':
  385. description: Created
  386. '/vocabulary/{vocab-name}':
  387. get:
  388. parameters:
  389. - $ref: '#/parameters/vocab-name'
  390. description: |
  391. Retrieves a vocabulary
  392. responses:
  393. '200':
  394. description: OK
  395. schema:
  396. type: object
  397. properties:
  398. data:
  399. type: array
  400. items:
  401. $ref: '#/definitions/Vocabulary'
  402. '/change_password':
  403. put:
  404. parameters:
  405. - name: password
  406. description: Change password object
  407. schema:
  408. type: string
  409. in: body
  410. required: true
  411. description: |
  412. Change the user's password
  413. responses:
  414. '201':
  415. description: Updated
  416. '/register/verify':
  417. put:
  418. parameters:
  419. - name: verify
  420. description: Verification object
  421. schema:
  422. type: object
  423. properties:
  424. u:
  425. type: string
  426. t:
  427. type: string
  428. in: body
  429. required: true
  430. description: |
  431. Verify registered email address
  432. responses:
  433. '200':
  434. description: Verified
  435. '/reset/{account-id}':
  436. parameters:
  437. - $ref: '#/parameters/account-id'
  438. post:
  439. description: |
  440. Request password reset email.
  441. responses:
  442. '200':
  443. description: OK
  444. definitions:
  445. Auth:
  446. type: object
  447. properties:
  448. username:
  449. type: string
  450. password:
  451. type: string
  452. Token:
  453. type: object
  454. properties:
  455. token:
  456. type: string
  457. VolumeMount:
  458. type: object
  459. properties:
  460. mountPath:
  461. type: string
  462. name:
  463. type: string
  464. Service:
  465. type: object
  466. properties:
  467. id:
  468. type: string
  469. key:
  470. type: string
  471. label:
  472. type: string
  473. description:
  474. type: string
  475. maintainer:
  476. type: string
  477. logo:
  478. type: string
  479. display:
  480. type: string
  481. access:
  482. type: string
  483. developerEnvironment:
  484. type: string
  485. config:
  486. $ref: '#/definitions/Config'
  487. readinessProbe:
  488. $ref: '#/definitions/ReadyProbe'
  489. image:
  490. $ref: '#/definitions/ServiceImage'
  491. resourceLimits:
  492. $ref: '#/definitions/ResourceLimits'
  493. depends:
  494. type: array
  495. items:
  496. $ref: '#/definitions/ServiceDependency'
  497. ports:
  498. type: array
  499. items:
  500. $ref: '#/definitions/Port'
  501. volumeMounts:
  502. type: array
  503. items:
  504. $ref: '#/definitions/VolumeMount'
  505. repositories:
  506. type: array
  507. items:
  508. $ref: '#/definitions/Repository'
  509. command:
  510. type: array
  511. items:
  512. type: string
  513. args:
  514. type: array
  515. items:
  516. type: string
  517. tags:
  518. type: array
  519. items:
  520. type: string
  521. createdTime:
  522. type: integer
  523. updatedTime:
  524. type: integer
  525. ReadyProbe:
  526. type: object
  527. properties:
  528. path:
  529. type: string
  530. port:
  531. type: integer
  532. initialDelay:
  533. type: integer
  534. timeout:
  535. type: integer
  536. Port:
  537. type: object
  538. properties:
  539. port:
  540. type: integer
  541. protocol:
  542. type: string
  543. Repository:
  544. type: object
  545. properties:
  546. port:
  547. type: string
  548. url:
  549. type: string
  550. ServiceDependency:
  551. type: object
  552. properties:
  553. serviceId:
  554. type: string
  555. required:
  556. type: boolean
  557. Account:
  558. type: object
  559. properties:
  560. id:
  561. type: string
  562. name:
  563. type: string
  564. description:
  565. type: string
  566. namespace:
  567. type: string
  568. storageQuota:
  569. type: string
  570. resourceLimits:
  571. type: object
  572. properties:
  573. cpuMax:
  574. type: string
  575. cpuDefault:
  576. type: string
  577. memMax:
  578. type: string
  579. memDefault:
  580. type: string
  581. storageQuota:
  582. type: string
  583. resourceUsage:
  584. type: object
  585. properties:
  586. cpu:
  587. type: string
  588. memory:
  589. type: string
  590. storage:
  591. type: string
  592. Stack:
  593. type: object
  594. properties:
  595. id:
  596. type: string
  597. key:
  598. type: string
  599. name:
  600. type: string
  601. services:
  602. type: array
  603. items:
  604. $ref: '#/definitions/StackService'
  605. status:
  606. type: string
  607. action:
  608. type: string
  609. createTime:
  610. type: integer
  611. updateTime:
  612. type: integer
  613. StackService:
  614. type: object
  615. properties:
  616. id:
  617. type: string
  618. stackId:
  619. type: string
  620. serviceId:
  621. type: string
  622. status:
  623. type: string
  624. imageTag:
  625. type: string
  626. statusMessage:
  627. type: array
  628. items:
  629. type: string
  630. endpoints:
  631. type: array
  632. items:
  633. type: object
  634. properties:
  635. internalIP:
  636. type: string
  637. host:
  638. type: string
  639. ports:
  640. type: array
  641. items:
  642. type: object
  643. properties:
  644. port:
  645. type: integer
  646. nodePort:
  647. type: integer
  648. protocol:
  649. type: string
  650. Log:
  651. type: object
  652. properties:
  653. text:
  654. type: string
  655. Config:
  656. type: object
  657. properties:
  658. name:
  659. type: string
  660. value:
  661. type: string
  662. label:
  663. type: string
  664. canOverride:
  665. type: boolean
  666. isPassword:
  667. type: boolean
  668. ServiceImage:
  669. type: object
  670. properties:
  671. name:
  672. type: string
  673. tags:
  674. type: array
  675. items:
  676. type: string
  677. ResourceLimits:
  678. type: object
  679. properties:
  680. cpuMax:
  681. type: string
  682. cpuDefault:
  683. type: string
  684. memMax:
  685. type: string
  686. memDefault:
  687. type: string
  688. Vocabulary:
  689. type: object
  690. properties:
  691. name:
  692. type: string
  693. terms:
  694. type: array
  695. items:
  696. type: object
  697. properties:
  698. id:
  699. type: string
  700. name:
  701. type: string
  702. definition:
  703. type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement