Skip to content

Commit bfe724f

Browse files
committed
Add an endpoint for closing an experiment
With this it's possible to close an experiment on the server. Upon reception of the command the server can dispose allocated resources hence the client doesn't need them anymore. This change follows the TSP update provided by: eclipse-cdt-cloud/trace-server-protocol#95 Signed-off-by: Bernd Hufmann <[email protected]>
1 parent e23c508 commit bfe724f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tsp-typescript-client/src/protocol/http-tsp-client.ts

+12
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ export class HttpTspClient implements ITspClient {
142142
return RestClient.put(url, parameters, Experiment);
143143
}
144144

145+
/**
146+
* Close an experiment
147+
* @param expUUID Experiment UUID to close
148+
* @returns The closed experiment
149+
*/
150+
closeExperiment(
151+
expUUID: string
152+
): Promise<TspClientResponse<Experiment>> {
153+
const url = this.baseUrl + "/experiments/" + expUUID + ":close";
154+
return RestClient.put(url, new Query({}), Experiment);
155+
}
156+
145157
/**
146158
* Delete an experiment on the server
147159
* @param expUUID Experiment UUID to delete

tsp-typescript-client/src/protocol/tsp-client.ts

+9
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ export interface ITspClient {
9494
parameters: Query
9595
): Promise<TspClientResponse<Experiment>>;
9696

97+
/**
98+
* Close an experiment
99+
* @param expUUID Experiment UUID to close
100+
* @returns The closed experiment
101+
*/
102+
closeExperiment(
103+
expUUID: string
104+
): Promise<TspClientResponse<Experiment>>;
105+
97106
/**
98107
* Delete an experiment on the server
99108
* @param expUUID Experiment UUID to delete

0 commit comments

Comments
 (0)