wefabric/acronis-php

Simple Acronis PHP SDK

v0.1.2 2022-11-14 13:44 UTC

This package is auto-updated.

Last update: 2024-12-14 18:29:26 UTC


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.