kevinsteves / pan-python

Multi-tool set for Palo Alto Networks PAN-OS, Panorama, WildFire and AutoFocus
Other
266 stars 102 forks source link

Rename service funcion #21

Closed enrutador closed 7 years ago

enrutador commented 7 years ago

Hi Kevin I have problems using the rename function. On the "Cli debug all" i can do the chance with this log

#rename shared service RULE to RULE-TEST

<request cmd="rename" obj="/config/shared/service/entry[@name='RULE']" newname="RULE-TEST" cookie="4371695717039205"></request>

<response status="success" code="20"><msg>command succeeded</msg></response>

But the command build does not work for me. How i can pass this new new ? Could you illustrate me with an example?

#panxapi.py  -h 10.0.0.1 -l admin:admin -j  --rename "/config/shared/service/entry[@name='RULE-TEST']" "/config/shared/service/entry[@name='RULE']"

Extra options after xpath: ["/config/shared/service/entry[@name='RULE']"]
rename: error [code="8"]: "Can rename only one obj at a time"
{
  "response": {
    "code": "8",
    "msg": {
      "line": "Can rename only one obj at a time"
    },
    "status": "error"
  }
}

As always thanks for your work¡¡¡¡

enrutador commented 7 years ago

Hi Kevin I found the solution:

 panxapi.py  -h 10.0.0.1 -l admin:admin -j  --rename --dst "RULE" 
 "/config/shared/service/entry[@name='newname']"

A lot of thanks