You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
4.2 KiB

2 years ago
  1. openapi: 3.1.0
  2. info:
  3. title: Seaweedfs Master Server API
  4. description: |-
  5. The Seaweedfs Master Server API allows you to store blobs
  6. version: 3.43.0
  7. servers:
  8. - url: https://127.0.0.1:9333/
  9. paths:
  10. /dir/assign:
  11. get:
  12. summary: Assign a file key
  13. description: This operation is very cheap. Just increase a number in master server's memory.
  14. operationId: dirAssign
  15. parameters:
  16. - name: count
  17. in: query
  18. description: how many file ids to assign. Use <fid>_1, <fid>_2 for the assigned additional file ids. e.g. 3,01637037d6_1, 3,01637037d6_2
  19. schema:
  20. type: integer
  21. format: int32
  22. - name: collection
  23. in: query
  24. description: required collection name
  25. schema:
  26. type: string
  27. - name: dataCenter
  28. in: query
  29. description: preferred data center
  30. schema:
  31. type: string
  32. - name: rack
  33. in: query
  34. description: preferred rack
  35. schema:
  36. type: string
  37. - name: dataNode
  38. in: query
  39. description: preferred volume server, e.g. 127.0.0.1:8080
  40. schema:
  41. type: string
  42. - name: disk
  43. in: query
  44. description: If you have disks labelled, this must be supplied to specify the disk type to allocate on.
  45. schema:
  46. type: string
  47. - name: replication
  48. in: query
  49. description: replica placement strategy
  50. schema:
  51. type: string
  52. - name: ttl
  53. in: query
  54. description: "file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year"
  55. schema:
  56. type: string
  57. - name: preallocate
  58. in: query
  59. description: If no matching volumes, pre-allocate this number of bytes on disk for new volumes.
  60. schema:
  61. type: integer
  62. format: int64
  63. - name: memoryMapMaxSizeMb
  64. in: query
  65. description: Only implemented for windows. Use memory mapped files with specified size for new volumes.
  66. schema:
  67. type: integer
  68. format: int32
  69. - name: writableVolumeCount
  70. in: query
  71. description: If no matching volumes, create specified number of new volumes.
  72. schema:
  73. type: integer
  74. format: int32
  75. responses:
  76. '200':
  77. description: successful operation
  78. content:
  79. application/json:
  80. schema:
  81. $ref: '#/components/schemas/FileKey'
  82. /dir/lookup:
  83. get:
  84. summary: Lookup volume
  85. description: We would need to find out whether the volumes have moved.
  86. operationId: dirLookup
  87. parameters:
  88. - name: volumeId
  89. in: query
  90. description: volume id
  91. schema:
  92. type: integer
  93. format: int32
  94. - name: collection
  95. in: query
  96. description: optionally to speed up the lookup
  97. schema:
  98. type: string
  99. - name: fileId
  100. in: query
  101. description: If provided, this returns the fileId location and a JWT to update or delete the file.
  102. schema:
  103. type: string
  104. - name: read
  105. in: query
  106. description: works together with "fileId", if read=yes, JWT is generated for reads.
  107. schema:
  108. type: string
  109. responses:
  110. '200':
  111. description: successful operation
  112. content:
  113. application/json:
  114. schema:
  115. type: array
  116. items:
  117. $ref: '#/components/schemas/Location'
  118. components:
  119. schemas:
  120. FileKey:
  121. type: object
  122. properties:
  123. count:
  124. type: integer
  125. format: int64
  126. example: 10
  127. fid:
  128. type: string
  129. example: 3,01637037d6
  130. url:
  131. type: string
  132. example: 127.0.0.1:8080
  133. Location:
  134. type: object
  135. properties:
  136. publicUrl:
  137. type: string
  138. example: localhost:8080
  139. url:
  140. type: string
  141. example: localhost:8080