udeServer-api.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "",
  5. "version": ""
  6. },
  7. "host": "127.0.0.1:9993",
  8. "schemes": [
  9. "http"
  10. ],
  11. "consumes": [
  12. "application/json"
  13. ],
  14. "produces": [
  15. "application/json"
  16. ],
  17. "paths": {
  18. "/api/v1/db/ping": {
  19. "get": {
  20. "operationId": "DbPingHandler",
  21. "responses": {
  22. "200": {
  23. "description": "A successful response.",
  24. "schema": {
  25. "$ref": "#/definitions/DbPingResponse"
  26. }
  27. }
  28. },
  29. "tags": [
  30. "udeServer-api"
  31. ]
  32. }
  33. },
  34. "/api/v1/directories": {
  35. "get": {
  36. "operationId": "ListDirectoriesHandler",
  37. "responses": {
  38. "200": {
  39. "description": "A successful response.",
  40. "schema": {
  41. "$ref": "#/definitions/DirectoryListResp"
  42. }
  43. }
  44. },
  45. "parameters": [
  46. {
  47. "name": "page",
  48. "in": "query",
  49. "required": false,
  50. "type": "integer",
  51. "format": "int64"
  52. },
  53. {
  54. "name": "pageSize",
  55. "in": "query",
  56. "required": false,
  57. "type": "integer",
  58. "format": "int64"
  59. }
  60. ],
  61. "tags": [
  62. "udeServer-api"
  63. ],
  64. "consumes": [
  65. "multipart/form-data"
  66. ]
  67. },
  68. "post": {
  69. "operationId": "CreateDirectoryHandler",
  70. "responses": {
  71. "200": {
  72. "description": "A successful response.",
  73. "schema": {
  74. "$ref": "#/definitions/DirectoryResp"
  75. }
  76. }
  77. },
  78. "parameters": [
  79. {
  80. "name": "body",
  81. "in": "body",
  82. "required": true,
  83. "schema": {
  84. "$ref": "#/definitions/CreateDirectoryReq"
  85. }
  86. }
  87. ],
  88. "tags": [
  89. "udeServer-api"
  90. ]
  91. }
  92. },
  93. "/api/v1/directories/{id}": {
  94. "get": {
  95. "operationId": "GetDirectoryHandler",
  96. "responses": {
  97. "200": {
  98. "description": "A successful response.",
  99. "schema": {
  100. "$ref": "#/definitions/DirectoryResp"
  101. }
  102. }
  103. },
  104. "parameters": [
  105. {
  106. "name": "id",
  107. "in": "path",
  108. "required": true,
  109. "type": "string"
  110. }
  111. ],
  112. "tags": [
  113. "udeServer-api"
  114. ]
  115. },
  116. "delete": {
  117. "operationId": "DeleteDirectoryHandler",
  118. "responses": {
  119. "200": {
  120. "description": "A successful response.",
  121. "schema": {
  122. "$ref": "#/definitions/DeleteResp"
  123. }
  124. }
  125. },
  126. "parameters": [
  127. {
  128. "name": "id",
  129. "in": "path",
  130. "required": true,
  131. "type": "string"
  132. },
  133. {
  134. "name": "body",
  135. "in": "body",
  136. "required": true,
  137. "schema": {
  138. "$ref": "#/definitions/DirectoryIdReq"
  139. }
  140. }
  141. ],
  142. "tags": [
  143. "udeServer-api"
  144. ]
  145. },
  146. "put": {
  147. "operationId": "UpdateDirectoryHandler",
  148. "responses": {
  149. "200": {
  150. "description": "A successful response.",
  151. "schema": {
  152. "$ref": "#/definitions/DirectoryResp"
  153. }
  154. }
  155. },
  156. "parameters": [
  157. {
  158. "name": "id",
  159. "in": "path",
  160. "required": true,
  161. "type": "string"
  162. },
  163. {
  164. "name": "body",
  165. "in": "body",
  166. "required": true,
  167. "schema": {
  168. "$ref": "#/definitions/UpdateDirectoryReq"
  169. }
  170. }
  171. ],
  172. "tags": [
  173. "udeServer-api"
  174. ]
  175. }
  176. },
  177. "/api/v1/from/{name}": {
  178. "get": {
  179. "operationId": "UdeServerHandler",
  180. "responses": {
  181. "200": {
  182. "description": "A successful response.",
  183. "schema": {
  184. "$ref": "#/definitions/Response"
  185. }
  186. }
  187. },
  188. "parameters": [
  189. {
  190. "name": "name",
  191. "in": "path",
  192. "required": true,
  193. "type": "string"
  194. }
  195. ],
  196. "tags": [
  197. "udeServer-api"
  198. ]
  199. }
  200. },
  201. "/api/v1/keys/create": {
  202. "post": {
  203. "operationId": "CreateKeyHandler",
  204. "responses": {
  205. "200": {
  206. "description": "A successful response.",
  207. "schema": {
  208. "$ref": "#/definitions/KeyResp"
  209. }
  210. }
  211. },
  212. "parameters": [
  213. {
  214. "name": "body",
  215. "in": "body",
  216. "required": true,
  217. "schema": {
  218. "$ref": "#/definitions/CreateKeyReq"
  219. }
  220. }
  221. ],
  222. "tags": [
  223. "udeServer-api"
  224. ]
  225. }
  226. },
  227. "/api/v1/keys/delete": {
  228. "post": {
  229. "operationId": "DeleteKeyHandler",
  230. "responses": {
  231. "200": {
  232. "description": "A successful response.",
  233. "schema": {
  234. "$ref": "#/definitions/DeleteResp"
  235. }
  236. }
  237. },
  238. "parameters": [
  239. {
  240. "name": "body",
  241. "in": "body",
  242. "required": true,
  243. "schema": {
  244. "$ref": "#/definitions/KeyIdReq"
  245. }
  246. }
  247. ],
  248. "tags": [
  249. "udeServer-api"
  250. ]
  251. }
  252. },
  253. "/api/v1/keys/detail": {
  254. "post": {
  255. "operationId": "GetKeyHandler",
  256. "responses": {
  257. "200": {
  258. "description": "A successful response.",
  259. "schema": {
  260. "$ref": "#/definitions/KeyResp"
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "name": "body",
  267. "in": "body",
  268. "required": true,
  269. "schema": {
  270. "$ref": "#/definitions/KeyIdReq"
  271. }
  272. }
  273. ],
  274. "tags": [
  275. "udeServer-api"
  276. ]
  277. }
  278. },
  279. "/api/v1/keys/list": {
  280. "post": {
  281. "operationId": "ListKeysHandler",
  282. "responses": {
  283. "200": {
  284. "description": "A successful response.",
  285. "schema": {
  286. "$ref": "#/definitions/KeyListResp"
  287. }
  288. }
  289. },
  290. "parameters": [
  291. {
  292. "name": "body",
  293. "in": "body",
  294. "required": true,
  295. "schema": {
  296. "$ref": "#/definitions/ListKeysReq"
  297. }
  298. }
  299. ],
  300. "tags": [
  301. "udeServer-api"
  302. ]
  303. }
  304. },
  305. "/api/v1/keys/update": {
  306. "post": {
  307. "operationId": "UpdateKeyHandler",
  308. "responses": {
  309. "200": {
  310. "description": "A successful response.",
  311. "schema": {
  312. "$ref": "#/definitions/KeyResp"
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "name": "body",
  319. "in": "body",
  320. "required": true,
  321. "schema": {
  322. "$ref": "#/definitions/UpdateKeyReq"
  323. }
  324. }
  325. ],
  326. "tags": [
  327. "udeServer-api"
  328. ]
  329. }
  330. },
  331. "/api/v1/services": {
  332. "get": {
  333. "operationId": "ListServicesHandler",
  334. "responses": {
  335. "200": {
  336. "description": "A successful response.",
  337. "schema": {
  338. "$ref": "#/definitions/ServiceListResp"
  339. }
  340. }
  341. },
  342. "parameters": [
  343. {
  344. "name": "page",
  345. "in": "query",
  346. "required": false,
  347. "type": "integer",
  348. "format": "int64"
  349. },
  350. {
  351. "name": "pageSize",
  352. "in": "query",
  353. "required": false,
  354. "type": "integer",
  355. "format": "int64"
  356. }
  357. ],
  358. "tags": [
  359. "udeServer-api"
  360. ],
  361. "consumes": [
  362. "multipart/form-data"
  363. ]
  364. },
  365. "post": {
  366. "operationId": "CreateServiceHandler",
  367. "responses": {
  368. "200": {
  369. "description": "A successful response.",
  370. "schema": {
  371. "$ref": "#/definitions/ServiceResp"
  372. }
  373. }
  374. },
  375. "parameters": [
  376. {
  377. "name": "body",
  378. "in": "body",
  379. "required": true,
  380. "schema": {
  381. "$ref": "#/definitions/CreateServiceReq"
  382. }
  383. }
  384. ],
  385. "tags": [
  386. "udeServer-api"
  387. ]
  388. }
  389. },
  390. "/api/v1/services/{id}": {
  391. "get": {
  392. "operationId": "GetServiceHandler",
  393. "responses": {
  394. "200": {
  395. "description": "A successful response.",
  396. "schema": {
  397. "$ref": "#/definitions/ServiceResp"
  398. }
  399. }
  400. },
  401. "parameters": [
  402. {
  403. "name": "id",
  404. "in": "path",
  405. "required": true,
  406. "type": "string"
  407. }
  408. ],
  409. "tags": [
  410. "udeServer-api"
  411. ]
  412. },
  413. "delete": {
  414. "operationId": "DeleteServiceHandler",
  415. "responses": {
  416. "200": {
  417. "description": "A successful response.",
  418. "schema": {
  419. "$ref": "#/definitions/DeleteResp"
  420. }
  421. }
  422. },
  423. "parameters": [
  424. {
  425. "name": "id",
  426. "in": "path",
  427. "required": true,
  428. "type": "string"
  429. },
  430. {
  431. "name": "body",
  432. "in": "body",
  433. "required": true,
  434. "schema": {
  435. "$ref": "#/definitions/ServiceIdReq"
  436. }
  437. }
  438. ],
  439. "tags": [
  440. "udeServer-api"
  441. ]
  442. },
  443. "put": {
  444. "operationId": "UpdateServiceHandler",
  445. "responses": {
  446. "200": {
  447. "description": "A successful response.",
  448. "schema": {
  449. "$ref": "#/definitions/ServiceResp"
  450. }
  451. }
  452. },
  453. "parameters": [
  454. {
  455. "name": "id",
  456. "in": "path",
  457. "required": true,
  458. "type": "string"
  459. },
  460. {
  461. "name": "body",
  462. "in": "body",
  463. "required": true,
  464. "schema": {
  465. "$ref": "#/definitions/UpdateServiceReq"
  466. }
  467. }
  468. ],
  469. "tags": [
  470. "udeServer-api"
  471. ]
  472. }
  473. }
  474. },
  475. "definitions": {
  476. "CreateDirectoryReq": {
  477. "type": "object",
  478. "properties": {
  479. "id": {
  480. "type": "integer",
  481. "format": "int64"
  482. },
  483. "serviceId": {
  484. "type": "integer",
  485. "format": "int64"
  486. },
  487. "directory": {
  488. "type": "string"
  489. }
  490. },
  491. "title": "CreateDirectoryReq",
  492. "required": [
  493. "id"
  494. ]
  495. },
  496. "CreateKeyReq": {
  497. "type": "object",
  498. "properties": {
  499. "name": {
  500. "type": "string"
  501. }
  502. },
  503. "title": "CreateKeyReq",
  504. "required": [
  505. "name"
  506. ]
  507. },
  508. "CreateServiceReq": {
  509. "type": "object",
  510. "properties": {
  511. "id": {
  512. "type": "integer",
  513. "format": "int64"
  514. },
  515. "name": {
  516. "type": "string"
  517. },
  518. "ip": {
  519. "type": "string"
  520. },
  521. "port": {
  522. "type": "string"
  523. },
  524. "iden": {
  525. "type": "string"
  526. },
  527. "keyIden": {
  528. "type": "string"
  529. },
  530. "keyAlgo": {
  531. "type": "string"
  532. },
  533. "status": {
  534. "type": "string"
  535. }
  536. },
  537. "title": "CreateServiceReq",
  538. "required": [
  539. "id"
  540. ]
  541. },
  542. "DbPingResponse": {
  543. "type": "object",
  544. "properties": {
  545. "ok": {
  546. "type": "boolean",
  547. "format": "boolean"
  548. },
  549. "version": {
  550. "type": "string"
  551. },
  552. "database": {
  553. "type": "string"
  554. }
  555. },
  556. "title": "DbPingResponse",
  557. "required": [
  558. "ok",
  559. "version",
  560. "database"
  561. ]
  562. },
  563. "DeleteResp": {
  564. "type": "object",
  565. "properties": {
  566. "ok": {
  567. "type": "boolean",
  568. "format": "boolean"
  569. }
  570. },
  571. "title": "DeleteResp",
  572. "required": [
  573. "ok"
  574. ]
  575. },
  576. "DirectoryIdReq": {
  577. "type": "object",
  578. "title": "DirectoryIdReq"
  579. },
  580. "DirectoryListResp": {
  581. "type": "object",
  582. "properties": {
  583. "list": {
  584. "type": "array",
  585. "items": {
  586. "$ref": "#/definitions/DirectoryResp"
  587. }
  588. },
  589. "total": {
  590. "type": "integer",
  591. "format": "int64"
  592. }
  593. },
  594. "title": "DirectoryListResp",
  595. "required": [
  596. "list",
  597. "total"
  598. ]
  599. },
  600. "DirectoryResp": {
  601. "type": "object",
  602. "properties": {
  603. "id": {
  604. "type": "integer",
  605. "format": "int64"
  606. },
  607. "serviceId": {
  608. "type": "integer",
  609. "format": "int64"
  610. },
  611. "directory": {
  612. "type": "string"
  613. }
  614. },
  615. "title": "DirectoryResp",
  616. "required": [
  617. "id",
  618. "serviceId",
  619. "directory"
  620. ]
  621. },
  622. "KeyIdReq": {
  623. "type": "object",
  624. "properties": {
  625. "id": {
  626. "type": "integer",
  627. "format": "int64"
  628. }
  629. },
  630. "title": "KeyIdReq",
  631. "required": [
  632. "id"
  633. ]
  634. },
  635. "KeyListResp": {
  636. "type": "object",
  637. "properties": {
  638. "list": {
  639. "type": "array",
  640. "items": {
  641. "$ref": "#/definitions/KeyResp"
  642. }
  643. },
  644. "total": {
  645. "type": "integer",
  646. "format": "int64"
  647. }
  648. },
  649. "title": "KeyListResp",
  650. "required": [
  651. "list",
  652. "total"
  653. ]
  654. },
  655. "KeyResp": {
  656. "type": "object",
  657. "properties": {
  658. "id": {
  659. "type": "integer",
  660. "format": "int64"
  661. },
  662. "iden": {
  663. "type": "string"
  664. },
  665. "name": {
  666. "type": "string"
  667. },
  668. "content": {
  669. "type": "string"
  670. },
  671. "status": {
  672. "type": "string"
  673. },
  674. "createAt": {
  675. "type": "string"
  676. }
  677. },
  678. "title": "KeyResp",
  679. "required": [
  680. "id",
  681. "iden",
  682. "name",
  683. "content",
  684. "status",
  685. "createAt"
  686. ]
  687. },
  688. "ListDirectoryReq": {
  689. "type": "object",
  690. "properties": {
  691. "page": {
  692. "type": "integer",
  693. "format": "int64"
  694. },
  695. "pageSize": {
  696. "type": "integer",
  697. "format": "int64"
  698. }
  699. },
  700. "title": "ListDirectoryReq"
  701. },
  702. "ListKeysReq": {
  703. "type": "object",
  704. "properties": {
  705. "page": {
  706. "type": "integer",
  707. "format": "int64"
  708. },
  709. "pageSize": {
  710. "type": "integer",
  711. "format": "int64"
  712. },
  713. "name": {
  714. "type": "string"
  715. },
  716. "status": {
  717. "type": "string"
  718. }
  719. },
  720. "title": "ListKeysReq"
  721. },
  722. "ListServiceReq": {
  723. "type": "object",
  724. "properties": {
  725. "page": {
  726. "type": "integer",
  727. "format": "int64"
  728. },
  729. "pageSize": {
  730. "type": "integer",
  731. "format": "int64"
  732. }
  733. },
  734. "title": "ListServiceReq"
  735. },
  736. "Request": {
  737. "type": "object",
  738. "title": "Request"
  739. },
  740. "Response": {
  741. "type": "object",
  742. "properties": {
  743. "message": {
  744. "type": "string"
  745. }
  746. },
  747. "title": "Response",
  748. "required": [
  749. "message"
  750. ]
  751. },
  752. "ServiceIdReq": {
  753. "type": "object",
  754. "title": "ServiceIdReq"
  755. },
  756. "ServiceListResp": {
  757. "type": "object",
  758. "properties": {
  759. "list": {
  760. "type": "array",
  761. "items": {
  762. "$ref": "#/definitions/ServiceResp"
  763. }
  764. },
  765. "total": {
  766. "type": "integer",
  767. "format": "int64"
  768. }
  769. },
  770. "title": "ServiceListResp",
  771. "required": [
  772. "list",
  773. "total"
  774. ]
  775. },
  776. "ServiceResp": {
  777. "type": "object",
  778. "properties": {
  779. "id": {
  780. "type": "integer",
  781. "format": "int64"
  782. },
  783. "name": {
  784. "type": "string"
  785. },
  786. "ip": {
  787. "type": "string"
  788. },
  789. "port": {
  790. "type": "string"
  791. },
  792. "iden": {
  793. "type": "string"
  794. },
  795. "keyIden": {
  796. "type": "string"
  797. },
  798. "keyAlgo": {
  799. "type": "string"
  800. },
  801. "status": {
  802. "type": "string"
  803. },
  804. "createAt": {
  805. "type": "string"
  806. }
  807. },
  808. "title": "ServiceResp",
  809. "required": [
  810. "id",
  811. "name",
  812. "ip",
  813. "port",
  814. "iden",
  815. "keyIden",
  816. "keyAlgo",
  817. "status",
  818. "createAt"
  819. ]
  820. },
  821. "UpdateDirectoryReq": {
  822. "type": "object",
  823. "properties": {
  824. "serviceId": {
  825. "type": "integer",
  826. "format": "int64"
  827. },
  828. "directory": {
  829. "type": "string"
  830. }
  831. },
  832. "title": "UpdateDirectoryReq"
  833. },
  834. "UpdateKeyReq": {
  835. "type": "object",
  836. "properties": {
  837. "id": {
  838. "type": "integer",
  839. "format": "int64"
  840. },
  841. "status": {
  842. "type": "string"
  843. }
  844. },
  845. "title": "UpdateKeyReq",
  846. "required": [
  847. "id",
  848. "status"
  849. ]
  850. },
  851. "UpdateServiceReq": {
  852. "type": "object",
  853. "properties": {
  854. "name": {
  855. "type": "string"
  856. },
  857. "ip": {
  858. "type": "string"
  859. },
  860. "port": {
  861. "type": "string"
  862. },
  863. "iden": {
  864. "type": "string"
  865. },
  866. "keyIden": {
  867. "type": "string"
  868. },
  869. "keyAlgo": {
  870. "type": "string"
  871. },
  872. "status": {
  873. "type": "string"
  874. }
  875. },
  876. "title": "UpdateServiceReq"
  877. }
  878. },
  879. "securityDefinitions": {
  880. "apiKey": {
  881. "type": "apiKey",
  882. "description": "Enter JWT Bearer token **_only_**",
  883. "name": "Authorization",
  884. "in": "header"
  885. }
  886. }
  887. }