-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ocm): add openApi schema and OpenApiRouter (#2050)
* feat(ocm): Introduce openapi.yaml * feat(ocm): Add openapi dependencies * feat(ocm): Add openapi-doc.sh for docs generation * feat(ocm): Add scripts * feat(ocm): Add api-docs * feat(ocm): Add generated openapirouter * feat(ocm): Incorporate openapi router * feat(ocm): fix new line * feat(ocm): add security to openapi schema * feat(ocm): add servers * feat(ocm): add ocm api catalog entity * feat(ocm): add backend-openapi-utils to dist-dynamic package.json
- Loading branch information
Showing
23 changed files
with
837 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Apis/DefaultApi.md | ||
Models/Cluster.md | ||
Models/ClusterBase.md | ||
Models/ClusterDetails.md | ||
Models/ClusterDetails_allocatableResources.md | ||
Models/ClusterDetails_availableResources.md | ||
Models/ClusterNodesStatus.md | ||
Models/ClusterOverview.md | ||
Models/ClusterStatus.md | ||
Models/ClusterUpdate.md | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# DefaultApi | ||
|
||
All URIs are relative to _http://localhost:7007/api/ocm_ | ||
|
||
| Method | HTTP request | Description | | ||
| ---------------------------------------------------------------------------------- | ------------------------------------------ | ------------------------------------ | | ||
| [**statusGet**](DefaultApi.md#statusGet) | **GET** /status | Get the status of all clusters | | ||
| [**statusProviderIdClusterNameGet**](DefaultApi.md#statusProviderIdClusterNameGet) | **GET** /status/{providerId}/{clusterName} | Get the status of a specific cluster | | ||
|
||
<a name="statusGet"></a> | ||
|
||
# **statusGet** | ||
|
||
> List statusGet() | ||
Get the status of all clusters | ||
|
||
Retrieve the status of all clusters across all hubs. | ||
|
||
### Parameters | ||
|
||
This endpoint does not need any parameter. | ||
|
||
### Return type | ||
|
||
[**List**](../Models/ClusterOverview.md) | ||
|
||
### Authorization | ||
|
||
[JWT](../README.md#JWT) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json | ||
|
||
<a name="statusProviderIdClusterNameGet"></a> | ||
|
||
# **statusProviderIdClusterNameGet** | ||
|
||
> Cluster statusProviderIdClusterNameGet(providerId, clusterName) | ||
Get the status of a specific cluster | ||
|
||
Retrieve the status of a specific cluster on a given hub. | ||
|
||
### Parameters | ||
|
||
| Name | Type | Description | Notes | | ||
| --------------- | ---------- | -------------------------- | ----------------- | | ||
| **providerId** | **String** | The ID of the OCM provider | [default to null] | | ||
| **clusterName** | **String** | The name of the cluster | [default to null] | | ||
|
||
### Return type | ||
|
||
[**Cluster**](../Models/Cluster.md) | ||
|
||
### Authorization | ||
|
||
[JWT](../README.md#JWT) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Cluster | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------- | ---------------------------- | | ||
| **name** | **String** | The name of the cluster | [optional] [default to null] | | ||
| **consoleUrl** | **String** | URL for the cluster console | [optional] [default to null] | | ||
| **kubernetesVersion** | **String** | Version of Kubernetes | [optional] [default to null] | | ||
| **oauthUrl** | **String** | OAuth URL for the cluster | [optional] [default to null] | | ||
| **openshiftId** | **String** | ID of the OpenShift cluster | [optional] [default to null] | | ||
| **openshiftVersion** | **String** | Version of OpenShift running in the cluster | [optional] [default to null] | | ||
| **platform** | **String** | Platform of the cluster | [optional] [default to null] | | ||
| **region** | **String** | Region where the cluster is located | [optional] [default to null] | | ||
| **allocatableResources** | [**ClusterDetails_allocatableResources**](ClusterDetails_allocatableResources.md) | | [optional] [default to null] | | ||
| **availableResources** | [**ClusterDetails_availableResources**](ClusterDetails_availableResources.md) | | [optional] [default to null] | | ||
| **update** | [**ClusterUpdate**](ClusterUpdate.md) | | [optional] [default to null] | | ||
| **status** | [**ClusterStatus**](ClusterStatus.md) | | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ClusterBase | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| -------- | ---------- | ----------------------- | ---------------------------- | | ||
| **name** | **String** | The name of the cluster | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# ClusterDetails | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------- | ---------------------------- | | ||
| **consoleUrl** | **String** | URL for the cluster console | [optional] [default to null] | | ||
| **kubernetesVersion** | **String** | Version of Kubernetes | [optional] [default to null] | | ||
| **oauthUrl** | **String** | OAuth URL for the cluster | [optional] [default to null] | | ||
| **openshiftId** | **String** | ID of the OpenShift cluster | [optional] [default to null] | | ||
| **openshiftVersion** | **String** | Version of OpenShift running in the cluster | [optional] [default to null] | | ||
| **platform** | **String** | Platform of the cluster | [optional] [default to null] | | ||
| **region** | **String** | Region where the cluster is located | [optional] [default to null] | | ||
| **allocatableResources** | [**ClusterDetails_allocatableResources**](ClusterDetails_allocatableResources.md) | | [optional] [default to null] | | ||
| **availableResources** | [**ClusterDetails_availableResources**](ClusterDetails_availableResources.md) | | [optional] [default to null] | | ||
| **update** | [**ClusterUpdate**](ClusterUpdate.md) | | [optional] [default to null] | | ||
| **status** | [**ClusterStatus**](ClusterStatus.md) | | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
11 changes: 11 additions & 0 deletions
11
plugins/ocm-backend/api-docs/Models/ClusterDetails_allocatableResources.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ClusterDetails_allocatableResources | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---------------- | -------------- | ------------------------------- | ---------------------------- | | ||
| **cpuCores** | **BigDecimal** | Number of CPU cores allocatable | [optional] [default to null] | | ||
| **memorySize** | **String** | Size of allocatable memory | [optional] [default to null] | | ||
| **numberOfPods** | **BigDecimal** | Number of allocatable pods | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
11 changes: 11 additions & 0 deletions
11
plugins/ocm-backend/api-docs/Models/ClusterDetails_availableResources.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ClusterDetails_availableResources | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---------------- | -------------- | ----------------------------- | ---------------------------- | | ||
| **cpuCores** | **BigDecimal** | Number of CPU cores available | [optional] [default to null] | | ||
| **memorySize** | **String** | Size of available memory | [optional] [default to null] | | ||
| **numberOfPods** | **BigDecimal** | Number of available pods | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# ClusterNodesStatus | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---------- | ---------- | ------------------ | ---------------------------- | | ||
| **status** | **String** | Status of the node | [optional] [default to null] | | ||
| **type** | **String** | Type of the node | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ClusterOverview | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| -------------------- | ------------------------------------- | ------------------------------------------- | ---------------------------- | | ||
| **name** | **String** | The name of the cluster | [optional] [default to null] | | ||
| **status** | [**ClusterStatus**](ClusterStatus.md) | | [optional] [default to null] | | ||
| **update** | [**ClusterUpdate**](ClusterUpdate.md) | | [optional] [default to null] | | ||
| **platform** | **String** | Platform of the cluster | [optional] [default to null] | | ||
| **openshiftVersion** | **String** | Version of OpenShift running in the cluster | [optional] [default to null] | | ||
| **nodes** | [**List**](ClusterNodesStatus.md) | | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# ClusterStatus | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ------------- | ----------- | --------------------------------------------------------------- | ---------------------------- | | ||
| **available** | **Boolean** | Indicates if the cluster is available | [default to null] | | ||
| **reason** | **String** | Optional reason why the cluster is not available or as problems | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ClusterUpdate | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ------------- | ----------- | ----------------------------------- | ---------------------------- | | ||
| **available** | **Boolean** | Indicates if an update is available | [optional] [default to null] | | ||
| **version** | **String** | Version of the available update | [optional] [default to null] | | ||
| **url** | **String** | URL for the update | [optional] [default to null] | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Documentation for OCM Plugin API | ||
|
||
<a name="documentation-for-api-endpoints"></a> | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to _http://localhost:7007/api/ocm_ | ||
|
||
| Class | Method | HTTP request | Description | | ||
| ------------ | --------------------------------------------------------------------------------------- | ------------------------------------------ | ------------------------------------ | | ||
| _DefaultApi_ | [**statusGet**](Apis/DefaultApi.md#statusget) | **GET** /status | Get the status of all clusters | | ||
| _DefaultApi_ | [**statusProviderIdClusterNameGet**](Apis/DefaultApi.md#statusprovideridclusternameget) | **GET** /status/{providerId}/{clusterName} | Get the status of a specific cluster | | ||
|
||
<a name="documentation-for-models"></a> | ||
|
||
## Documentation for Models | ||
|
||
- [Cluster](./Models/Cluster.md) | ||
- [ClusterBase](./Models/ClusterBase.md) | ||
- [ClusterDetails](./Models/ClusterDetails.md) | ||
- [ClusterDetails_allocatableResources](./Models/ClusterDetails_allocatableResources.md) | ||
- [ClusterDetails_availableResources](./Models/ClusterDetails_availableResources.md) | ||
- [ClusterNodesStatus](./Models/ClusterNodesStatus.md) | ||
- [ClusterOverview](./Models/ClusterOverview.md) | ||
- [ClusterStatus](./Models/ClusterStatus.md) | ||
- [ClusterUpdate](./Models/ClusterUpdate.md) | ||
|
||
<a name="documentation-for-authorization"></a> | ||
|
||
## Documentation for Authorization | ||
|
||
<a name="JWT"></a> | ||
|
||
### JWT | ||
|
||
- **Type**: HTTP Bearer Token authentication (JWT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.