Skip to content

Commit

Permalink
Add new API to Service #69
Browse files Browse the repository at this point in the history
* Extend public API
  • Loading branch information
jfaltermeier committed May 22, 2023
1 parent 62d4351 commit 66cb0c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion node/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-theiacloud/common",
"version": "0.8.0-alpha.23",
"version": "0.8.0-alpha.24",
"description": "Common functionality for Theia.cloud",
"license": "EPL-2.0",
"keywords": [
Expand Down
12 changes: 7 additions & 5 deletions node/common/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
import { v4 as uuidv4 } from 'uuid';

import {
LaunchRequest as ClientLaunchRequest,
GitInit as ClientGitInit, LaunchRequest as ClientLaunchRequest,
PingRequest as ClientPingRequest, RootResourceApi, SessionActivityRequest as ClientSessionActivityRequest, SessionListRequest as ClientSessionListRequest,
SessionPerformance, SessionPerformanceRequest as ClientSessionPerformanceRequest,
SessionResourceApi, SessionSpec, SessionStartRequest as ClientSessionStartRequest, SessionStopRequest as ClientSessionStopRequest,
Expand Down Expand Up @@ -49,13 +49,13 @@ export namespace LaunchRequest {
}

export function createWorkspace(serviceUrl: string, appId: string, appDefinition: string, timeout?: number, user: string = createUser(),
workspaceName?: string, label?: string): LaunchRequest {
return { serviceUrl, appId, appDefinition, user, label, workspaceName, ephemeral: false, timeout };
workspaceName?: string, label?: string, gitInit?: GitInit): LaunchRequest {
return { serviceUrl, appId, appDefinition, user, label, workspaceName, ephemeral: false, timeout, gitInit };
}

// eslint-disable-next-line max-len
export function existingWorkspace(serviceUrl: string, appId: string, workspaceName: string, timeout?: number, appDefinition?: string, user: string = createUser()): LaunchRequest {
return { serviceUrl, appId, workspaceName, appDefinition, user, timeout };
export function existingWorkspace(serviceUrl: string, appId: string, workspaceName: string, timeout?: number, appDefinition?: string, user: string = createUser(), gitInit?: GitInit): LaunchRequest {
return { serviceUrl, appId, workspaceName, appDefinition, user, timeout, gitInit };
}
}

Expand Down Expand Up @@ -99,6 +99,8 @@ export namespace WorkspaceDeletionRequest {
export const KIND = 'workspaceDeletionRequest';
}

export type GitInit = ClientGitInit;

export namespace TheiaCloud {
function rootApi(serviceUrl: string, accessToken: string | undefined): RootResourceApi {
return new RootResourceApi(new Configuration({ basePath: serviceUrl, accessToken }));
Expand Down
4 changes: 2 additions & 2 deletions terraform/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ You might have to configure the firewall for mounting.

```bash
# This mounts the ~/tmp/minikube on the machine running minikube into minkube.
# Check the persisted volume to find the exact /tmp/hostpath-provisioner/theia-cloud/id path
minikube mount ~/tmp/minikube:/tmp/hostpath-provisioner/theia-cloud/a36c30cee-4d97-4097-826a-31ba72734fd0-pvc-ws-asdfghjkl-theia-c/
# Check the persisted volume to find the exact /tmp/hostpath-provisioner/theia-cloud/ path
minikube mount --uid 101 --gid 101 ~/tmp/minikube:/tmp/hostpath-provisioner/theia-cloud
```

#### Destroy Minikube Cluster
Expand Down

0 comments on commit 66cb0c9

Please sign in to comment.