post.json 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. "operationId": "createStream",
  3. "summary": "Create a Stream",
  4. "tags": ["Streams"],
  5. "security": [
  6. {
  7. "BearerAuth": ["streams"]
  8. }
  9. ],
  10. "requestBody": {
  11. "description": "Stream Payload",
  12. "required": true,
  13. "content": {
  14. "application/json": {
  15. "schema": {
  16. "type": "object",
  17. "additionalProperties": false,
  18. "required": ["incoming_port", "forwarding_host", "forwarding_port"],
  19. "properties": {
  20. "incoming_port": {
  21. "$ref": "../../../components/stream-object.json#/properties/incoming_port"
  22. },
  23. "forwarding_host": {
  24. "$ref": "../../../components/stream-object.json#/properties/forwarding_host"
  25. },
  26. "forwarding_port": {
  27. "$ref": "../../../components/stream-object.json#/properties/forwarding_port"
  28. },
  29. "tcp_forwarding": {
  30. "$ref": "../../../components/stream-object.json#/properties/tcp_forwarding"
  31. },
  32. "udp_forwarding": {
  33. "$ref": "../../../components/stream-object.json#/properties/udp_forwarding"
  34. },
  35. "meta": {
  36. "$ref": "../../../components/stream-object.json#/properties/meta"
  37. }
  38. }
  39. }
  40. }
  41. }
  42. },
  43. "responses": {
  44. "201": {
  45. "description": "201 response",
  46. "content": {
  47. "application/json": {
  48. "examples": {
  49. "default": {
  50. "value": {
  51. "id": 1,
  52. "created_on": "2024-10-09T02:33:45.000Z",
  53. "modified_on": "2024-10-09T02:33:45.000Z",
  54. "owner_user_id": 1,
  55. "incoming_port": 9090,
  56. "forwarding_host": "router.internal",
  57. "forwarding_port": 80,
  58. "tcp_forwarding": true,
  59. "udp_forwarding": false,
  60. "meta": {
  61. "nginx_online": true,
  62. "nginx_err": null
  63. },
  64. "enabled": true,
  65. "owner": {
  66. "id": 1,
  67. "created_on": "2024-10-09T02:33:16.000Z",
  68. "modified_on": "2024-10-09T02:33:16.000Z",
  69. "is_deleted": false,
  70. "is_disabled": false,
  71. "email": "[email protected]",
  72. "name": "Administrator",
  73. "nickname": "Admin",
  74. "avatar": "",
  75. "roles": ["admin"]
  76. }
  77. }
  78. }
  79. },
  80. "schema": {
  81. "$ref": "../../../components/stream-object.json"
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }