diff --git a/Changes b/Changes index 294d02a5..9aa6ccf1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ {{$NEXT}} + - Fixed URL for committing changes to device of type PAN-OS. + Previously the URL looked like + https://address/api/?key=xxx&https://address/api/?key=xxx&type=commit + 3.034 2024-10-04 10:26:33+02:00 Europe/Berlin - For device of type ASA that has interface not known by Netspoc, diff --git a/go/pkg/panos/device.go b/go/pkg/panos/device.go index 7c44b38d..d62dacae 100644 --- a/go/pkg/panos/device.go +++ b/go/pkg/panos/device.go @@ -199,8 +199,7 @@ func (s *State) ApplyCommands(logFH *os.File) error { return parseResponse(body) } commit := func() error { - cmd := s.urlPrefix + - "type=commit&action=partial&cmd=" + + cmd := "type=commit&action=partial&cmd=" + s.devUser + "" msg, data, err := doCmd(cmd) if err != nil { @@ -227,8 +226,7 @@ func (s *State) ApplyCommands(logFH *os.File) error { if !simulated { time.Sleep(10 * time.Second) } - cmd := s.urlPrefix + - "type=op&cmd=" + id + "" + cmd := "type=op&cmd=" + id + "" _, data, err := doCmd(cmd) if err != nil { return err diff --git a/go/testdata/pan-os_simul.t b/go/testdata/pan-os_simul.t index 9efa9169..57104533 100644 --- a/go/testdata/pan-os_simul.t +++ b/go/testdata/pan-os_simul.t @@ -225,10 +225,10 @@ TESTSERVER/api/?key=xxx&action=set&type=config&xpath=/config/devices/entry[@name TESTSERVER/api/?key=xxx&action=set&type=config&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='r1']&element=allowz1z2anyanytcp 80anyinterzone -TESTSERVER/api/?key=xxx&TESTSERVER/api/?key=xxx&type=commit&action=partial&cmd=admin +TESTSERVER/api/?key=xxx&type=commit&action=partial&cmd=admin 6 -TESTSERVER/api/?key=xxx&TESTSERVER/api/?key=xxx&type=op&cmd=6 +TESTSERVER/api/?key=xxx&type=op&cmd=6 OK