cronguard / cronguard-php
Oficial PHP SDK para Cronguard API
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cronguard/cronguard-php
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');
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