Giter VIP home page Giter VIP logo

zendserverwebapimodule's Introduction

ZendServerWebApi

ZF2 module that ease Zend Server API usage

Zend Framework 2 API

To use a Zend Server API, call the APIManager form the service locator :

$apiManager = $serviceLocator->get('zend_server_api');

And then send the request and retrieve the response like this :

$apiResponse = $apiManager->apiMethodName();

Where ApiMethodName is the API method : getNotifications, cacheClear, etc.... see Zend Server Web API documentation. $apiResponse will be ApiResponse instance and can be used a SimpleXMLElement to get XML Data. By exemple the clusterGetServerStatus method will return a response in which you can acces data like that :

$nodeCount = $apiResponse->responseData->serverList->count(); //To know the number a nodes in the cluster
$serverStatus = $apiResponse->responseData->serverList->serverInfo[0]->status // To know the status of the first node

API Request parameters POST or GET can be passed to the ApiManger by using an array :

$response = $apiManager->auditGetList(array(
        'limit' => 5,
        'order' => 'creation_time',
        'direction' => 'DESC'
    ));

Setting

You can set a default configuration of your environment in the zendserverwebapi.conf.php file under the 'zsapi' key:

'zsapi' => array (
    //Configuratin of the HTTP client that will connect to the Zend Server
    'client' => array (
        'adapter' => 'Zend\Http\Client\Adapter\Curl',
    ),
    // Target - the Zend Server you want to reach through API
    'target' => new ArrayObject(array (
        'zsurl' => 'http://localhost:10081', //
        'zskey' => '<SECRET-NAME>',
        'zssecret' => '<SECRET-HASH>',
        'zsversion' => '6.1',
)),

zendserverwebapimodule's People

Contributors

afroyd avatar fwwarr-zoop avatar heikogh avatar kher avatar mkherlakian avatar perforce-sp avatar slaff avatar slav-at-attachix avatar swilczynski avatar yonman avatar zvikazend 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.