post.json 2.7 KB

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