Konstantin Lebedev
7c597c19c1
|
2 years ago | |
---|---|---|
.. | ||
.openapi-generator | 2 years ago | |
docs | 2 years ago | |
src | 2 years ago | |
.gitignore | 2 years ago | |
.openapi-generator-ignore | 2 years ago | |
.travis.yml | 2 years ago | |
Org.OpenAPITools.sln | 2 years ago | |
README.md | 2 years ago | |
build.bat | 2 years ago | |
build.sh | 2 years ago | |
git_push.sh | 2 years ago | |
mono_nunit_test.sh | 2 years ago |
README.md
Org.OpenAPITools - the C# library for the Seaweedfs Master Server API
The Seaweedfs Master Server API allows you to store blobs
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 3.43.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
Frameworks supported
- .NET 4.0 or later
- Windows Phone 7.1 (Mango)
Dependencies
- RestSharp - 105.1.0 or later
- Json.NET - 7.0.0 or later
- JsonSubTypes - 1.2.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742
Installation
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
Packaging
A .nuspec
is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec
uses placeholders from the .csproj
, so build the .csproj
directly:
nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
Getting Started
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration.Default.BasePath = "https://127.0.0.1:9333";
var apiInstance = new DefaultApi(Configuration.Default);
var count = new Object(); // 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 (optional)
var collection = new Object(); // Object | required collection name (optional)
var dataCenter = new Object(); // Object | preferred data center (optional)
var rack = new Object(); // Object | preferred rack (optional)
var dataNode = new Object(); // Object | preferred volume server, e.g. 127.0.0.1:8080 (optional)
var disk = new Object(); // Object | If you have disks labelled, this must be supplied to specify the disk type to allocate on. (optional)
var replication = new Object(); // Object | replica placement strategy (optional)
var ttl = new Object(); // Object | file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year (optional)
var preallocate = new Object(); // Object | If no matching volumes, pre-allocate this number of bytes on disk for new volumes. (optional)
var memoryMapMaxSizeMb = new Object(); // Object | Only implemented for windows. Use memory mapped files with specified size for new volumes. (optional)
var writableVolumeCount = new Object(); // Object | If no matching volumes, create specified number of new volumes. (optional)
try
{
// Assign a file key
FileKey result = apiInstance.DirAssign(count, collection, dataCenter, rack, dataNode, disk, replication, ttl, preallocate, memoryMapMaxSizeMb, writableVolumeCount);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.DirAssign: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Documentation for API Endpoints
All URIs are relative to https://127.0.0.1:9333
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | DirAssign | GET /dir/assign | Assign a file key |
DefaultApi | DirLookup | GET /dir/lookup | Lookup volume |
Documentation for Models
Documentation for Authorization
All endpoints do not require authorization.