Skip to content

service: Add admin user concept and app definition scaling endpoint #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"-Dtheia.cloud.app.id=asdfghjkl",
"-Dquarkus.http.port=8081",
"-Dtheia.cloud.use.keycloak=true",
"-Dquarkus.oidc.auth-server-url=${input:keycloakURL}",
"-Dquarkus.oidc.auth-server-url=${input:keycloakURL}/realms/TheiaCloud",
"-Dquarkus.oidc.client-id=theia-cloud",
"-Dquarkus.oidc.credentials.secret=publicbutoauth2proxywantsasecret"
],
Expand Down Expand Up @@ -101,7 +101,7 @@
"type": "promptString",
"id": "keycloakURL",
"description": "Provide the keycloak url",
"default": "https://192.168.59.101.nip.io/keycloak/"
"default": "https://192.168.59.101.nip.io/keycloak"
}
]
}
2 changes: 2 additions & 0 deletions dockerfiles/service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ ENV KEYCLOAK_ENABLE true
ENV KEYCLOAK_SERVERURL https://keycloak.url/auth/realms/TheiaCloud
ENV KEYCLOAK_CLIENTID theia-cloud
ENV KEYCLOAK_CLIENTSECRET publicbutoauth2proxywantsasecret
ENV KEYCLOAK_ADMIN_GROUP theia-cloud/admin

ENTRYPOINT java -Dtheia.cloud.app.id=${APPID} \
-Dquarkus.http.port=${SERVICE_PORT} \
-Dtheia.cloud.auth.admin.group=${KEYCLOAK_ADMIN_GROUP} \
-Dtheia.cloud.use.keycloak=${KEYCLOAK_ENABLE} \
-Dquarkus.oidc.auth-server-url=${KEYCLOAK_SERVERURL} \
-Dquarkus.oidc.client-id=${KEYCLOAK_CLIENTID} \
Expand Down
37 changes: 37 additions & 0 deletions documentation/api/Apis/AppDefinitionAdminResourceApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AppDefinitionAdminResourceApi

