Skip to content
Snippets Groups Projects
Commit a1b198fd authored by Malte Bauch's avatar Malte Bauch
Browse files

changed GetDevices to GetDevice

there was no need to get the full device list. but for the cli there is
a need to access specific devices from the pnd via their uuid
parent fdd06d91
No related branches found
No related tags found
3 merge requests!97Resolve "PND handling via CLI and database",!91"Overhaul Architecture",!90Develop
This commit is part of merge request !91. Comments created here will be created in the context of that merge request.
......@@ -17,7 +17,7 @@ type PrincipalNetworkDomain interface {
RequestAll(string) error
GetName() string
GetDescription() string
GetDevices() map[uuid.UUID]*Device
GetDevice(uuid.UUID) (*Device, bool)
GetSBIs() map[string]SouthboundInterface
}
......@@ -45,8 +45,8 @@ func (pnd *pndImplementation) GetName() string {
return pnd.name
}
func (pnd *pndImplementation) GetDevices() map[uuid.UUID]*Device {
return pnd.devices
func (pnd *pndImplementation) GetDevice(uuid uuid.UUID) (*Device, bool) {
return pnd.getDevice(uuid)
}
func (pnd *pndImplementation) GetDescription() string {
......@@ -104,6 +104,11 @@ func (pnd *pndImplementation) removeDevice(uuid uuid.UUID) error {
return nil
}
func (pnd *pndImplementation) getDevice(uuid uuid.UUID) (*Device, bool) {
device, exists := pnd.devices[uuid]
return device, exists
}
func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) error {
d := pnd.devices[uuid]
ctx := context.Background()
......
......@@ -62,6 +62,9 @@ func (oc *OpenConfig) SetNode() func(schema *yang.Entry, root interface{}, path
}
}
// deprecated
// Use for prototyping only.
// Use OpenConfig instead
type AristaOC struct {
// deprecated
transport Transport
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment