Workspace client
This is a client for workspace REST API and workspace master JSON-RPC API interactions.
Examples
REST API client
import WorkspaceClient from '@eclipse-che/workspace-client';
const restApiClient = WorkspaceClient.getRestApi();
const promise = restApiClient.getAll();
promise.then((workspaces) => {
});
JSON-RPC API client
import WorkspaceClient from '@eclipse-che/workspace-client';
const entryPoint = '/api/workspace';
const masterApiClient = WorkspaceClient.getJsonRpcApi(entryPoint);
const connectionPromise = masterApiClient.connect(entryPoint);
connectionPromise.then(() => {
const clientId = masterApiClient.getClientId();
});
const statusChangeHandler = message => {
const status = message.status;
};
masterApiClient.subscribeWorkspaceStatus('workspace-id', statusChangeHandler);
License
EPL-2