|
1 | | -<?php namespace App\Http\Controllers; |
| 1 | +<?php |
| 2 | + |
| 3 | +namespace App\Http\Controllers; |
| 4 | + |
2 | 5 | /** |
3 | 6 | * Copyright 2017 OpenStack Foundation |
4 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
12 | 15 | * limitations under the License. |
13 | 16 | **/ |
14 | 17 | use App\Models\Foundation\Marketplace\IPublicCloudServiceRepository; |
| 18 | +use Illuminate\Http\Response; |
15 | 19 | use models\oauth2\IResourceServerContext; |
| 20 | +use OpenApi\Attributes as OA; |
16 | 21 |
|
17 | 22 | /** |
18 | 23 | * Class PublicCloudsApiController |
|
21 | 26 | final class PublicCloudsApiController extends AbstractCompanyServiceApiController |
22 | 27 | { |
23 | 28 | /** |
24 | | - * PrivateCloudsApiController constructor. |
| 29 | + * PublicCloudsApiController constructor. |
25 | 30 | * @param IPublicCloudServiceRepository $repository |
26 | 31 | */ |
27 | 32 | public function __construct(IPublicCloudServiceRepository $repository, IResourceServerContext $resource_server_context) |
28 | 33 | { |
29 | 34 | parent::__construct($repository, $resource_server_context); |
30 | 35 | } |
31 | 36 |
|
| 37 | + #[OA\Get( |
| 38 | + path: "/api/public/v1/marketplace/public-clouds", |
| 39 | + description: "Get all marketplace public cloud services (OpenStack implementations)", |
| 40 | + summary: 'Get all public clouds', |
| 41 | + operationId: 'getAllPublicClouds', |
| 42 | + tags: ['Marketplace', 'Clouds'], |
| 43 | + parameters: [ |
| 44 | + new OA\Parameter( |
| 45 | + name: 'page', |
| 46 | + in: 'query', |
| 47 | + required: false, |
| 48 | + description: 'Page number for pagination', |
| 49 | + schema: new OA\Schema(type: 'integer', example: 1) |
| 50 | + ), |
| 51 | + new OA\Parameter( |
| 52 | + name: 'per_page', |
| 53 | + in: 'query', |
| 54 | + required: false, |
| 55 | + description: 'Items per page', |
| 56 | + schema: new OA\Schema(type: 'integer', example: 10, maximum: 100) |
| 57 | + ), |
| 58 | + new OA\Parameter( |
| 59 | + name: 'filter[]', |
| 60 | + in: 'query', |
| 61 | + required: false, |
| 62 | + description: 'Filter expressions in the format field<op>value. Available fields: name, company. Operators: =@, ==, @@.', |
| 63 | + style: 'form', |
| 64 | + explode: true, |
| 65 | + schema: new OA\Schema( |
| 66 | + type: 'array', |
| 67 | + items: new OA\Items(type: 'string', example: 'name@@aws') |
| 68 | + ) |
| 69 | + ), |
| 70 | + new OA\Parameter( |
| 71 | + name: 'order', |
| 72 | + in: 'query', |
| 73 | + required: false, |
| 74 | + description: 'Order by field(s)', |
| 75 | + schema: new OA\Schema(type: 'string', example: 'name,-id') |
| 76 | + ), |
| 77 | + new OA\Parameter( |
| 78 | + name: 'expand', |
| 79 | + in: 'query', |
| 80 | + required: false, |
| 81 | + description: 'Comma-separated list of related resources to include. Available relations: company, type, capabilities, guests, hypervisors, supported_regions, data_centers, data_center_regions', |
| 82 | + schema: new OA\Schema(type: 'string', example: 'company,data_centers') |
| 83 | + ), |
| 84 | + new OA\Parameter( |
| 85 | + name: 'relations', |
| 86 | + in: 'query', |
| 87 | + required: false, |
| 88 | + description: 'Relations to load eagerly', |
| 89 | + schema: new OA\Schema(type: 'string', example: 'company,data_centers') |
| 90 | + ), |
| 91 | + new OA\Parameter( |
| 92 | + name: 'fields', |
| 93 | + in: 'query', |
| 94 | + required: false, |
| 95 | + description: 'Comma-separated list of fields to return', |
| 96 | + schema: new OA\Schema(type: 'string', example: 'id,name,company.name') |
| 97 | + ), |
| 98 | + ], |
| 99 | + responses: [ |
| 100 | + new OA\Response( |
| 101 | + response: 200, |
| 102 | + description: 'Success - Returns paginated list of public clouds', |
| 103 | + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedPublicOrPrivateCloudsResponse') |
| 104 | + ), |
| 105 | + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), |
| 106 | + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") |
| 107 | + ] |
| 108 | + )] |
32 | 109 | public function getAll() |
33 | 110 | { |
34 | 111 | return parent::getAll(); |
|
0 commit comments