panxapi -C fails with error on PanOS 4.1

L1 Bithead

panxapi -C fails with error on PanOS 4.1

panxapi -C used to work for me. Now that I've upgraded to 4.1 I get

commit: File does not exist: Illegal value for parameter "action" [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show]. at /usr/lib/perl5/site_perl/5.8.8/PAN/XAPI.pm line 230

Can anyone point me to a solution?

Tags (2)
L4 Transporter

Re: panxapi -C fails with error on PanOS 4.1

which panxapi build  are you using ? I just did a small test and it looks fine in my environment.

ksomu@ksomu-VirtualBox:~/pan/PAN-perl-20111226/bin$ panxapi -l admin:admin -h 10.2.133.15 -CD
commit: success: Commit job enqueued with jobid 78

admin@PA-5060-1> show jobs id 78

Enqueued                     ID             Type    Status Result Completed
--------------------------------------------------------------------------
2012/01/17 15:27:35          78           Commit       FIN     OK 15:28:00

Configuration committed successfully

I am using the latest perl package built on dec 26th of 2011.  panos version is 4.1.1

thanks,
krishna Somu

L1 Bithead

Re: panxapi -C fails with error on PanOS 4.1

L2 Linker

Re: panxapi -C fails with error on PanOS 4.1

I'm using 4.1.3 and PAN-perl-20111226.tgz and getting a similar result...

/usr/local/bin/panxapi -h 192.168.x.x -K asdfasdfasdasdfasdasdf -CD

.

.

.

$VAR1 = {
  action => 'commit',
  type => 'config',
  key => 'asdfasdfasdfasdfasdfasdfasdf'
};

API response:
<response status = 'error' code = '400'><result><msg>Illegal value for parameter &quot;action&quot; [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show].</msg></result></response>$VAR1 = {
  status => 'error',
  result => {
    msg => 'Illegal value for parameter "action" [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show].'
  },
  code => '400'
};
commit: Illegal value for parameter "action" [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show]. status="error" code="400"

Can someone help?

L1 Bithead

Re: panxapi -C fails with error on PanOS 4.1

on 4.1.3 use: panxapi -C "<commit></commit>"

L2 Linker

Re: panxapi -C fails with error on PanOS 4.1

Thanks for the reply but I get the same error message...

/usr/local/bin/panxapi -h 192.168.x.x -K asdfasdfasdfasdfasdfasdfasdf -CD "<commit></commit>"

}, 'PAN::XAPI' );
$VAR1 = {
  action => 'commit',
  type => 'config',
  key => 'asdfasdasdfasdfasdfasdfasdf'
};
API response:
<response status = 'error' code = '400'><result><msg>Illegal value for parameter &quot;action&quot; [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show].</msg></result></response>$VAR1 = {
  status => 'error',
  result => {
    msg => 'Illegal value for parameter "action" [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show].'
  },
  code => '400'
};
commit: Illegal value for parameter "action" [commit]. Should be one of : [clone, complete, delete, edit, get, rename, set, show]. status="error" code="400"

L1 Bithead

Re: panxapi -C fails with error on PanOS 4.1

try panxapi -C "<commit></commit>" -D

I'm seeing:

API version: 2

$VAR1 = {

  cmd => '<commit></commit>',

  type => 'commit',  key => 'dsfdsaofofuofdlkfjdlfjds'

};

API response:<response status="success" code="19"><result><msg><line>Commit job enqueued with jobid 20</line></msg><job>20</job></result></response>Content-Type: application/xml

$VAR1 = {  status => 'success',  result => {    msg => {      line => 'Commit job enqueued with jobid 20'    },    job => '20'  },  code => '19'};commit: success: Commit job enqueued with jobid 20

When I tried your version I got:

panxapi -CD "<commit></commit>"

commit: Illegal value for parameter "cmd" . status="error" code="400"

L1 Bithead

Re: panxapi -C fails with error on PanOS 4.1

Your error messages sure look like you are still using PAN-perl-20110828 instead of PAN-perl-20111226. Is your perl path correct?

L2 Linker

Re: panxapi -C fails with error on PanOS 4.1

Thanks - you were right.  My test machine was using latest code, my production machine was one behind.  Sorry to take your time, but thanks for the clarification.

Include the -C "<commit></commit>" and it works.

L4 Transporter

Re: panxapi -C fails with error on PanOS 4.1

please create .panrc file and have your key/credentilas listed in that file.

for example

ksomu@ksomu-VirtualBox:~/pan/PAN-perl-20111226/bin$ cat ~/.panrc
username=admin
password=admin
api_username=admin
api_password=admin
hostname=10.2.133.15
export TEMPLATE_HOME=/home/ksomu/pan/PAN-perl-20111226/templates/

ksomu@ksomu-VirtualBox:~/pan/PAN-perl-20111226/bin$ panxapi  -C
commit: success: Commit job enqueued with jobid 5

ksomu@ksomu-VirtualBox:~/pan/PAN-perl-20111226/bin$ panxapi -Xrpo 'show jobs id "5"'
op: success

$VAR1 = {
  job => {
    warnings => {
      line => [
        'Interface ethernet1/14.10 has no zone configuration.',
        'Interface ethernet1/14.10 has no virtual-router configuration.'
      ]
    },
    progress => '16:13:45',
    status => 'FIN',
    details => {
      line => 'Configuration committed successfully'
    },
    stoppable => 'no',
    tenq => '2012/03/07 16:13:27',
    tfin => '16:13:45',
    id => '5',
    type => 'Commit',
    result => 'OK'
  }
};

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!