cronguard / cronguard-php
Oficial PHP SDK para Cronguard API
v1.0.0
2026-02-04 23:56 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- phpunit/phpunit: ^10.0
README
The PHP SDK for the Cronguard API.
Installation
You can install the package via composer:
composer require cronguard/cronguard-php
Requirements
- PHP 8.1 or higher
- Guzzle HTTP Client
Basic Usage
Instantiate the client with your API key:
use Cronguard\Client; $client = new Client('YOUR_API_KEY');
Ping
You can ping a monitor using its UUID:
$client->ping('MONITOR_UUID');
Monitors
List all monitors:
$monitors = $client->monitors()->list();
Create a new monitor:
// Name, Period (seconds), Grace (seconds) $newMonitor = $client->monitors()->create('Backup Database', 3600, 300);
Get a specific monitor:
$monitor = $client->monitors()->get('MONITOR_ID');
Update a monitor:
$client->monitors()->update('MONITOR_ID', [ 'name' => 'New Name', 'period_seconds' => 7200 ]);
Delete a monitor:
$client->monitors()->delete('MONITOR_ID');
Get monitor events:
$events = $client->monitors()->events('MONITOR_ID');
Notifications
List notifications (paginated):
$notifications = $client->notifications()->list(page: 1);
Testing
To run the tests:
./vendor/bin/phpunit
License
MIT