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.

103 lines
3.2 KiB

2 years ago
  1. # openapi_client
  2. OpenapiClient - the Ruby gem for the Seaweedfs Master Server API
  3. The Seaweedfs Master Server API allows you to store blobs
  4. This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
  5. - API version: 3.43.0
  6. - Package version: 1.0.0
  7. - Build package: org.openapitools.codegen.languages.RubyClientCodegen
  8. ## Installation
  9. ### Build a gem
  10. To build the Ruby code into a gem:
  11. ```shell
  12. gem build openapi_client.gemspec
  13. ```
  14. Then either install the gem locally:
  15. ```shell
  16. gem install ./openapi_client-1.0.0.gem
  17. ```
  18. (for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
  19. or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
  20. Finally add this to the Gemfile:
  21. gem 'openapi_client', '~> 1.0.0'
  22. ### Install from Git
  23. If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
  24. gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
  25. ### Include the Ruby code directly
  26. Include the Ruby code directly using `-I` as follows:
  27. ```shell
  28. ruby -Ilib script.rb
  29. ```
  30. ## Getting Started
  31. Please follow the [installation](#installation) procedure and then run the following code:
  32. ```ruby
  33. # Load the gem
  34. require 'openapi_client'
  35. api_instance = OpenapiClient::DefaultApi.new
  36. opts = {
  37. count: TODO, # Object | 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
  38. collection: TODO, # Object | required collection name
  39. data_center: TODO, # Object | preferred data center
  40. rack: TODO, # Object | preferred rack
  41. data_node: TODO, # Object | preferred volume server, e.g. 127.0.0.1:8080
  42. disk: TODO, # Object | If you have disks labelled, this must be supplied to specify the disk type to allocate on.
  43. replication: TODO, # Object | replica placement strategy
  44. ttl: TODO, # Object | file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year
  45. preallocate: TODO, # Object | If no matching volumes, pre-allocate this number of bytes on disk for new volumes.
  46. memory_map_max_size_mb: TODO, # Object | Only implemented for windows. Use memory mapped files with specified size for new volumes.
  47. writable_volume_count: TODO # Object | If no matching volumes, create specified number of new volumes.
  48. }
  49. begin
  50. #Assign a file key
  51. result = api_instance.dir_assign(opts)
  52. p result
  53. rescue OpenapiClient::ApiError => e
  54. puts "Exception when calling DefaultApi->dir_assign: #{e}"
  55. end
  56. ```
  57. ## Documentation for API Endpoints
  58. All URIs are relative to *https://127.0.0.1:9333*
  59. Class | Method | HTTP request | Description
  60. ------------ | ------------- | ------------- | -------------
  61. *OpenapiClient::DefaultApi* | [**dir_assign**](docs/DefaultApi.md#dir_assign) | **GET** /dir/assign | Assign a file key
  62. *OpenapiClient::DefaultApi* | [**dir_lookup**](docs/DefaultApi.md#dir_lookup) | **GET** /dir/lookup | Lookup volume
  63. ## Documentation for Models
  64. - [OpenapiClient::FileKey](docs/FileKey.md)
  65. - [OpenapiClient::Location](docs/Location.md)
  66. ## Documentation for Authorization
  67. All endpoints do not require authorization.