Giter VIP home page Giter VIP logo

php-rgw-api's Introduction

php-rgw-api

This lib aims to be a comprehensive PHP SDK for the Rados Gateway Admin API.

Installation

This lib is designed to be installed using Composer

{
  "require": {
    "myena/php-rgw-api": "4.*"
  }
}

Features

  1. All object-containing responses are modeled (list)
  2. Entire request chain is fully modeled, with required parameters being type-hinted (e.g. UserRootLink::Info)
  3. All models have full swagger-php markup
  4. Includes undocumented /metadata endpoints
  5. Parameter validation (link) with hopefully useful error messages

Usage Basics

More details on each component can be found below, however here is a quick fill-in-the-blank example:

$config = new \MyENA\RGW\Config([
    'address'   => '',
    'adminPath' => '',
    'apiKey'    => '',
    'apiSecret' => '',
]);
$client = new \MyENA\RGW\Client($config, new \MyENA\RGW\Signature\V2Signature());

[$users, $err] = $client->Metadata()->User()->List()->execute();
if (null !== $err) {
    die((string)$err);
}
var_dump($users);

// and whatever else you wanna do...

Advanced Config

You must first construct a Config:

$config = new \MyENA\RGW\Config([
    'address'   => '',  // REQUIRED
    'apiKey'    => '',  // REQUIRED
    'apiSecret' => '',  // REQUIRED

    'adminPath'     => '',  // optional, whatever your admin ops path is

    'silent' => false // optional, silences all logging
]);

Custom Guzzle Client

The optional 2nd argument in the Config constructor accepts any object implementing the Guzzle ClientInterface. If left null, a new Guzzle Client with no options will be constructed.

Custom Logger

The optional 3rd argument in the Config constructor accepts any object implementing the Psr LoggerInterface. If left null, a new Psr NullLogger will be constructed.

php-rgw-api's People

Contributors

dcarbone avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.