api.swagger.json 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "title": "Nginx Proxy Manager API",
  5. "version": "2.x.x"
  6. },
  7. "servers": [
  8. {
  9. "url": "http://127.0.0.1:81/api"
  10. }
  11. ],
  12. "paths": {
  13. "/": {
  14. "get": {
  15. "operationId": "health",
  16. "summary": "Returns the API health status",
  17. "responses": {
  18. "200": {
  19. "description": "200 response",
  20. "content": {
  21. "application/json": {
  22. "examples": {
  23. "default": {
  24. "value": {
  25. "status": "OK",
  26. "version": {
  27. "major": 2,
  28. "minor": 1,
  29. "revision": 0
  30. }
  31. }
  32. }
  33. },
  34. "schema": {
  35. "$ref": "#/components/schemas/HealthObject"
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. },
  43. "/schema": {
  44. "get": {
  45. "operationId": "schema",
  46. "responses": {
  47. "200": {
  48. "description": "200 response"
  49. }
  50. },
  51. "summary": "Returns this swagger API schema"
  52. }
  53. },
  54. "/tokens": {
  55. "get": {
  56. "operationId": "refreshToken",
  57. "summary": "Refresh your access token",
  58. "tags": [
  59. "Tokens"
  60. ],
  61. "security": [
  62. {
  63. "BearerAuth": [
  64. "tokens"
  65. ]
  66. }
  67. ],
  68. "responses": {
  69. "200": {
  70. "description": "200 response",
  71. "content": {
  72. "application/json": {
  73. "examples": {
  74. "default": {
  75. "value": {
  76. "expires": 1566540510,
  77. "token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
  78. }
  79. }
  80. },
  81. "schema": {
  82. "$ref": "#/components/schemas/TokenObject"
  83. }
  84. }
  85. }
  86. }
  87. }
  88. },
  89. "post": {
  90. "operationId": "requestToken",
  91. "parameters": [
  92. {
  93. "description": "Credentials Payload",
  94. "in": "body",
  95. "name": "credentials",
  96. "required": true,
  97. "schema": {
  98. "additionalProperties": false,
  99. "properties": {
  100. "identity": {
  101. "minLength": 1,
  102. "type": "string"
  103. },
  104. "scope": {
  105. "minLength": 1,
  106. "type": "string",
  107. "enum": [
  108. "user"
  109. ]
  110. },
  111. "secret": {
  112. "minLength": 1,
  113. "type": "string"
  114. }
  115. },
  116. "required": [
  117. "identity",
  118. "secret"
  119. ],
  120. "type": "object"
  121. }
  122. }
  123. ],
  124. "responses": {
  125. "200": {
  126. "content": {
  127. "application/json": {
  128. "examples": {
  129. "default": {
  130. "value": {
  131. "result": {
  132. "expires": 1566540510,
  133. "token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
  134. }
  135. }
  136. }
  137. },
  138. "schema": {
  139. "$ref": "#/components/schemas/TokenObject"
  140. }
  141. }
  142. },
  143. "description": "200 response"
  144. }
  145. },
  146. "summary": "Request a new access token from credentials",
  147. "tags": [
  148. "Tokens"
  149. ]
  150. }
  151. },
  152. "/settings": {
  153. "get": {
  154. "operationId": "getSettings",
  155. "summary": "Get all settings",
  156. "tags": [
  157. "Settings"
  158. ],
  159. "security": [
  160. {
  161. "BearerAuth": [
  162. "settings"
  163. ]
  164. }
  165. ],
  166. "responses": {
  167. "200": {
  168. "description": "200 response",
  169. "content": {
  170. "application/json": {
  171. "examples": {
  172. "default": {
  173. "value": [
  174. {
  175. "id": "default-site",
  176. "name": "Default Site",
  177. "description": "What to show when Nginx is hit with an unknown Host",
  178. "value": "congratulations",
  179. "meta": {}
  180. }
  181. ]
  182. }
  183. },
  184. "schema": {
  185. "$ref": "#/components/schemas/SettingsList"
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. },
  193. "/settings/{settingID}": {
  194. "get": {
  195. "operationId": "getSetting",
  196. "summary": "Get a setting",
  197. "tags": [
  198. "Settings"
  199. ],
  200. "security": [
  201. {
  202. "BearerAuth": [
  203. "settings"
  204. ]
  205. }
  206. ],
  207. "parameters": [
  208. {
  209. "in": "path",
  210. "name": "settingID",
  211. "schema": {
  212. "type": "string",
  213. "minLength": 1
  214. },
  215. "required": true,
  216. "description": "Setting ID",
  217. "example": "default-site"
  218. }
  219. ],
  220. "responses": {
  221. "200": {
  222. "description": "200 response",
  223. "content": {
  224. "application/json": {
  225. "examples": {
  226. "default": {
  227. "value": {
  228. "id": "default-site",
  229. "name": "Default Site",
  230. "description": "What to show when Nginx is hit with an unknown Host",
  231. "value": "congratulations",
  232. "meta": {}
  233. }
  234. }
  235. },
  236. "schema": {
  237. "$ref": "#/components/schemas/SettingObject"
  238. }
  239. }
  240. }
  241. }
  242. }
  243. },
  244. "put": {
  245. "operationId": "updateSetting",
  246. "summary": "Update a setting",
  247. "tags": [
  248. "Settings"
  249. ],
  250. "security": [
  251. {
  252. "BearerAuth": [
  253. "settings"
  254. ]
  255. }
  256. ],
  257. "parameters": [
  258. {
  259. "in": "path",
  260. "name": "settingID",
  261. "schema": {
  262. "type": "string",
  263. "minLength": 1
  264. },
  265. "required": true,
  266. "description": "Setting ID",
  267. "example": "default-site"
  268. },
  269. {
  270. "in": "body",
  271. "name": "setting",
  272. "description": "Setting Payload",
  273. "required": true,
  274. "schema": {
  275. "$ref": "#/components/schemas/SettingObject"
  276. }
  277. }
  278. ],
  279. "responses": {
  280. "200": {
  281. "description": "200 response",
  282. "content": {
  283. "application/json": {
  284. "examples": {
  285. "default": {
  286. "value": {
  287. "id": "default-site",
  288. "name": "Default Site",
  289. "description": "What to show when Nginx is hit with an unknown Host",
  290. "value": "congratulations",
  291. "meta": {}
  292. }
  293. }
  294. },
  295. "schema": {
  296. "$ref": "#/components/schemas/SettingObject"
  297. }
  298. }
  299. }
  300. }
  301. }
  302. }
  303. },
  304. "/users": {
  305. "get": {
  306. "operationId": "getUsers",
  307. "summary": "Get all users",
  308. "tags": [
  309. "Users"
  310. ],
  311. "security": [
  312. {
  313. "BearerAuth": [
  314. "users"
  315. ]
  316. }
  317. ],
  318. "parameters": [
  319. {
  320. "in": "query",
  321. "name": "expand",
  322. "description": "Expansions",
  323. "schema": {
  324. "type": "string",
  325. "enum": [
  326. "permissions"
  327. ]
  328. }
  329. }
  330. ],
  331. "responses": {
  332. "200": {
  333. "description": "200 response",
  334. "content": {
  335. "application/json": {
  336. "examples": {
  337. "default": {
  338. "value": [
  339. {
  340. "id": 1,
  341. "created_on": "2020-01-30T09:36:08.000Z",
  342. "modified_on": "2020-01-30T09:41:04.000Z",
  343. "is_disabled": 0,
  344. "email": "[email protected]",
  345. "name": "Jamie Curnow",
  346. "nickname": "James",
  347. "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
  348. "roles": [
  349. "admin"
  350. ]
  351. }
  352. ]
  353. },
  354. "withPermissions": {
  355. "value": [
  356. {
  357. "id": 1,
  358. "created_on": "2020-01-30T09:36:08.000Z",
  359. "modified_on": "2020-01-30T09:41:04.000Z",
  360. "is_disabled": 0,
  361. "email": "[email protected]",
  362. "name": "Jamie Curnow",
  363. "nickname": "James",
  364. "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
  365. "roles": [
  366. "admin"
  367. ],
  368. "permissions": {
  369. "visibility": "all",
  370. "proxy_hosts": "manage",
  371. "redirection_hosts": "manage",
  372. "dead_hosts": "manage",
  373. "streams": "manage",
  374. "access_lists": "manage",
  375. "certificates": "manage"
  376. }
  377. }
  378. ]
  379. }
  380. },
  381. "schema": {
  382. "$ref": "#/components/schemas/UsersList"
  383. }
  384. }
  385. }
  386. }
  387. }
  388. },
  389. "post": {
  390. "operationId": "createUser",
  391. "summary": "Create a User",
  392. "tags": [
  393. "Users"
  394. ],
  395. "security": [
  396. {
  397. "BearerAuth": [
  398. "users"
  399. ]
  400. }
  401. ],
  402. "parameters": [
  403. {
  404. "in": "body",
  405. "name": "user",
  406. "description": "User Payload",
  407. "required": true,
  408. "schema": {
  409. "$ref": "#/components/schemas/UserObject"
  410. }
  411. }
  412. ],
  413. "responses": {
  414. "201": {
  415. "description": "201 response",
  416. "content": {
  417. "application/json": {
  418. "examples": {
  419. "default": {
  420. "value": {
  421. "id": 2,
  422. "created_on": "2020-01-30T09:36:08.000Z",
  423. "modified_on": "2020-01-30T09:41:04.000Z",
  424. "is_disabled": 0,
  425. "email": "[email protected]",
  426. "name": "Jamie Curnow",
  427. "nickname": "James",
  428. "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
  429. "roles": [
  430. "admin"
  431. ],
  432. "permissions": {
  433. "visibility": "all",
  434. "proxy_hosts": "manage",
  435. "redirection_hosts": "manage",
  436. "dead_hosts": "manage",
  437. "streams": "manage",
  438. "access_lists": "manage",
  439. "certificates": "manage"
  440. }
  441. }
  442. }
  443. },
  444. "schema": {
  445. "$ref": "#/components/schemas/UserObject"
  446. }
  447. }
  448. }
  449. }
  450. }
  451. }
  452. },
  453. "/users/{userID}": {
  454. "get": {
  455. "operationId": "getUser",
  456. "summary": "Get a user",
  457. "tags": [
  458. "Users"
  459. ],
  460. "security": [
  461. {
  462. "BearerAuth": [
  463. "users"
  464. ]
  465. }
  466. ],
  467. "parameters": [
  468. {
  469. "in": "path",
  470. "name": "userID",
  471. "schema": {
  472. "oneOf": [
  473. {
  474. "type": "string",
  475. "pattern": "^me$"
  476. },
  477. {
  478. "type": "integer",
  479. "minimum": 1
  480. }
  481. ]
  482. },
  483. "required": true,
  484. "description": "User ID or 'me' for yourself",
  485. "example": 1
  486. }
  487. ],
  488. "responses": {
  489. "200": {
  490. "description": "200 response",
  491. "content": {
  492. "application/json": {
  493. "examples": {
  494. "default": {
  495. "value": {
  496. "id": 1,
  497. "created_on": "2020-01-30T09:36:08.000Z",
  498. "modified_on": "2020-01-30T09:41:04.000Z",
  499. "is_disabled": 0,
  500. "email": "[email protected]",
  501. "name": "Jamie Curnow",
  502. "nickname": "James",
  503. "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
  504. "roles": [
  505. "admin"
  506. ]
  507. }
  508. }
  509. },
  510. "schema": {
  511. "$ref": "#/components/schemas/UserObject"
  512. }
  513. }
  514. }
  515. }
  516. }
  517. },
  518. "put": {
  519. "operationId": "updateUser",
  520. "summary": "Update a User",
  521. "tags": [
  522. "Users"
  523. ],
  524. "security": [
  525. {
  526. "BearerAuth": [
  527. "users"
  528. ]
  529. }
  530. ],
  531. "parameters": [
  532. {
  533. "in": "path",
  534. "name": "userID",
  535. "schema": {
  536. "oneOf": [
  537. {
  538. "type": "string",
  539. "pattern": "^me$"
  540. },
  541. {
  542. "type": "integer",
  543. "minimum": 1
  544. }
  545. ]
  546. },
  547. "required": true,
  548. "description": "User ID or 'me' for yourself",
  549. "example": 2
  550. },
  551. {
  552. "in": "body",
  553. "name": "user",
  554. "description": "User Payload",
  555. "required": true,
  556. "schema": {
  557. "$ref": "#/components/schemas/UserObject"
  558. }
  559. }
  560. ],
  561. "responses": {
  562. "200": {
  563. "description": "200 response",
  564. "content": {
  565. "application/json": {
  566. "examples": {
  567. "default": {
  568. "value": {
  569. "id": 2,
  570. "created_on": "2020-01-30T09:36:08.000Z",
  571. "modified_on": "2020-01-30T09:41:04.000Z",
  572. "is_disabled": 0,
  573. "email": "[email protected]",
  574. "name": "Jamie Curnow",
  575. "nickname": "James",
  576. "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
  577. "roles": [
  578. "admin"
  579. ]
  580. }
  581. }
  582. },
  583. "schema": {
  584. "$ref": "#/components/schemas/UserObject"
  585. }
  586. }
  587. }
  588. }
  589. }
  590. },
  591. "delete": {
  592. "operationId": "deleteUser",
  593. "summary": "Delete a User",
  594. "tags": [
  595. "Users"
  596. ],
  597. "security": [
  598. {
  599. "BearerAuth": [
  600. "users"
  601. ]
  602. }
  603. ],
  604. "parameters": [
  605. {
  606. "in": "path",
  607. "name": "userID",
  608. "schema": {
  609. "type": "integer",
  610. "minimum": 1
  611. },
  612. "required": true,
  613. "description": "User ID",
  614. "example": 2
  615. }
  616. ],
  617. "responses": {
  618. "200": {
  619. "description": "200 response",
  620. "content": {
  621. "application/json": {
  622. "examples": {
  623. "default": {
  624. "value": true
  625. }
  626. },
  627. "schema": {
  628. "type": "boolean"
  629. }
  630. }
  631. }
  632. }
  633. }
  634. }
  635. },
  636. "/users/{userID}/auth": {
  637. "put": {
  638. "operationId": "updateUserAuth",
  639. "summary": "Update a User's Authentication",
  640. "tags": [
  641. "Users"
  642. ],
  643. "security": [
  644. {
  645. "BearerAuth": [
  646. "users"
  647. ]
  648. }
  649. ],
  650. "parameters": [
  651. {
  652. "in": "path",
  653. "name": "userID",
  654. "schema": {
  655. "oneOf": [
  656. {
  657. "type": "string",
  658. "pattern": "^me$"
  659. },
  660. {
  661. "type": "integer",
  662. "minimum": 1
  663. }
  664. ]
  665. },
  666. "required": true,
  667. "description": "User ID or 'me' for yourself",
  668. "example": 2
  669. },
  670. {
  671. "in": "body",
  672. "name": "user",
  673. "description": "User Payload",
  674. "required": true,
  675. "schema": {
  676. "$ref": "#/components/schemas/AuthObject"
  677. }
  678. }
  679. ],
  680. "responses": {
  681. "200": {
  682. "description": "200 response",
  683. "content": {
  684. "application/json": {
  685. "examples": {
  686. "default": {
  687. "value": true
  688. }
  689. },
  690. "schema": {
  691. "type": "boolean"
  692. }
  693. }
  694. }
  695. }
  696. }
  697. }
  698. },
  699. "/users/{userID}/permissions": {
  700. "put": {
  701. "operationId": "updateUserPermissions",
  702. "summary": "Update a User's Permissions",
  703. "tags": [
  704. "Users"
  705. ],
  706. "security": [
  707. {
  708. "BearerAuth": [
  709. "users"
  710. ]
  711. }
  712. ],
  713. "parameters": [
  714. {
  715. "in": "path",
  716. "name": "userID",
  717. "schema": {
  718. "type": "integer",
  719. "minimum": 1
  720. },
  721. "required": true,
  722. "description": "User ID",
  723. "example": 2
  724. },
  725. {
  726. "in": "body",
  727. "name": "user",
  728. "description": "Permissions Payload",
  729. "required": true,
  730. "schema": {
  731. "$ref": "#/components/schemas/PermissionsObject"
  732. }
  733. }
  734. ],
  735. "responses": {
  736. "200": {
  737. "description": "200 response",
  738. "content": {
  739. "application/json": {
  740. "examples": {
  741. "default": {
  742. "value": true
  743. }
  744. },
  745. "schema": {
  746. "type": "boolean"
  747. }
  748. }
  749. }
  750. }
  751. }
  752. }
  753. },
  754. "/users/{userID}/login": {
  755. "put": {
  756. "operationId": "loginAsUser",
  757. "summary": "Login as this user",
  758. "tags": [
  759. "Users"
  760. ],
  761. "security": [
  762. {
  763. "BearerAuth": [
  764. "users"
  765. ]
  766. }
  767. ],
  768. "parameters": [
  769. {
  770. "in": "path",
  771. "name": "userID",
  772. "schema": {
  773. "type": "integer",
  774. "minimum": 1
  775. },
  776. "required": true,
  777. "description": "User ID",
  778. "example": 2
  779. }
  780. ],
  781. "responses": {
  782. "200": {
  783. "description": "200 response",
  784. "content": {
  785. "application/json": {
  786. "examples": {
  787. "default": {
  788. "value": {
  789. "token": "eyJhbGciOiJSUzI1NiIsInR...16OjT8B3NLyXg",
  790. "expires": "2020-01-31T10:56:23.239Z",
  791. "user": {
  792. "id": 1,
  793. "created_on": "2020-01-30T10:43:44.000Z",
  794. "modified_on": "2020-01-30T10:43:44.000Z",
  795. "is_disabled": 0,
  796. "email": "[email protected]",
  797. "name": "Jamie Curnow",
  798. "nickname": "James",
  799. "avatar": "//www.gravatar.com/avatar/3c8d73f45fd8763f827b964c76e6032a?default=mm",
  800. "roles": [
  801. "admin"
  802. ]
  803. }
  804. }
  805. }
  806. },
  807. "schema": {
  808. "type": "object",
  809. "description": "Login object",
  810. "required": [
  811. "expires",
  812. "token",
  813. "user"
  814. ],
  815. "additionalProperties": false,
  816. "properties": {
  817. "expires": {
  818. "description": "Token Expiry Unix Time",
  819. "example": 1566540249,
  820. "minimum": 1,
  821. "type": "number"
  822. },
  823. "token": {
  824. "description": "JWT Token",
  825. "example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
  826. "type": "string"
  827. },
  828. "user": {
  829. "$ref": "#/components/schemas/UserObject"
  830. }
  831. }
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "/reports/hosts": {
  840. "get": {
  841. "operationId": "reportsHosts",
  842. "summary": "Report on Host Statistics",
  843. "tags": [
  844. "Reports"
  845. ],
  846. "security": [
  847. {
  848. "BearerAuth": [
  849. "reports"
  850. ]
  851. }
  852. ],
  853. "responses": {
  854. "200": {
  855. "description": "200 response",
  856. "content": {
  857. "application/json": {
  858. "examples": {
  859. "default": {
  860. "value": {
  861. "proxy": 20,
  862. "redirection": 1,
  863. "stream": 0,
  864. "dead": 1
  865. }
  866. }
  867. },
  868. "schema": {
  869. "$ref": "#/components/schemas/HostReportObject"
  870. }
  871. }
  872. }
  873. }
  874. }
  875. }
  876. },
  877. "/audit-log": {
  878. "get": {
  879. "operationId": "getAuditLog",
  880. "summary": "Get Audit Log",
  881. "tags": [
  882. "Audit Log"
  883. ],
  884. "security": [
  885. {
  886. "BearerAuth": [
  887. "audit-log"
  888. ]
  889. }
  890. ],
  891. "responses": {
  892. "200": {
  893. "description": "200 response",
  894. "content": {
  895. "application/json": {
  896. "examples": {
  897. "default": {
  898. "value": {
  899. "proxy": 20,
  900. "redirection": 1,
  901. "stream": 0,
  902. "dead": 1
  903. }
  904. }
  905. },
  906. "schema": {
  907. "$ref": "#/components/schemas/HostReportObject"
  908. }
  909. }
  910. }
  911. }
  912. }
  913. }
  914. }
  915. },
  916. "components": {
  917. "securitySchemes": {
  918. "BearerAuth": {
  919. "type": "http",
  920. "scheme": "bearer"
  921. }
  922. },
  923. "schemas": {
  924. "HealthObject": {
  925. "type": "object",
  926. "description": "Health object",
  927. "additionalProperties": false,
  928. "required": [
  929. "status",
  930. "version"
  931. ],
  932. "properties": {
  933. "status": {
  934. "type": "string",
  935. "description": "Healthy",
  936. "example": "OK"
  937. },
  938. "version": {
  939. "type": "object",
  940. "description": "The version object",
  941. "example": {
  942. "major": 2,
  943. "minor": 0,
  944. "revision": 0
  945. },
  946. "additionalProperties": false,
  947. "required": [
  948. "major",
  949. "minor",
  950. "revision"
  951. ],
  952. "properties": {
  953. "major": {
  954. "type": "integer",
  955. "minimum": 0
  956. },
  957. "minor": {
  958. "type": "integer",
  959. "minimum": 0
  960. },
  961. "revision": {
  962. "type": "integer",
  963. "minimum": 0
  964. }
  965. }
  966. }
  967. }
  968. },
  969. "TokenObject": {
  970. "type": "object",
  971. "description": "Token object",
  972. "required": [
  973. "expires",
  974. "token"
  975. ],
  976. "additionalProperties": false,
  977. "properties": {
  978. "expires": {
  979. "description": "Token Expiry Unix Time",
  980. "example": 1566540249,
  981. "minimum": 1,
  982. "type": "number"
  983. },
  984. "token": {
  985. "description": "JWT Token",
  986. "example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
  987. "type": "string"
  988. }
  989. }
  990. },
  991. "SettingObject": {
  992. "type": "object",
  993. "description": "Setting object",
  994. "required": [
  995. "id",
  996. "name",
  997. "description",
  998. "value",
  999. "meta"
  1000. ],
  1001. "additionalProperties": false,
  1002. "properties": {
  1003. "id": {
  1004. "type": "string",
  1005. "description": "Setting ID",
  1006. "minLength": 1,
  1007. "example": "default-site"
  1008. },
  1009. "name": {
  1010. "type": "string",
  1011. "description": "Setting Display Name",
  1012. "minLength": 1,
  1013. "example": "Default Site"
  1014. },
  1015. "description": {
  1016. "type": "string",
  1017. "description": "Meaningful description",
  1018. "minLength": 1,
  1019. "example": "What to show when Nginx is hit with an unknown Host"
  1020. },
  1021. "value": {
  1022. "description": "Value in almost any form",
  1023. "example": "congratulations",
  1024. "oneOf": [
  1025. {
  1026. "type": "string",
  1027. "minLength": 1
  1028. },
  1029. {
  1030. "type": "integer"
  1031. },
  1032. {
  1033. "type": "object"
  1034. },
  1035. {
  1036. "type": "number"
  1037. },
  1038. {
  1039. "type": "array"
  1040. }
  1041. ]
  1042. },
  1043. "meta": {
  1044. "description": "Extra metadata",
  1045. "example": {},
  1046. "type": "object"
  1047. }
  1048. }
  1049. },
  1050. "SettingsList": {
  1051. "type": "array",
  1052. "description": "Setting list",
  1053. "items": {
  1054. "$ref": "#/components/schemas/SettingObject"
  1055. }
  1056. },
  1057. "UserObject": {
  1058. "type": "object",
  1059. "description": "User object",
  1060. "required": [
  1061. "id",
  1062. "created_on",
  1063. "modified_on",
  1064. "is_disabled",
  1065. "email",
  1066. "name",
  1067. "nickname",
  1068. "avatar",
  1069. "roles"
  1070. ],
  1071. "additionalProperties": false,
  1072. "properties": {
  1073. "id": {
  1074. "type": "integer",
  1075. "description": "User ID",
  1076. "minimum": 1,
  1077. "example": 1
  1078. },
  1079. "created_on": {
  1080. "type": "string",
  1081. "description": "Created Date",
  1082. "example": "2020-01-30T09:36:08.000Z"
  1083. },
  1084. "modified_on": {
  1085. "type": "string",
  1086. "description": "Modified Date",
  1087. "example": "2020-01-30T09:41:04.000Z"
  1088. },
  1089. "is_disabled": {
  1090. "type": "integer",
  1091. "minimum": 0,
  1092. "maximum": 1,
  1093. "description": "Is user Disabled (0 = false, 1 = true)",
  1094. "example": 0
  1095. },
  1096. "email": {
  1097. "type": "string",
  1098. "description": "Email",
  1099. "minLength": 3,
  1100. "example": "[email protected]"
  1101. },
  1102. "name": {
  1103. "type": "string",
  1104. "description": "Name",
  1105. "minLength": 1,
  1106. "example": "Jamie Curnow"
  1107. },
  1108. "nickname": {
  1109. "type": "string",
  1110. "description": "Nickname",
  1111. "example": "James"
  1112. },
  1113. "avatar": {
  1114. "type": "string",
  1115. "description": "Gravatar URL based on email, without scheme",
  1116. "example": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm"
  1117. },
  1118. "roles": {
  1119. "description": "Roles applied",
  1120. "example": [
  1121. "admin"
  1122. ],
  1123. "type": "array",
  1124. "items": {
  1125. "type": "string"
  1126. }
  1127. }
  1128. }
  1129. },
  1130. "UsersList": {
  1131. "type": "array",
  1132. "description": "User list",
  1133. "items": {
  1134. "$ref": "#/components/schemas/UserObject"
  1135. }
  1136. },
  1137. "AuthObject": {
  1138. "type": "object",
  1139. "description": "Authentication Object",
  1140. "required": [
  1141. "type",
  1142. "secret"
  1143. ],
  1144. "properties": {
  1145. "type": {
  1146. "type": "string",
  1147. "pattern": "^password$",
  1148. "example": "password"
  1149. },
  1150. "current": {
  1151. "type": "string",
  1152. "minLength": 1,
  1153. "maxLength": 64,
  1154. "example": "changeme"
  1155. },
  1156. "secret": {
  1157. "type": "string",
  1158. "minLength": 8,
  1159. "maxLength": 64,
  1160. "example": "mySuperN3wP@ssword!"
  1161. }
  1162. }
  1163. },
  1164. "PermissionsObject": {
  1165. "type": "object",
  1166. "properties": {
  1167. "visibility": {
  1168. "type": "string",
  1169. "description": "Visibility Type",
  1170. "enum": [
  1171. "all",
  1172. "user"
  1173. ]
  1174. },
  1175. "access_lists": {
  1176. "type": "string",
  1177. "description": "Access Lists Permissions",
  1178. "enum": [
  1179. "hidden",
  1180. "view",
  1181. "manage"
  1182. ]
  1183. },
  1184. "dead_hosts": {
  1185. "type": "string",
  1186. "description": "404 Hosts Permissions",
  1187. "enum": [
  1188. "hidden",
  1189. "view",
  1190. "manage"
  1191. ]
  1192. },
  1193. "proxy_hosts": {
  1194. "type": "string",
  1195. "description": "Proxy Hosts Permissions",
  1196. "enum": [
  1197. "hidden",
  1198. "view",
  1199. "manage"
  1200. ]
  1201. },
  1202. "redirection_hosts": {
  1203. "type": "string",
  1204. "description": "Redirection Permissions",
  1205. "enum": [
  1206. "hidden",
  1207. "view",
  1208. "manage"
  1209. ]
  1210. },
  1211. "streams": {
  1212. "type": "string",
  1213. "description": "Streams Permissions",
  1214. "enum": [
  1215. "hidden",
  1216. "view",
  1217. "manage"
  1218. ]
  1219. },
  1220. "certificates": {
  1221. "type": "string",
  1222. "description": "Certificates Permissions",
  1223. "enum": [
  1224. "hidden",
  1225. "view",
  1226. "manage"
  1227. ]
  1228. }
  1229. }
  1230. },
  1231. "HostReportObject": {
  1232. "type": "object",
  1233. "properties": {
  1234. "proxy": {
  1235. "type": "integer",
  1236. "description": "Proxy Hosts Count"
  1237. },
  1238. "redirection": {
  1239. "type": "integer",
  1240. "description": "Redirection Hosts Count"
  1241. },
  1242. "stream": {
  1243. "type": "integer",
  1244. "description": "Streams Count"
  1245. },
  1246. "dead": {
  1247. "type": "integer",
  1248. "description": "404 Hosts Count"
  1249. }
  1250. }
  1251. }
  1252. }
  1253. }
  1254. }