wefabric / acronis-php
Simple Acronis PHP SDK
v0.1.2
2022-11-14 13:44 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/guzzle: 7.*
- nesbot/carbon: 2.*
Requires (Dev)
- symfony/var-dumper: ^6.0
README
Simple implementation of the Acronis PHP library
Installation
composer require wefabric/acronis-php
Usage
Register a third-party application as an API client via the management console of the cloud platform in Acronis. Copy the domain, client id and client secret and use as followed.
<?php use Wefabric\Acronis\AcronisClient; use Wefabric\Acronis\Credentials; use Wefabric\Acronis\UrlResolver; require __DIR__."/../vendor/autoload.php"; $domainUrl = '{DOMAIN}'; $clientId = '{CLIENT_ID}'; $clientSecret = '{CLIENT_SECRET}'; $acronis = new AcronisClient(new UrlResolver($domainUrl), new Credentials($clientId, $clientSecret)); $alertsResponse = $acronis->getClient()->get('/api/alert_manager/v1/alerts'); // Retrieve the alerts as decoded Json $alertsResponse->json();
Examples
See for more examples in the 'examples' directory.
License
Wefabric Acronis PHP is open-sourced software licensed under the MIT license.