Skip to content

Commit

Permalink
updating nested param names
Browse files Browse the repository at this point in the history
  • Loading branch information
shinmog committed Feb 22, 2024
1 parent c91a2ac commit c6c9011
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions objects/address/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ func (o Location) Xpath(vn version.Number, name string) ([]string, error) {
if o.Vsys.NgfwDevice == "" {
return nil, fmt.Errorf("NgfwDevice is unspecified")
}
if o.Vsys.Vsys == "" {
return nil, fmt.Errorf("Vsys is unspecified")
if o.Vsys.Name == "" {
return nil, fmt.Errorf("Name is unspecified")
}
ans = []string{
"config",
"devices",
util.AsEntryXpath([]string{o.Vsys.NgfwDevice}),
"vsys",
util.AsEntryXpath([]string{o.Vsys.Vsys}),
util.AsEntryXpath([]string{o.Vsys.Name}),
}
case o.DeviceGroup != nil:
if o.DeviceGroup.PanoramaDevice == "" {
return nil, fmt.Errorf("PanoramaDevice is unspecified")
}
if o.DeviceGroup.DeviceGroup == "" {
return nil, fmt.Errorf("DeviceGroup is unspecified")
if o.DeviceGroup.Name == "" {
return nil, fmt.Errorf("Name is unspecified")
}
ans = []string{
"config",
"devices",
util.AsEntryXpath([]string{o.DeviceGroup.PanoramaDevice}),
"device-group",
util.AsEntryXpath([]string{o.DeviceGroup.DeviceGroup}),
util.AsEntryXpath([]string{o.DeviceGroup.Name}),
}
case o.FromPanorama:
ans = []string{"config", "panorama"}
Expand All @@ -66,10 +66,10 @@ func (o Location) Xpath(vn version.Number, name string) ([]string, error) {

type VsysLocation struct {
NgfwDevice string
Vsys string
Name string
}

type DeviceGroupLocation struct {
PanoramaDevice string
DeviceGroup string
Name string
}

0 comments on commit c6c9011

Please sign in to comment.