3.2 KiB
openapi_client
OpenapiClient - the Ruby gem for the Seaweedfs Master Server API
The Seaweedfs Master Server API allows you to store blobs
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 3.43.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
Installation
Build a gem
To build the Ruby code into a gem:
gem build openapi_client.gemspec
Then either install the gem locally:
gem install ./openapi_client-1.0.0.gem
(for development, run gem install --dev ./openapi_client-1.0.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'openapi_client', '~> 1.0.0'
Install from Git
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:
gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
# Load the gem
require 'openapi_client'
api_instance = OpenapiClient::DefaultApi.new
opts = {
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
collection: TODO, # Object | required collection name
data_center: TODO, # Object | preferred data center
rack: TODO, # Object | preferred rack
data_node: TODO, # Object | preferred volume server, e.g. 127.0.0.1:8080
disk: TODO, # Object | If you have disks labelled, this must be supplied to specify the disk type to allocate on.
replication: TODO, # Object | replica placement strategy
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
preallocate: TODO, # Object | If no matching volumes, pre-allocate this number of bytes on disk for new volumes.
memory_map_max_size_mb: TODO, # Object | Only implemented for windows. Use memory mapped files with specified size for new volumes.
writable_volume_count: TODO # Object | If no matching volumes, create specified number of new volumes.
}
begin
#Assign a file key
result = api_instance.dir_assign(opts)
p result
rescue OpenapiClient::ApiError => e
puts "Exception when calling DefaultApi->dir_assign: #{e}"
end
Documentation for API Endpoints
All URIs are relative to https://127.0.0.1:9333
Class | Method | HTTP request | Description |
---|---|---|---|
OpenapiClient::DefaultApi | dir_assign | GET /dir/assign | Assign a file key |
OpenapiClient::DefaultApi | dir_lookup | GET /dir/lookup | Lookup volume |
Documentation for Models
Documentation for Authorization
All endpoints do not require authorization.