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.
27 lines
876 B
PHP
27 lines
876 B
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Services\Cloud\CloudAccess;
|
|
use App\Services\Cloud\CloudAdminInstanceService;
|
|
|
|
/** Read-only database snapshots; live power state uses the existing VM API. */
|
|
final class CloudAdminInstanceController
|
|
{
|
|
public function index($request, $response)
|
|
{
|
|
return $response->withJson(CloudAdminInstanceService::page(
|
|
$request->getAttribute('cloud_actor') ?? CloudAccess::actor(false),
|
|
$request->getQueryParams()
|
|
))->withHeader('Cache-Control', 'private, no-store');
|
|
}
|
|
|
|
public function detail($request, $response, $args)
|
|
{
|
|
return $response->withJson(CloudAdminInstanceService::detail(
|
|
$request->getAttribute('cloud_actor') ?? CloudAccess::actor(false),
|
|
(string) ($args['id'] ?? '')
|
|
))->withHeader('Cache-Control', 'private, no-store');
|
|
}
|
|
}
|