@@ -19,11 +19,13 @@ import (
1919)
2020
2121const (
22- SpacesPath = "/v3/spaces"
23- SpacePath = "/v3/spaces/{guid}"
24- RoutesForSpacePath = "/v3/spaces/{guid}/routes"
25- SpaceFeaturePath = "/v3/spaces/{guid}/features/{name}"
26- IsolationSegmentForSpacePath = "/v3/spaces/{guid}/relationships/isolation_segment"
22+ SpacesPath = "/v3/spaces"
23+ SpacePath = "/v3/spaces/{guid}"
24+ RoutesForSpacePath = "/v3/spaces/{guid}/routes"
25+ SpaceFeaturePath = "/v3/spaces/{guid}/features/{name}"
26+ IsolationSegmentForSpacePath = "/v3/spaces/{guid}/relationships/isolation_segment"
27+ RunningSecurityGroupsForSpacePath = "/v3/spaces/{guid}/running_security_groups"
28+ StagingSecurityGroupsForSpacePath = "/v3/spaces/{guid}/staging_security_groups"
2729)
2830
2931//counterfeiter:generate -o fake -fake-name CFSpaceRepository . CFSpaceRepository
@@ -204,6 +206,14 @@ func (h *Space) getIsolationSegment(r *http.Request) (*routing.Response, error)
204206 return routing .NewResponse (http .StatusOK ).WithBody (struct {}{}), nil
205207}
206208
209+ func (h * Space ) getRunningSecurityGroups (r * http.Request ) (* routing.Response , error ) {
210+ return routing .NewResponse (http .StatusOK ).WithBody (presenter .ForList (presenter .Empty , repositories.ListResult [any ]{}, h .apiBaseURL , * r .URL )), nil
211+ }
212+
213+ func (h * Space ) getStagingSecurityGroups (r * http.Request ) (* routing.Response , error ) {
214+ return routing .NewResponse (http .StatusOK ).WithBody (presenter .ForList (presenter .Empty , repositories.ListResult [any ]{}, h .apiBaseURL , * r .URL )), nil
215+ }
216+
207217func (h * Space ) getSpaceFeature (r * http.Request ) (* routing.Response , error ) {
208218 logger := logr .FromContextOrDiscard (r .Context ()).WithName ("handlers.space.get-feature" )
209219
@@ -232,6 +242,8 @@ func (h *Space) AuthenticatedRoutes() []routing.Route {
232242 {Method : "GET" , Pattern : SpacePath , Handler : h .get },
233243 {Method : "DELETE" , Pattern : RoutesForSpacePath , Handler : h .deleteUnmappedRoutes },
234244 {Method : "GET" , Pattern : IsolationSegmentForSpacePath , Handler : h .getIsolationSegment },
245+ {Method : "GET" , Pattern : RunningSecurityGroupsForSpacePath , Handler : h .getRunningSecurityGroups },
246+ {Method : "GET" , Pattern : StagingSecurityGroupsForSpacePath , Handler : h .getStagingSecurityGroups },
235247 {Method : "GET" , Pattern : SpaceFeaturePath , Handler : h .getSpaceFeature },
236248 }
237249}
0 commit comments