|
|
# OpenAPIClient-php
The Seaweedfs Master Server API allows you to store blobs
## Installation & Usage
### Requirements
PHP 7.4 and later. Should also work with PHP 8.0.
### Composer
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
```json { "repositories": [ { "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], "require": { "GIT_USER_ID/GIT_REPO_ID": "*@dev" } } ```
Then run `composer install`
### Manual Installation
Download the files and include `autoload.php`:
```php <?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php'); ```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```php <?php require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\DefaultApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $count = NULL; // mixed | 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 = NULL; // mixed | required collection name $data_center = NULL; // mixed | preferred data center $rack = NULL; // mixed | preferred rack $data_node = NULL; // mixed | preferred volume server, e.g. 127.0.0.1:8080 $disk = NULL; // mixed | If you have disks labelled, this must be supplied to specify the disk type to allocate on. $replication = NULL; // mixed | replica placement strategy $ttl = NULL; // mixed | file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year $preallocate = NULL; // mixed | If no matching volumes, pre-allocate this number of bytes on disk for new volumes. $memory_map_max_size_mb = NULL; // mixed | Only implemented for windows. Use memory mapped files with specified size for new volumes. $writable_volume_count = NULL; // mixed | If no matching volumes, create specified number of new volumes.
try { $result = $apiInstance->dirAssign($count, $collection, $data_center, $rack, $data_node, $disk, $replication, $ttl, $preallocate, $memory_map_max_size_mb, $writable_volume_count); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->dirAssign: ', $e->getMessage(), PHP_EOL; }
```
## API Endpoints
All URIs are relative to *https://127.0.0.1:9333*
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DefaultApi* | [**dirAssign**](docs/Api/DefaultApi.md#dirassign) | **GET** /dir/assign | Assign a file key *DefaultApi* | [**dirLookup**](docs/Api/DefaultApi.md#dirlookup) | **GET** /dir/lookup | Lookup volume
## Models
- [FileKey](docs/Model/FileKey.md) - [Location](docs/Model/Location.md)
## Authorization
All endpoints do not require authorization. ## Tests
To run the tests, use:
```bash composer install vendor/bin/phpunit ```
## Author
## About this package
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: `3.43.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
|