You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
645 B
PHP
25 lines
645 B
PHP
<?php
|
|
|
|
namespace App\Services\Cloud;
|
|
|
|
use App\Models\CloudInstance;
|
|
|
|
/** Production adapter for the Agent backup-readiness port. */
|
|
final class CloudAgentBackupReadinessProbe implements CloudBackupReadinessProbe
|
|
{
|
|
private const TIMEOUT_SECONDS = 5.0;
|
|
|
|
public function inspect(CloudInstance $instance, array $actor): array
|
|
{
|
|
return CloudAgentSettingsService::clientForHost(
|
|
(int) $instance->host_id,
|
|
self::TIMEOUT_SECONDS
|
|
)->request(
|
|
'GET',
|
|
'/v1/vms/' . rawurlencode((string) $instance->uuid)
|
|
. '/backup-readiness',
|
|
$actor
|
|
);
|
|
}
|
|
}
|