add Target field to SubscriptionConfig, use CreatePrefix in CreateSubscribeRequest
@@ -15,6 +15,7 @@ type SubscriptionConfig struct {
Name string `mapstructure:"name,omitempty"`
Models []string `mapstructure:"models,omitempty"`
Prefix string `mapstructure:"prefix,omitempty"`
+ Target string `mapstructure:"target,omitempty"`
Paths []string `mapstructure:"paths,omitempty"`
Mode string `mapstructure:"mode,omitempty"`
StreamMode string `mapstructure:"stream-mode,omitempty"`
@@ -62,7 +63,7 @@ func (sc *SubscriptionConfig) CreateSubscribeRequest() (*gnmi.SubscribeRequest,
if err := sc.setDefaults(); err != nil {
return nil, err
}
- gnmiPrefix, err := xpath.ToGNMIPath(sc.Prefix)
+ gnmiPrefix, err := CreatePrefix(sc.Prefix, sc.Target)
if err != nil {
return nil, fmt.Errorf("prefix parse error: %v", err)
}
