Skip to content

Commit

Permalink
Merge pull request #74 from ehaligow/ehaligow-chassis-alignment-with-…
Browse files Browse the repository at this point in the history
…OpenRMC1.0

Added Chassis routes
  • Loading branch information
Maciej Miś authored Jan 24, 2024
2 parents d0423cd + ccd3f5b commit c003d0b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib-dmtf/model/Links.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ type Links struct {
ComputerSystems []*Link `json:"ComputerSystems,omitempty"`
ConnectedPorts []*Link `json:"ConnectedPorts,omitempty"`
ConsumingComputerSystems []*Link `json:"ConsumingComputerSystems,omitempty"`
ContainedBy *Link `json:"ContainedBy,omitempty"`
ContainedBy Link `json:"ContainedBy"`
Contains []*Link `json:"Contains"`
ContainedByZones []*Link `json:"ContainedByZones,omitempty"`
CooledBy []*Link `json:"CooledBy,omitempty"`
Endpoints []*Link `json:"Endpoints,omitempty"`
Expand Down
11 changes: 9 additions & 2 deletions svc-api/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,12 @@ func Router() *iris.Application {
chassis.Get("/{id}/NetworkAdapters/{rid}", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/NetworkDeviceFunctions", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/NetworkPorts", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/NetworkDeviceFunctions/{rid}", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/NetworkPorts/{rid}", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/NetworkDeviceFunctions/{rid}", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/NetworkDeviceFunctions/{rid}/VLANS", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/Ports/{rid}", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/Ports", cha.GetChassisResource)
chassis.Get("/{id}/NetworkAdapters/{id2}/Assembly", cha.GetChassisResource)
chassis.Any("/", handle.ChassisMethodNotAllowed)
chassis.Any("/{id}", handle.ChassisMethodNotAllowed)
chassis.Any("/{id}/NetworkAdapters", handle.ChassisMethodNotAllowed)
Expand All @@ -485,9 +489,12 @@ func Router() *iris.Application {
chassis.Get("/{id}/LogServices/{rid}", cha.GetChassisResource)
chassis.Get("/{id}/LogServices/{rid}/Entries", cha.GetChassisResource)
chassis.Get("/{id}/LogServices/{rid}/Entries/{rid2}", cha.GetChassisResource)
chassis.Get("/{id}/Drives", cha.GetChassisResource)
chassis.Get("/{id}/Memory", cha.GetChassisResource)
chassis.Get("/{id}/MemoryDomains", cha.GetChassisResource)
// TODO
// chassis.Post("/{id}/LogServices/{rid}/Actions/LogService.ClearLog", cha.GetChassisResource)
chassis.Any("/{id}/LogServices", handle.ChassisMethodNotAllowed)
chassis.Get("/{id}/LogServices", cha.GetChassisResource)
chassis.Any("/{id}/LogServices/{rid}", handle.ChassisMethodNotAllowed)
chassis.Any("/{id}/LogServices/{rid}/Entries", handle.ChassisMethodNotAllowed)
chassis.Any("/{id}/LogServices/{rid}/Entries/{rid2}", handle.ChassisMethodNotAllowed)
Expand Down
19 changes: 18 additions & 1 deletion svc-device-manager/rest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,26 @@ func createRouting(app *iris.Application, config config.Config) {
chassis.Get("", getGenericResourceHandler)
chassis.Get("/{id}", getGenericResourceHandler)
chassis.Get("/{id}/Thermal", getGenericResourceHandler)
chassis.Get("/{id}/Assembly", getGenericResourceHandler)
chassis.Get("/{id}/Drives", getGenericResourceHandler)
chassis.Get("/{id}/Memory", getGenericResourceHandler)
chassis.Get("/{id}/MemoryDomains", getGenericResourceHandler)
chassis.Get("/{id}/Sensors", getGenericResourceHandler)
chassis.Get("/{id}/LogServices", getGenericResourceHandler)
chassisPower := chassis.Party("/{id}/Power")
chassisPower.Patch("", newPatchPowerHandler(config))
chassisPower.Get("", getGenericResourceHandler)
chassisPower.Patch("", newPatchPowerHandler(config))
chassisNetworkAdapters := chassis.Party("/{id}/NetworkAdapters")
chassisNetworkAdapters.Get("", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/Assembly", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/NetworkDeviceFunctions", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/NetworkDeviceFunctions/{id2}", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/NetworkDeviceFunctions/{id2}/VLANS", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/NetworkPorts", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/NetworkPorts/{id2}", getGenericResourceHandler)
chassisNetworkAdapters.Get("/{id}/Ports", getGenericResourceHandler)

systems := routes.Party("/Systems", basicAuthHandler)
systems.Get("", getGenericResourceHandler)
systems.Get("/{id}", getGenericResourceHandler)
Expand Down

0 comments on commit c003d0b

Please sign in to comment.