Skip to content

Commit

Permalink
Add an endpoint for closing an experiment
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bhufmann committed Nov 2, 2023
1 parent e23c508 commit bfe724f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tsp-typescript-client/src/protocol/http-tsp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ export class HttpTspClient implements ITspClient {
return RestClient.put(url, parameters, Experiment);
}

/**
* Close an experiment
* @param expUUID Experiment UUID to close
* @returns The closed experiment
*/
closeExperiment(
expUUID: string
): Promise<TspClientResponse<Experiment>> {
const url = this.baseUrl + "/experiments/" + expUUID + ":close";
return RestClient.put(url, new Query({}), Experiment);
}

/**
* Delete an experiment on the server
* @param expUUID Experiment UUID to delete
Expand Down
9 changes: 9 additions & 0 deletions tsp-typescript-client/src/protocol/tsp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ export interface ITspClient {
parameters: Query
): Promise<TspClientResponse<Experiment>>;

/**
* Close an experiment
* @param expUUID Experiment UUID to close
* @returns The closed experiment
*/
closeExperiment(
expUUID: string
): Promise<TspClientResponse<Experiment>>;

/**
* Delete an experiment on the server
* @param expUUID Experiment UUID to delete
Expand Down

0 comments on commit bfe724f

Please sign in to comment.