All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**serviceAdminAppdefinitionAppDefinitionNamePatch**](AppDefinitionAdminResourceApi.md#serviceAdminAppdefinitionAppDefinitionNamePatch) | **PATCH** /service/admin/appdefinition/{appDefinitionName} | Updates an app definition |


<a name="serviceAdminAppdefinitionAppDefinitionNamePatch"></a>
# **serviceAdminAppdefinitionAppDefinitionNamePatch**
> AppDefinition serviceAdminAppdefinitionAppDefinitionNamePatch(appDefinitionName, AppDefinitionUpdateRequest)

Updates an app definition

Updates an app definition&#39;s properties. Allowed properties to update are defined by AppDefinitionUpdateRequest.

### Parameters

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **appDefinitionName** | **String**| The K8S resource name of the app definition to update. | [default to null] |
| **AppDefinitionUpdateRequest** | [**AppDefinitionUpdateRequest**](../Models/AppDefinitionUpdateRequest.md)| | |

### Return type

[**AppDefinition**](../Models/AppDefinition.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

36 changes: 36 additions & 0 deletions documentation/api/Apis/RootAdminResourceApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# RootAdminResourceApi

All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**serviceAdminAppIdGet**](RootAdminResourceApi.md#serviceAdminAppIdGet) | **GET** /service/admin/{appId} | Admin Ping |


<a name="serviceAdminAppIdGet"></a>
# **serviceAdminAppIdGet**
> Boolean serviceAdminAppIdGet(appId)

Admin Ping

Replies with success if the service is available and the user an admin.

### Parameters

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **appId** | **String**| | [default to null] |

### Return type

**Boolean**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: text/plain

2 changes: 1 addition & 1 deletion documentation/api/Apis/RootResourceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Launch Session

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **LaunchRequest** | [**LaunchRequest**](../Models/LaunchRequest.md)| | [optional] |
| **LaunchRequest** | [**LaunchRequest**](../Models/LaunchRequest.md)| | |

### Return type

Expand Down
6 changes: 3 additions & 3 deletions documentation/api/Apis/SessionResourceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Stop session

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **SessionStopRequest** | [**SessionStopRequest**](../Models/SessionStopRequest.md)| | [optional] |
| **SessionStopRequest** | [**SessionStopRequest**](../Models/SessionStopRequest.md)| | |

### Return type

Expand All @@ -78,7 +78,7 @@ Report session activity

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **SessionActivityRequest** | [**SessionActivityRequest**](../Models/SessionActivityRequest.md)| | [optional] |
| **SessionActivityRequest** | [**SessionActivityRequest**](../Models/SessionActivityRequest.md)| | |

### Return type

Expand Down Expand Up @@ -133,7 +133,7 @@ Start a new session

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **SessionStartRequest** | [**SessionStartRequest**](../Models/SessionStartRequest.md)| | [optional] |
| **SessionStartRequest** | [**SessionStartRequest**](../Models/SessionStartRequest.md)| | |

### Return type

Expand Down
4 changes: 2 additions & 2 deletions documentation/api/Apis/WorkspaceResourceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Delete workspace

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **WorkspaceDeletionRequest** | [**WorkspaceDeletionRequest**](../Models/WorkspaceDeletionRequest.md)| | [optional] |
| **WorkspaceDeletionRequest** | [**WorkspaceDeletionRequest**](../Models/WorkspaceDeletionRequest.md)| | |

### Return type

Expand All @@ -76,7 +76,7 @@ Create workspace

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **WorkspaceCreationRequest** | [**WorkspaceCreationRequest**](../Models/WorkspaceCreationRequest.md)| | [optional] |
| **WorkspaceCreationRequest** | [**WorkspaceCreationRequest**](../Models/WorkspaceCreationRequest.md)| | |

### Return type

Expand Down
21 changes: 21 additions & 0 deletions documentation/api/Models/AppDefinition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# AppDefinition
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **apiVersion** | **String** | | [optional] [default to null] |
| **kind** | **String** | | [optional] [default to null] |
| **metadata** | [**ObjectMeta**](ObjectMeta.md) | | [optional] [default to null] |
| **spec** | [**AppDefinitionSpec**](AppDefinitionSpec.md) | | [optional] [default to null] |
| **status** | [**AppDefinitionStatus**](AppDefinitionStatus.md) | | [optional] [default to null] |
| **singular** | **String** | | [optional] [default to null] |
| **crdName** | **String** | | [optional] [default to null] |
| **scope** | **String** | | [optional] [default to null] |
| **plural** | **String** | | [optional] [default to null] |
| **served** | **Boolean** | | [optional] [default to null] |
| **storage** | **Boolean** | | [optional] [default to null] |
| **deprecated** | **Boolean** | | [optional] [default to null] |
| **deprecationWarning** | **String** | | [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)

10 changes: 10 additions & 0 deletions documentation/api/Models/AppDefinitionStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AppDefinitionStatus
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **operatorStatus** | **String** | | [optional] [default to null] |
| **operatorMessage** | **String** | | [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 documentation/api/Models/AppDefinitionUpdateRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# AppDefinitionUpdateRequest
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **appId** | **String** | The App Id of this Theia Cloud instance. Request without a matching Id will be denied. | [default to null] |
| **minInstances** | **Integer** | The minimum number of instances to run. | [optional] [default to null] |
| **maxInstances** | **Integer** | The maximum number of instances to run. | [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)

15 changes: 15 additions & 0 deletions documentation/api/Models/ManagedFieldsEntry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ManagedFieldsEntry
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **apiVersion** | **String** | | [optional] [default to null] |
| **fieldsType** | **String** | | [optional] [default to null] |
| **fieldsV1** | [**Object**](.md) | | [optional] [default to null] |
| **manager** | **String** | | [optional] [default to null] |
| **operation** | **String** | | [optional] [default to null] |
| **subresource** | **String** | | [optional] [default to null] |
| **time** | **String** | | [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)

23 changes: 23 additions & 0 deletions documentation/api/Models/ObjectMeta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ObjectMeta
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **annotations** | **Map** | | [optional] [default to null] |
| **creationTimestamp** | **String** | | [optional] [default to null] |
| **deletionGracePeriodSeconds** | **Long** | | [optional] [default to null] |
| **deletionTimestamp** | **String** | | [optional] [default to null] |
| **finalizers** | **List** | | [optional] [default to null] |
| **generateName** | **String** | | [optional] [default to null] |
| **generation** | **Long** | | [optional] [default to null] |
| **labels** | **Map** | | [optional] [default to null] |
| **managedFields** | [**List**](ManagedFieldsEntry.md) | | [optional] [default to null] |
| **name** | **String** | | [optional] [default to null] |
| **namespace** | **String** | | [optional] [default to null] |
| **ownerReferences** | [**List**](OwnerReference.md) | | [optional] [default to null] |
| **resourceVersion** | **String** | | [optional] [default to null] |
| **selfLink** | **String** | | [optional] [default to null] |
| **uid** | **String** | | [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)

14 changes: 14 additions & 0 deletions documentation/api/Models/OwnerReference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OwnerReference
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **apiVersion** | **String** | | [optional] [default to null] |
| **kind** | **String** | | [optional] [default to null] |
| **blockOwnerDeletion** | **Boolean** | | [optional] [default to null] |
| **controller** | **Boolean** | | [optional] [default to null] |
| **name** | **String** | | [optional] [default to null] |
| **uid** | **String** | | [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)

8 changes: 8 additions & 0 deletions documentation/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ All URIs are relative to *http://localhost*

| Class | Method | HTTP request | Description |
|------------ | ------------- | ------------- | -------------|
| *AppDefinitionAdminResourceApi* | [**serviceAdminAppdefinitionAppDefinitionNamePatch**](Apis/AppDefinitionAdminResourceApi.md#serviceadminappdefinitionappdefinitionnamepatch) | **PATCH** /service/admin/appdefinition/{appDefinitionName} | Updates an app definition |
| *AppDefinitionResourceApi* | [**serviceAppdefinitionAppIdGet**](Apis/AppDefinitionResourceApi.md#serviceappdefinitionappidget) | **GET** /service/appdefinition/{appId} | List app definitions |
| *RootAdminResourceApi* | [**serviceAdminAppIdGet**](Apis/RootAdminResourceApi.md#serviceadminappidget) | **GET** /service/admin/{appId} | Admin Ping |
| *RootResourceApi* | [**serviceAppIdGet**](Apis/RootResourceApi.md#serviceappidget) | **GET** /service/{appId} | Ping |
*RootResourceApi* | [**servicePost**](Apis/RootResourceApi.md#servicepost) | **POST** /service | Launch Session |
| *SessionResourceApi* | [**serviceSessionAppIdUserGet**](Apis/SessionResourceApi.md#servicesessionappiduserget) | **GET** /service/session/{appId}/{user} | List sessions |
Expand All @@ -24,11 +26,17 @@ All URIs are relative to *http://localhost*
## Documentation for Models

- [ActivityTracker](./Models/ActivityTracker.md)
- [AppDefinition](./Models/AppDefinition.md)
- [AppDefinitionListRequest](./Models/AppDefinitionListRequest.md)
- [AppDefinitionSpec](./Models/AppDefinitionSpec.md)
- [AppDefinitionStatus](./Models/AppDefinitionStatus.md)
- [AppDefinitionUpdateRequest](./Models/AppDefinitionUpdateRequest.md)
- [EnvironmentVars](./Models/EnvironmentVars.md)
- [LaunchRequest](./Models/LaunchRequest.md)
- [ManagedFieldsEntry](./Models/ManagedFieldsEntry.md)
- [Monitor](./Models/Monitor.md)
- [ObjectMeta](./Models/ObjectMeta.md)
- [OwnerReference](./Models/OwnerReference.md)
- [PingRequest](./Models/PingRequest.md)
- [SessionActivityRequest](./Models/SessionActivityRequest.md)
- [SessionListRequest](./Models/SessionListRequest.md)
Expand Down
Loading