|
|
# 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](https://openapi-generator.tech) 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](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later
The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-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](https://github.com/restsharp/RestSharp/issues/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:
```csharp 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](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) 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](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.
## Getting Started
```csharp 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**](docs/DefaultApi.md#dirassign) | **GET** /dir/assign | Assign a file key *DefaultApi* | [**DirLookup**](docs/DefaultApi.md#dirlookup) | **GET** /dir/lookup | Lookup volume
## Documentation for Models
- [Model.FileKey](docs/FileKey.md) - [Model.Location](docs/Location.md)
## Documentation for Authorization
All endpoints do not require authorization.
|