Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeesha committed Apr 28, 2024
1 parent 2de008b commit fcb8c03
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 20 deletions.
20 changes: 20 additions & 0 deletions admin/client/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,26 @@ export const definition = {
}),
},
},
getDeployment: {
method: "GET",
path: "/clusters/:clusterId/service/:serviceName/deployments/:deploymentId",
headers: z.object({
authorization: z.string(),
}),
body: z.undefined(),
responses: {
401: z.undefined(),
404: z.undefined(),
200: z.object({
id: z.string(),
status: z.enum(["uploading", "active", "inactive", "failed"]),
clusterId: z.string(),
service: z.string(),
provider: z.string(),
createdAt: z.date(),
}),
},
},
getDeployments: {
method: "GET",
path: "/clusters/:clusterId/service/:serviceName/deployments",
Expand Down
32 changes: 22 additions & 10 deletions cli/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,29 +416,41 @@ export const definition = {
}),
},
},
getDeployment: {
method: "GET",
path: "/clusters/:clusterId/service/:serviceName/deployments/:deploymentId",
headers: z.object({
authorization: z.string(),
}),
body: z.undefined(),
responses: {
401: z.undefined(),
404: z.undefined(),
200: z.object({
id: z.string(),
status: z.enum(["uploading", "active", "inactive", "failed"]),
clusterId: z.string(),
service: z.string(),
provider: z.string(),
createdAt: z.date(),
}),
},
},
getDeployments: {
method: "GET",
path: "/clusters/:clusterId/service/:serviceName/deployments",
headers: z.object({
authorization: z.string(),
}),
query: z.object({
status: z
.enum(["uploading", "active", "inactive", "failed", "cancelled"])
.optional(),
status: z.enum(["uploading", "active", "inactive", "failed"]).optional(),
limit: z.coerce.number().min(1).max(100).default(10),
}),
responses: {
200: z.array(
z.object({
id: z.string(),
status: z.enum([
"uploading",
"active",
"inactive",
"failed",
"cancelled",
]),
status: z.enum(["uploading", "active", "inactive", "failed"]),
clusterId: z.string(),
service: z.string(),
provider: z.string(),
Expand Down
32 changes: 22 additions & 10 deletions ts-core/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,29 +416,41 @@ export const definition = {
}),
},
},
getDeployment: {
method: "GET",
path: "/clusters/:clusterId/service/:serviceName/deployments/:deploymentId",
headers: z.object({
authorization: z.string(),
}),
body: z.undefined(),
responses: {
401: z.undefined(),
404: z.undefined(),
200: z.object({
id: z.string(),
status: z.enum(["uploading", "active", "inactive", "failed"]),
clusterId: z.string(),
service: z.string(),
provider: z.string(),
createdAt: z.date(),
}),
},
},
getDeployments: {
method: "GET",
path: "/clusters/:clusterId/service/:serviceName/deployments",
headers: z.object({
authorization: z.string(),
}),
query: z.object({
status: z
.enum(["uploading", "active", "inactive", "failed", "cancelled"])
.optional(),
status: z.enum(["uploading", "active", "inactive", "failed"]).optional(),
limit: z.coerce.number().min(1).max(100).default(10),
}),
responses: {
200: z.array(
z.object({
id: z.string(),
status: z.enum([
"uploading",
"active",
"inactive",
"failed",
"cancelled",
]),
status: z.enum(["uploading", "active", "inactive", "failed"]),
clusterId: z.string(),
service: z.string(),
provider: z.string(),
Expand Down

0 comments on commit fcb8c03

Please sign in to comment.