commit
59dd48d0f7
|
@ -1,4 +1,9 @@
|
|||
# Changelog
|
||||
## [0.24.0] - 2025-09-09
|
||||
### Added
|
||||
- Se ha añadido la funcionalidad/servicio para poder eliminar un repositorio GIT
|
||||
|
||||
---
|
||||
## [0.23.0] - 2025-09-08
|
||||
### Added
|
||||
- Se ha añadido la funcionalidad/servicio para poder realizar backups a repositorios GIT
|
||||
|
|
|
@ -128,7 +128,15 @@ resources:
|
|||
input: App\Dto\Input\CreateBackupInput
|
||||
uriTemplate: /image-repositories/server/git/{uuid}/create-backup
|
||||
controller: App\Controller\OgRepository\Git\CreateBackupAction
|
||||
|
||||
|
||||
git_repository_delete:
|
||||
shortName: OgRepository Server
|
||||
description: Delete a repository in a Git repository
|
||||
class: ApiPlatform\Metadata\Post
|
||||
method: POST
|
||||
input: App\Dto\Input\DeleteRepositoryInput
|
||||
uriTemplate: /image-repositories/server/git/{uuid}/delete
|
||||
controller: App\Controller\OgRepository\Git\DeleteAction
|
||||
|
||||
properties:
|
||||
App\Entity\ImageRepository:
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\OgRepository\Git;
|
||||
|
||||
use App\Controller\OgRepository\AbstractOgRepositoryController;
|
||||
use App\Dto\Input\DeleteRepositoryInput;
|
||||
use App\Entity\ImageRepository;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
||||
#[AsController]
|
||||
class DeleteAction extends AbstractOgRepositoryController
|
||||
{
|
||||
public function __invoke(ImageRepository $repository, DeleteRepositoryInput $input): JsonResponse
|
||||
{
|
||||
$content = $this->createRequest('DELETE', 'http://'.$repository->getIp().':8006/ogrepository/v1/git/repositories/'.$input->repository, [
|
||||
]);
|
||||
|
||||
if (isset($content['error']) && $content['code'] === Response::HTTP_INTERNAL_SERVER_ERROR) {
|
||||
throw new BadRequestHttpException('Error deleting repository');
|
||||
}
|
||||
|
||||
return new JsonResponse(data: [], status: Response::HTTP_OK);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Dto\Input;
|
||||
|
||||
use ApiPlatform\Metadata\ApiProperty;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
final class DeleteRepositoryInput
|
||||
{
|
||||
#[Groups(['image-image-repository:write'])]
|
||||
#[ApiProperty(description: 'The repository name', example: "")]
|
||||
public ?string $repository = null;
|
||||
}
|
Loading…
Reference in New Issue