/
serve_api_models.go
42 lines (36 loc) · 1.69 KB
/
serve_api_models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package utils
// Please see the Ray Serve docs
// https://docs.ray.io/en/latest/serve/api/doc/ray.serve.schema.ServeDeploySchema.html for the
// multi-application schema.
// ServeDeploymentStatus and ServeApplicationStatus describe the format of status(es) that will
// be returned by the GetMultiApplicationStatus method of the dashboard client
// Describes the status of a deployment
type ServeDeploymentStatus struct {
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}
// Describes the status of an application
type ServeApplicationStatus struct {
Name string `json:"name,omitempty"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
Deployments map[string]ServeDeploymentStatus `json:"deployments"`
}
// V2 Serve API Response format. These extend the ServeDeploymentStatus and ServeApplicationStatus structs,
// but contain more information such as route prefix because the V2/multi-app GET API fetchs general metadata,
// not just statuses.
type ServeDeploymentDetails struct {
ServeDeploymentStatus
RoutePrefix string `json:"route_prefix,omitempty"`
}
type ServeApplicationDetails struct {
ServeApplicationStatus
RoutePrefix string `json:"route_prefix,omitempty"`
DocsPath string `json:"docs_path,omitempty"`
Deployments map[string]ServeDeploymentDetails `json:"deployments"`
}
type ServeDetails struct {
Applications map[string]ServeApplicationDetails `json:"applications"`
DeployMode string `json:"deploy_mode,omitempty"`
}