Skip to content

Commit

Permalink
added GET /v1alpha2/container/{token} in typespec (#618)
Browse files Browse the repository at this point in the history
added GET /v1alpha2/container/{token} in typespec
  • Loading branch information
munishchouhan authored Aug 23, 2024
1 parent 5712996 commit 5cbd67a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
6 changes: 6 additions & 0 deletions typespec/models/User.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@doc("Wave USer details")
model User {
id: int64;
userName: string;
email: string;
}
28 changes: 28 additions & 0 deletions typespec/models/WaveContainerRecord.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import "./User.tsp";

@doc("Wave container details")
model WaveContainerRecord {
user: User;
workspaceId: int64;
containerImage?: string;
containerFile?: string;
containerConfig: ContainerConfig;
condaFile?: string;
platform?: string;
towerEndpoint?: string;
buildRepository?: string;
cacheRepository?: string;
fingerprint?: string;
timestamp: string;
zoneId?: string;
ipAddress?: string;
sourceImage?: string;
sourceDigest?: string;
waveImage?: string;
waveDigest?: string;
expiration: string;
buildId?: string;
buildNew?: boolean;
freeze?: boolean;
fusionVersion?: string;
}
3 changes: 2 additions & 1 deletion typespec/models/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import "./ContainerInspectResponse.tsp";
import "./MetricsResponse.tsp";
import "./WaveScanRecord.tsp";
import "./WaveBuildRecord.tsp";
import "./ValidateRegistryCredsRequest.tsp";
import "./ValidateRegistryCredsRequest.tsp";
import "./WaveContainerRecord.tsp";
9 changes: 8 additions & 1 deletion typespec/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ namespace wave {
@route("/v1alpha2/container")
interface ContainerService {

@post op createV1Alpha2Container(@body requestBody: ContainerRequest): {
@post op createContainer(@body requestBody: ContainerRequest): {
@body response: ContainerResponse;
@statusCode statusCode: 200;
};

@route("/{token}")
@get op getContainerDetails(@path token: string): {
@body response: WaveContainerRecord;
@statusCode statusCode: 200;
}|{
@statusCode statusCode: 404;
};
}

@route("/v1alpha1/builds/{buildId}")
Expand Down

0 comments on commit 5cbd67a

Please sign in to comment.