|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Services\Cloud\CloudAccess;
|
|
|
|
|
use App\Services\Cloud\CloudAdminOperationsService;
|
|
|
|
|
|
|
|
|
|
/** Operations inventory and administrator retry-stop control. */
|
|
|
|
|
final class CloudAdminOperationsController
|
|
|
|
|
{
|
|
|
|
|
public function index($request, $response)
|
|
|
|
|
{
|
|
|
|
|
return $response->withJson(CloudAdminOperationsService::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(CloudAdminOperationsService::detail(
|
|
|
|
|
$request->getAttribute('cloud_actor') ?? CloudAccess::actor(false),
|
|
|
|
|
(string) ($args['id'] ?? '')
|
|
|
|
|
))->withHeader('Cache-Control', 'private, no-store');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function cancel($request, $response, $args)
|
|
|
|
|
{
|
|
|
|
|
return $response->withJson(CloudAdminOperationsService::cancel(
|
|
|
|
|
$request->getAttribute('cloud_actor') ?? CloudAccess::actor(false),
|
|
|
|
|
(string) ($args['id'] ?? '')
|
|
|
|
|
))->withHeader('Cache-Control', 'private, no-store');
|
|
|
|
|
}
|
|
|
|
|
}
|