Skip to content

Commit

Permalink
Added chassis routes
Browse files Browse the repository at this point in the history
Signed-off-by: ehaligow <[email protected]>
  • Loading branch information
ehaligow committed Dec 14, 2023
1 parent 5a268d6 commit e822d52
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 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 @@ -441,8 +441,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 @@ -469,9 +473,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
22 changes: 22 additions & 0 deletions svc-device-manager/rest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ func createRouting(app *iris.Application, config config.Config) {

routes := app.Party("/ODIM/v1")
{
chassis := routes.Party("/Chassis", basicAuthHandler)
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.Get("", getGenericResourceHandler)
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 e822d52

Please sign in to comment.