2017 © Pedro PelĂĄez
 

library ovh

Wrapper for OVH APIs

image

proprietes-privees/ovh

Wrapper for OVH APIs

  • Tuesday, February 2, 2016
  • by proprietes-privees
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP Wrapper for OVH APIs, (*1)

This PHP package is a lightweight wrapper for OVH APIs. That's the easiest way to use OVH.com APIs in your PHP applications., (*2)

Build Status HHVM Status, (*3)

get('/me')['firstname'];
?>

Quickstart

To download this wrapper and integrate it inside your PHP application, you can use Composer., (*4)

Add the repository in your composer.json file or, if you don't already have this file, create it at the root of your project with this content:, (*5)

{
    "name": "Example Application",
    "description": "This is an example of OVH APIs wrapper usage",
    "require": {
        "ovh/ovh": "dev-master"
    }
}

Then, you can install OVH APIs wrapper and dependencies with:, (*6)

php composer.phar install

This will install ovh/ovh to ./vendor, along with other dependencies including autoload.php., (*7)

How to login as a user?

To communicate with APIs, the SDK uses a token on each request to identify the user. This token is called Consumer Key. To have a validated Consumer Key, you need to redirect your user on specific authentication page. Once the user has logged in, the token is validated and user will be redirected on $redirection url., (*8)

 'GET',
    'path'      => '/me*'
]);

// Get credentials
$conn = new Api($applicationKey, $applicationSecret, $endpoint);
$credentials = $conn->requestCredentials($rights, $redirection);

// Save consumer key and redirect to authentication page
$_SESSION['consumer_key'] = $credentials["consumerKey"];
header('location: '. $credentials["validationUrl"]);
...
?>

How to use OVH API to enable network burst on SBG1 servers?

get('/dedicated/server/');

foreach ($servers as $server) {

    // Search servers inside SBG1
    $details = $conn->get('/dedicated/server/'. $server);
    if ($details['datacenter'] == 'sbg1') {

        // Activate burst on server
        $content = (object) array('status' => "active");
        $conn->put('/dedicated/server/'. $server . '/burst', $content);
        echo "We burst " . $server;
    }
}

?>

How to build the documentation?

Documentation is based on phpdocumentor. To install it with other quality tools, you can install local npm project in a clone a project, (*9)

git clone https://github.com/ovh/php-ovh.git
cd php-ovh
php composer.phar install
npm install

To generate documentation, it's possible to use directly:, (*10)

grunt default

Documentation is available in docs/ directory., (*11)

How to run tests?

Tests are based on phpunit. To install it with other quality tools, you can install local npm project in a clone a project, (*12)

git https://github.com/ovh/php-ovh.git
cd php-ovh
php composer.phar install
npm install

Edit phpunit.xml file with your credentials to pass functionals tests. Then, you can run directly unit and functionals tests with grunt., (*13)

grunt

Supported APIs

OVH Europe

  • Documentation: https://eu.api.ovh.com/
  • Community support: api-subscribe@ml.ovh.net
  • Console: https://eu.api.ovh.com/console
  • Create application credentials: https://eu.api.ovh.com/createApp/
  • Create script credentials (all keys at once): https://eu.api.ovh.com/createToken/

OVH North America

  • Documentation: https://ca.api.ovh.com/
  • Community support: api-subscribe@ml.ovh.net
  • Console: https://ca.api.ovh.com/console
  • Create application credentials: https://ca.api.ovh.com/createApp/
  • Create script credentials (all keys at once): https://ca.api.ovh.com/createToken/

So you Start Europe

  • Documentation: https://eu.api.soyoustart.com/
  • Community support: api-subscribe@ml.ovh.net
  • Console: https://eu.api.soyoustart.com/console/
  • Create application credentials: https://eu.api.soyoustart.com/createApp/
  • Create script credentials (all keys at once): https://eu.api.soyoustart.com/createToken/

So you Start North America

  • Documentation: https://ca.api.soyoustart.com/
  • Community support: api-subscribe@ml.ovh.net
  • Console: https://ca.api.soyoustart.com/console/
  • Create application credentials: https://ca.api.soyoustart.com/createApp/
  • Create script credentials (all keys at once): https://ca.api.soyoustart.com/createToken/

Kimsufi Europe

  • Documentation: https://eu.api.kimsufi.com/
  • Community support: api-subscribe@ml.ovh.net
  • Console: https://eu.api.kimsufi.com/console/
  • Create application credentials: https://eu.api.kimsufi.com/createApp/
  • Create script credentials (all keys at once): https://eu.api.kimsufi.com/createToken/

Kimsufi North America

  • Documentation: https://ca.api.kimsufi.com/
  • Community support: api-subscribe@ml.ovh.net
  • Console: https://ca.api.kimsufi.com/console/
  • Create application credentials: https://ca.api.kimsufi.com/createApp/
  • Create script credentials (all keys at once): https://ca.api.kimsufi.com/createToken/

Runabove

  • Documentation: https://community.runabove.com/kb/en/instances/how-to-use-runabove-api.html
  • Community support: https://community.runabove.com
  • Console: https://api.runabove.com/console/
  • Create application credentials: https://api.runabove.com/createApp/
  • Create script credentials (all keys at once): https://api.runabove.com/createToken/
  • Contribute: https://github.com/ovh/php-ovh
  • Report bugs: https://github.com/ovh/php-ovh/issues

The Versions

02/02 2016

dev-master

9999999-dev

Wrapper for OVH APIs

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vincent Cassé

02/02 2016

1.0

1.0.0.0

Wrapper for OVH APIs

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vincent Cassé