@@ -14,44 +14,48 @@ type Route struct {
1414 // It changes every time the application settings is changed and cannot be updated.
1515 UUID string `json:"uuid,omitempty"`
1616 Name string `json:"name,omitempty"`
17- Ptype string `json:"ptype,omitempty"`
1817 Kind string `json:"kind,omitempty"`
19- Port int `json:"port,omitempty"`
2018 ParentRefs []ParentRef `json:"parent_refs,omitempty"`
19+ Rules []RouteRule `json:"rules,omitempty"`
2120}
2221
2322type ParentRef struct {
2423 Name string `json:"name,omitempty"`
2524 Port int `json:"port,omitempty"`
2625}
2726
28- // // Routes defines a collection of Route objects.
27+ type RouteRule map [string ]interface {}
28+
29+ // Routes defines a collection of Route objects.
2930type Routes []Route
3031
31- // RouteCreateRequest is the structure of POST /v2/app/<app id>/routes/.
32+ // RouteCreateRequest is the structure of POST /v2/app/<app_id>/routes/.
33+
3234type RouteCreateRequest struct {
33- Name string `json:"name,omitempty"`
34- Ptype string `json:"ptype,omitempty"`
35- Port int `json:"port,omitempty"`
36- Kind string `json:"kind,omitempty"`
35+ Name string `json:"name,omitempty"`
36+ Kind string `json:"kind,omitempty"`
37+ Rules []RequestRouteRule `json:"rules,omitempty"`
3738}
3839
39- // RouteAttackRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/attach/?$.
40- type RouteAttackRequest struct {
41- Port int `json:"port,omitempty"`
42- Gateway string `json:"gateway,omitempty"`
40+ type BackendRefRequest struct {
41+ Kind string `json:"kind,omitempty"`
42+ Name string `json:"name,omitempty"`
43+ Port int32 `json:"port,omitempty"`
44+ Weight int32 `json:"weight,omitempty"`
4345}
4446
45- // RouteDetackRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/detach/?$.
46- type RouteDetackRequest struct {
47+ type RequestRouteRule struct {
48+ BackendRefs []BackendRefRequest `json:"backendRefs,omitempty"`
49+ }
50+
51+ // RouteAttachRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/attach/?$.
52+ type RouteAttachRequest struct {
4753 Port int `json:"port,omitempty"`
4854 Gateway string `json:"gateway,omitempty"`
4955}
5056
51- // RouteRule is the structure of GET RESPONSE /v2/apps/(?P<id>{})/routes/(?P<name>{})/rules/?$.
52- type RouteRule struct {
53- Name string `json:"name,omitempty"`
54- Ptype string `json:"ptype,omitempty"`
55- Kind string `json:"kind,omitempty"`
56- Rules interface {} `json:"rules,omitempty"`
57+ // RouteDetachRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/detach/?$.
58+ type RouteDetachRequest struct {
59+ Port int `json:"port,omitempty"`
60+ Gateway string `json:"gateway,omitempty"`
5761}
0 commit comments