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.
Konstantin Lebedev
7c597c19c1
|
2 years ago | |
---|---|---|
.. | ||
.openapi-generator | 2 years ago | |
docs | 2 years ago | |
lib | 2 years ago | |
test | 2 years ago | |
.gitignore | 2 years ago | |
.openapi-generator-ignore | 2 years ago | |
.php-cs-fixer.dist.php | 2 years ago | |
.travis.yml | 2 years ago | |
README.md | 2 years ago | |
composer.json | 2 years ago | |
git_push.sh | 2 years ago | |
phpunit.xml.dist | 2 years ago |
README.md
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, add the following to composer.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
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?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 | GET /dir/assign | Assign a file key |
DefaultApi | dirLookup | GET /dir/lookup | Lookup volume |
Models
Authorization
All endpoints do not require authorization.
Tests
To run the tests, use:
composer install
vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
3.43.0
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen