|
|
```plantuml
|
|
|
@startuml
|
|
|
namespace nucleus {
|
|
|
class ClientConfig << (S,Aquamarine) >> {
|
|
|
+ Identifier string
|
|
|
+ Endpoint string
|
|
|
+ Username string
|
|
|
+ Password string
|
|
|
+ GjsonDefaultPath string
|
|
|
+ GjsonConnectionsPath string
|
|
|
|
|
|
}
|
|
|
class Core << (S,Aquamarine) >> {
|
|
|
- database database.Database
|
|
|
- pndc pndStore
|
|
|
- sbic sbiStore
|
|
|
- httpServer *http.Server
|
|
|
- stopChan <font color=blue>chan</font> os.Signal
|
|
|
|
|
|
}
|
|
|
class Device << (S,Aquamarine) >> {
|
|
|
+ UUID uuid.UUID
|
|
|
+ SBI SouthboundInterface
|
|
|
+ Transport Transport
|
|
|
|
|
|
+ ID() uuid.UUID
|
|
|
|
|
|
}
|
|
|
class ErrAlreadyExists << (S,Aquamarine) >> {
|
|
|
- item <font color=blue>interface</font>{}
|
|
|
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrInvalidParameters << (S,Aquamarine) >> {
|
|
|
- f <font color=blue>interface</font>{}
|
|
|
- r <font color=blue>interface</font>{}
|
|
|
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrInvalidTransportOptions << (S,Aquamarine) >> {
|
|
|
- t <font color=blue>interface</font>{}
|
|
|
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrInvalidTypeAssertion << (S,Aquamarine) >> {
|
|
|
- v <font color=blue>interface</font>{}
|
|
|
- t <font color=blue>interface</font>{}
|
|
|
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrNil << (S,Aquamarine) >> {
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrNilClient << (S,Aquamarine) >> {
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrNotFound << (S,Aquamarine) >> {
|
|
|
- id <font color=blue>interface</font>{}
|
|
|
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrNotYetImplemented << (S,Aquamarine) >> {
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class ErrUnsupportedPath << (S,Aquamarine) >> {
|
|
|
- p <font color=blue>interface</font>{}
|
|
|
|
|
|
+ Error() string
|
|
|
|
|
|
}
|
|
|
class Gnmi << (S,Aquamarine) >> {
|
|
|
- client gnmi.GNMIClient
|
|
|
|
|
|
+ SetNode <font color=blue>func</font>(*yang.Entry, <font color=blue>interface</font>{}, *gnmi.Path, <font color=blue>interface</font>{}, ...ytypes.SetNodeOpt) error
|
|
|
+ RespChan <font color=blue>chan</font> *gnmi.SubscribeResponse
|
|
|
+ Unmarshal <font color=blue>func</font>([]byte, []string, <font color=blue>interface</font>{}, ...ytypes.UnmarshalOpt) error
|
|
|
+ Options *GnmiTransportOptions
|
|
|
|
|
|
- get(ctx context.Context, paths [][]string, origin string) (<font color=blue>interface</font>{}, error)
|
|
|
- getWithRequest(ctx context.Context, req *gnmi.GetRequest) (<font color=blue>interface</font>{}, error)
|
|
|
- set(ctx context.Context, setOps []*gnmi.Operation, exts ...*gnmi_ext.Extension) (*gnmi.SetResponse, error)
|
|
|
- subscribe(ctx context.Context) error
|
|
|
|
|
|
+ SetOptions(to TransportOptions)
|
|
|
+ GetOptions() <font color=blue>interface</font>{}
|
|
|
+ Get(ctx context.Context, params ...string) (<font color=blue>interface</font>{}, error)
|
|
|
+ Set(ctx context.Context, args ...<font color=blue>interface</font>{}) (<font color=blue>interface</font>{}, error)
|
|
|
+ Subscribe(ctx context.Context, params ...string) error
|
|
|
+ Type() string
|
|
|
+ ProcessResponse(resp <font color=blue>interface</font>{}, root <font color=blue>interface</font>{}, s *ytypes.Schema) error
|
|
|
+ Capabilities(ctx context.Context) (<font color=blue>interface</font>{}, error)
|
|
|
+ Close() error
|
|
|
|
|
|
}
|
|
|
class GnmiTransportOptions << (S,Aquamarine) >> {
|
|
|
+ SetNode <font color=blue>func</font>(*yang.Entry, <font color=blue>interface</font>{}, *gnmi.Path, <font color=blue>interface</font>{}, ...ytypes.SetNodeOpt) error
|
|
|
+ Unmarshal <font color=blue>func</font>([]byte, []string, <font color=blue>interface</font>{}, ...ytypes.UnmarshalOpt) error
|
|
|
+ RespChan <font color=blue>chan</font> *gnmi.SubscribeResponse
|
|
|
|
|
|
+ GetAddress() string
|
|
|
+ GetUsername() string
|
|
|
+ GetPassword() string
|
|
|
+ IsTransportOption()
|
|
|
|
|
|
}
|
|
|
class OpenConfig << (S,Aquamarine) >> {
|
|
|
- schema *ytypes.Schema
|
|
|
- id uuid.UUID
|
|
|
|
|
|
+ SbiIdentifier() string
|
|
|
+ Schema() *ytypes.Schema
|
|
|
+ SetNode() <font color=blue>func</font>(*yang.Entry, <font color=blue>interface</font>{}, *gnmi.Path, <font color=blue>interface</font>{}, ...ytypes.SetNodeOpt) error
|
|
|
+ Unmarshal() <font color=blue>func</font>([]byte, []string, <font color=blue>interface</font>{}, ...ytypes.UnmarshalOpt) error
|
|
|
+ ID() uuid.UUID
|
|
|
|
|
|
}
|
|
|
interface PrincipalNetworkDomain {
|
|
|
+ Destroy() error
|
|
|
+ AddSbi( <font color=blue>interface</font>{}) error
|
|
|
+ RemoveSbi( uuid.UUID) error
|
|
|
+ AddDevice( <font color=blue>interface</font>{}) error
|
|
|
+ RemoveDevice( uuid.UUID) error
|
|
|
+ Request( uuid.UUID, string) error
|
|
|
+ RequestAll( string) error
|
|
|
+ GetName() string
|
|
|
+ GetDescription() string
|
|
|
+ MarshalDevice( uuid.UUID) (string, error)
|
|
|
+ ContainsDevice( uuid.UUID) bool
|
|
|
+ GetSBIs() <font color=blue>interface</font>{}
|
|
|
+ ID() uuid.UUID
|
|
|
|
|
|
}
|
|
|
class Restconf << (S,Aquamarine) >> {
|
|
|
+ Get(ctx context.Context, params ...string) (<font color=blue>interface</font>{}, error)
|
|
|
+ Set(ctx context.Context, params ...string) (<font color=blue>interface</font>{}, error)
|
|
|
+ Subscribe(ctx context.Context, params ...string) error
|
|
|
+ Type() string
|
|
|
+ ProcessResponse(resp <font color=blue>interface</font>{}, root <font color=blue>interface</font>{}, models *ytypes.Schema) error
|
|
|
|
|
|
}
|
|
|
interface SouthboundInterface {
|
|
|
+ SbiIdentifier() string
|
|
|
+ SetNode() <font color=blue>func</font>(*yang.Entry, <font color=blue>interface</font>{}, *gnmi.Path, <font color=blue>interface</font>{}, ...ytypes.SetNodeOpt) error
|
|
|
+ Schema() *ytypes.Schema
|
|
|
+ ID() uuid.UUID
|
|
|
|
|
|
}
|
|
|
interface Storable {
|
|
|
+ ID() uuid.UUID
|
|
|
|
|
|
}
|
|
|
class Tapi << (S,Aquamarine) >> {
|
|
|
}
|
|
|
interface Transport {
|
|
|
+ Get(ctx context.Context, params ...string) (<font color=blue>interface</font>{}, error)
|
|
|
+ Set(ctx context.Context, params ...<font color=blue>interface</font>{}) (<font color=blue>interface</font>{}, error)
|
|
|
+ Subscribe(ctx context.Context, params ...string) error
|
|
|
+ Type() string
|
|
|
+ GetOptions() <font color=blue>interface</font>{}
|
|
|
+ ProcessResponse(resp <font color=blue>interface</font>{}, root <font color=blue>interface</font>{}, models *ytypes.Schema) error
|
|
|
|
|
|
}
|
|
|
interface TransportOptions {
|
|
|
+ GetAddress() string
|
|
|
+ GetUsername() string
|
|
|
+ GetPassword() string
|
|
|
+ IsTransportOption()
|
|
|
|
|
|
}
|
|
|
class YANGConsumer << (S,Aquamarine) >> {
|
|
|
+ Data *bytes.Buffer
|
|
|
|
|
|
+ Consume(reader io.Reader, _ <font color=blue>interface</font>{}) error
|
|
|
|
|
|
}
|
|
|
class deviceStore << (S,Aquamarine) >> {
|
|
|
- get(id uuid.UUID) (*Device, error)
|
|
|
|
|
|
}
|
|
|
class nucleus.CtxKeyType << (T, #FF7700) >> {
|
|
|
}
|
|
|
class nucleus.store << (T, #FF7700) >> {
|
|
|
}
|
|
|
class pndImplementation << (S,Aquamarine) >> {
|
|
|
- name string
|
|
|
- description string
|
|
|
- sbic sbiStore
|
|
|
- devices deviceStore
|
|
|
- id uuid.UUID
|
|
|
|
|
|
- addSbi(sbi SouthboundInterface) error
|
|
|
- removeSbi(id uuid.UUID) error
|
|
|
- addDevice(device *Device) error
|
|
|
- getDevice(id uuid.UUID) (*Device, error)
|
|
|
- removeDevice(id uuid.UUID) error
|
|
|
|
|
|
+ ID() uuid.UUID
|
|
|
+ GetName() string
|
|
|
+ ContainsDevice(id uuid.UUID) bool
|
|
|
+ GetDescription() string
|
|
|
+ GetSBIs() <font color=blue>interface</font>{}
|
|
|
+ Destroy() error
|
|
|
+ AddSbi(sbi <font color=blue>interface</font>{}) error
|
|
|
+ RemoveSbi(id uuid.UUID) error
|
|
|
+ AddDevice(device <font color=blue>interface</font>{}) error
|
|
|
+ RemoveDevice(uuid uuid.UUID) error
|
|
|
+ MarshalDevice(uuid uuid.UUID) (string, error)
|
|
|
+ Request(uuid uuid.UUID, path string) error
|
|
|
+ RequestAll(path string) error
|
|
|
+ Set(uuid uuid.UUID, path string, value string) (<font color=blue>interface</font>{}, error)
|
|
|
|
|
|
}
|
|
|
class pndStore << (S,Aquamarine) >> {
|
|
|
- get(id uuid.UUID) (PrincipalNetworkDomain, error)
|
|
|
|
|
|
}
|
|
|
class sbiStore << (S,Aquamarine) >> {
|
|
|
- get(id uuid.UUID) (SouthboundInterface, error)
|
|
|
|
|
|
}
|
|
|
class store << (S,Aquamarine) >> {
|
|
|
- exists(id uuid.UUID) bool
|
|
|
- add(item Storable) error
|
|
|
- get(id uuid.UUID) (Storable, error)
|
|
|
- delete(id uuid.UUID) error
|
|
|
|
|
|
+ UUIDs() []uuid.UUID
|
|
|
|
|
|
}
|
|
|
class "<font color=blue>map</font>[uuid.UUID]Storable" as fontcolorbluemapfontuuidUUIDStorable {
|
|
|
'This class was created so that we can correctly have an alias pointing to this name. Since it contains dots that can break namespaces
|
|
|
}
|
|
|
}
|
|
|
"ygot.GoStruct" *-- "nucleus.Device"
|
|
|
"gnmi.Config" *-- "nucleus.GnmiTransportOptions"
|
|
|
"nucleus.store" *-- "nucleus.deviceStore"
|
|
|
"nucleus.store" *-- "nucleus.pndStore"
|
|
|
"nucleus.store" *-- "nucleus.sbiStore"
|
|
|
|
|
|
"nucleus.Storable" <|-- "nucleus.Device"
|
|
|
"nucleus.Transport" <|-- "nucleus.Gnmi"
|
|
|
"nucleus.TransportOptions" <|-- "nucleus.GnmiTransportOptions"
|
|
|
"nucleus.SouthboundInterface" <|-- "nucleus.OpenConfig"
|
|
|
"nucleus.Storable" <|-- "nucleus.OpenConfig"
|
|
|
"nucleus.PrincipalNetworkDomain" <|-- "nucleus.pndImplementation"
|
|
|
"nucleus.Storable" <|-- "nucleus.pndImplementation"
|
|
|
|
|
|
"__builtin__.string" #.. "nucleus.CtxKeyType"
|
|
|
"nucleus.fontcolorbluemapfontuuidUUIDStorable" #.. "nucleus.store"
|
|
|
@enduml
|
|
|
``` |