rest-api.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. openapi: 3.0.1
  2. info:
  3. title: Jupyter Server Terminals API
  4. description: Terminals API
  5. contact:
  6. name: Jupyter Project
  7. url: https://jupyter.org
  8. version: "1"
  9. servers:
  10. - url: /
  11. paths:
  12. /api/terminals:
  13. get:
  14. tags:
  15. - terminals
  16. summary: Get available terminals
  17. responses:
  18. 200:
  19. description: A list of all available terminal ids.
  20. content:
  21. application/json:
  22. schema:
  23. type: array
  24. items:
  25. $ref: "#/components/schemas/Terminal"
  26. 403:
  27. description: Forbidden to access
  28. content: {}
  29. 404:
  30. description: Not found
  31. content: {}
  32. post:
  33. tags:
  34. - terminals
  35. summary: Create a new terminal
  36. responses:
  37. 200:
  38. description: Successfully created a new terminal
  39. content:
  40. application/json:
  41. schema:
  42. $ref: "#/components/schemas/Terminal"
  43. 403:
  44. description: Forbidden to access
  45. content: {}
  46. 404:
  47. description: Not found
  48. content: {}
  49. /api/terminals/{terminal_id}:
  50. get:
  51. tags:
  52. - terminals
  53. summary: Get a terminal session corresponding to an id.
  54. parameters:
  55. - name: terminal_id
  56. in: path
  57. description: ID of terminal session
  58. required: true
  59. schema:
  60. type: string
  61. responses:
  62. 200:
  63. description: Terminal session with given id
  64. content:
  65. application/json:
  66. schema:
  67. $ref: "#/components/schemas/Terminal"
  68. 403:
  69. description: Forbidden to access
  70. content: {}
  71. 404:
  72. description: Not found
  73. content: {}
  74. delete:
  75. tags:
  76. - terminals
  77. summary: Delete a terminal session corresponding to an id.
  78. parameters:
  79. - name: terminal_id
  80. in: path
  81. description: ID of terminal session
  82. required: true
  83. schema:
  84. type: string
  85. responses:
  86. 204:
  87. description: Successfully deleted terminal session
  88. content: {}
  89. 403:
  90. description: Forbidden to access
  91. content: {}
  92. 404:
  93. description: Not found
  94. content: {}
  95. components:
  96. schemas:
  97. Terminal:
  98. required:
  99. - name
  100. type: object
  101. properties:
  102. name:
  103. type: string
  104. description: name of terminal
  105. last_activity:
  106. type: string
  107. description: |
  108. ISO 8601 timestamp for the last-seen activity on this terminal. Use
  109. this to identify which terminals have been inactive since a given time.
  110. Timestamps will be UTC, indicated 'Z' suffix.
  111. description: A Terminal object
  112. parameters:
  113. terminal_id:
  114. name: terminal_id
  115. in: path
  116. description: ID of terminal session
  117. required: true
  118. schema:
  119. type: string