diff --git a/typespec/models/BuildStatusResponse.tsp b/typespec/models/BuildStatusResponse.tsp index 18da9ea1c..d54133e1b 100644 --- a/typespec/models/BuildStatusResponse.tsp +++ b/typespec/models/BuildStatusResponse.tsp @@ -1,8 +1,10 @@ +import "./Status.tsp"; + @doc("Response payload for build status.") model BuildStatusResponse { duration: string; id: string; startTime: string; - status: "PENDING" | "COMPLETED"; + status: Status; succeeded: boolean; } diff --git a/typespec/models/ContainerMirrorResponse.tsp b/typespec/models/ContainerMirrorResponse.tsp new file mode 100644 index 000000000..419575b9d --- /dev/null +++ b/typespec/models/ContainerMirrorResponse.tsp @@ -0,0 +1,16 @@ +import "./ContainerPlatform.tsp"; +import "./Status.tsp"; + +@doc("Response payload for container mirroring.") +model ContainerMirrorResponse { + mirrorId: string; + digest: string; + sourceImage: string; + targetImage: string; + platform: ContainerPlatform; + creationTime: string; + status: Status; + duration: string; + exitCode: int32; + logs: string; +} diff --git a/typespec/models/ContainerPlatform.tsp b/typespec/models/ContainerPlatform.tsp new file mode 100644 index 000000000..67da1a2f6 --- /dev/null +++ b/typespec/models/ContainerPlatform.tsp @@ -0,0 +1,21 @@ +@doc("Represents os platform of a container.") +model ContainerPlatform { + os: string; + arch: string; + variant?: string; +} + +enum Architecture { + ARM64, + AARCH64, + AMD64, + X86_64, + X86_64_ALT, + ARM +} + +enum OS { + LINUX, + WINDOWS, + MACOS +} diff --git a/typespec/models/Status.tsp b/typespec/models/Status.tsp new file mode 100644 index 000000000..c95ec9f0b --- /dev/null +++ b/typespec/models/Status.tsp @@ -0,0 +1,4 @@ +enum Status { + PENDING, + COMPLETED +} diff --git a/typespec/models/models.tsp b/typespec/models/models.tsp index e010857b1..a7f6a4f71 100644 --- a/typespec/models/models.tsp +++ b/typespec/models/models.tsp @@ -8,3 +8,4 @@ import "./WaveScanRecord.tsp"; import "./WaveBuildRecord.tsp"; import "./ValidateRegistryCredsRequest.tsp"; import "./WaveContainerRecord.tsp"; +import "./ContainerMirrorResponse.tsp"; diff --git a/typespec/routes.tsp b/typespec/routes.tsp index 061e3e287..b4562f52c 100644 --- a/typespec/routes.tsp +++ b/typespec/routes.tsp @@ -102,4 +102,14 @@ namespace wave { @route("validate-creds") @post op validateCreds(@body request: ValidateRegistryCredsRequest): boolean; + @route("/v1alpha1/mirrors/{mirrorId}") + interface getMirrorRecord { + @post op inspectContainer(@path mirrorId: string): { + @body response: ContainerMirrorResponse; + @statusCode statusCode: 200; + }|{ + @statusCode statusCode: 404; + }; + + } }