Skip to content
Open
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php namespace App\Http\Controllers;
<?php

namespace App\Http\Controllers;

/**
* Copyright 2017 OpenStack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,7 +15,9 @@
* limitations under the License.
**/
use App\Models\Foundation\Marketplace\IRemoteCloudServiceRepository;
use Illuminate\Http\Response;
use models\oauth2\IResourceServerContext;
use OpenApi\Attributes as OA;

/**
* Class RemoteCloudsApiController
Expand All @@ -29,8 +34,80 @@ public function __construct(IRemoteCloudServiceRepository $repository, IResource
parent::__construct($repository, $resource_server_context);
}

#[OA\Get(
path: "/api/public/v1/marketplace/remotely-managed-private-clouds",
description: "Get all marketplace remotely managed private cloud services (OpenStack implementations)",
summary: 'Get all remotely managed private clouds',
operationId: 'getAllRemotelyManagedPrivateClouds',
tags: ['Marketplace', 'Clouds'],
parameters: [
new OA\Parameter(
name: 'page',
in: 'query',
required: false,
description: 'Page number for pagination',
schema: new OA\Schema(type: 'integer', example: 1)
),
new OA\Parameter(
name: 'per_page',
in: 'query',
required: false,
description: 'Items per page',
schema: new OA\Schema(type: 'integer', example: 10, maximum: 100)
),
new OA\Parameter(
name: 'filter[]',
in: 'query',
required: false,
description: 'Filter expressions in the format field<op>value. Available fields: name, company. Operators: =@, ==, @@.',
style: 'form',
explode: true,
schema: new OA\Schema(
type: 'array',
items: new OA\Items(type: 'string', example: 'name@@managed')
)
),
new OA\Parameter(
name: 'order',
in: 'query',
required: false,
description: 'Order by field(s)',
schema: new OA\Schema(type: 'string', example: 'name,-id')
),
new OA\Parameter(
name: 'expand',
in: 'query',
required: false,
description: 'Comma-separated list of related resources to include. Available relations: company, type, capabilities, guests, hypervisors, supported_regions',
schema: new OA\Schema(type: 'string', example: 'company,type')
),
new OA\Parameter(
name: 'relations',
in: 'query',
required: false,
description: 'Relations to load eagerly',
schema: new OA\Schema(type: 'string', example: 'company,type')
),
new OA\Parameter(
name: 'fields',
in: 'query',
required: false,
description: 'Comma-separated list of fields to return',
schema: new OA\Schema(type: 'string', example: 'id,name,company.name')
),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: 'Success - Returns paginated list of remotely managed private clouds',
content: new OA\JsonContent(ref: '#/components/schemas/PaginatedRemoteCloudsResponse')
),
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error")
]
)]
public function getAll()
{
return parent::getAll();
}
}
}
40 changes: 40 additions & 0 deletions app/Swagger/MarketplaceSchemas.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,43 @@ class MarketplaceAppliancesResponseSchema
class PaginatedAppliancesResponseSchema
{
}

#[OA\Schema(
schema: 'RemoteCloudsResponse',
type: 'object',
allOf: [
new OA\Schema(ref: '#/components/schemas/OpenStackImplementation'),
new OA\Schema(
type: 'object',
properties: [
'hardware_spec' => new OA\Property(property: 'hardware_spec', type: 'string', example: 'High-performance servers with SSD storage'),
'pricing_models' => new OA\Property(property: 'pricing_models', type: 'string', example: 'Monthly subscription, Pay-as-you-use'),
'published_sla' => new OA\Property(property: 'published_sla', type: 'string', example: '99.9% uptime guarantee'),
'is_vendor_managed_upgrades' => new OA\Property(property: 'is_vendor_managed_upgrades', type: 'boolean', example: true),
]
)
]
)]
class RemoteCloudsResponseSchema
{
}

#[OA\Schema(
schema: 'PaginatedRemoteCloudsResponse',
allOf: [
new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'),
new OA\Schema(
type: 'object',
properties: [
new OA\Property(
property: 'data',
type: 'array',
items: new OA\Items(ref: '#/components/schemas/RemoteCloudService')
)
]
)
]
)]
class PaginatedRemoteCloudsResponseSchema
{
}
2 changes: 1 addition & 1 deletion app/Swagger/Models/MarketPlaceReviewSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
]
class MarketPlaceReviewSchema
{
}
}
25 changes: 25 additions & 0 deletions app/Swagger/Models/RemoteCloudServiceSchema.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Swagger\schemas;

use OpenApi\Attributes as OA;

#[OA\Schema(
schema: 'RemoteCloudService',
type: 'object',
allOf: [
new OA\Schema(ref: '#/components/schemas/OpenStackImplementation'),
new OA\Schema(
type: 'object',
properties: [
new OA\Property(property: 'hardware_spec', type: 'string', example: 'High-performance servers with SSD storage'),
new OA\Property(property: 'pricing_models', type: 'string', example: 'Monthly subscription, Pay-as-you-use'),
new OA\Property(property: 'published_sla', type: 'string', example: '99.9% uptime guarantee'),
new OA\Property(property: 'is_vendor_managed_upgrades', type: 'boolean', example: true),
]
)
]
)]
class RemoteCloudServiceSchema
{
}