Skip to content

Commit

Permalink
Merge pull request #391 from swaschkut/developer
Browse files Browse the repository at this point in the history
UTIL pan-os-php type=device | introduce PAN-OS Panorama API call for actions=zoneprotectionprofile-create-bp
  • Loading branch information
swaschkut authored Jan 11, 2022
2 parents 6a8d8cc + 3e273ce commit 67777fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ UTILS:
* UTIL pan-os-php type=device | introduce PAN-OS API. mode for actions=zoneprotectionprofile-create-bp / logforwardingprofile-create-bp
* UTIL pan-os-php type=device | actions=securityprofile-create-alert-only introduce PAN-OS API method for FWs
* UTIL pan-os-php type=device | introduce PAN-OS API call for Panorama for actions=cleanuprule-create-bp / logforwardingprofile-create-bp / securityprofile-create-alert-only
* UTIL pan-os-php type=device | introduce PAN-OS Panorama API call for actions=zoneprotectionprofile-create-bp

BUGFIX:
* update installer scripts / issues with git-php not available
Expand Down
23 changes: 4 additions & 19 deletions utils/common/actions-device.php
Original file line number Diff line number Diff line change
Expand Up @@ -1612,21 +1612,6 @@
'name' => 'zoneprotectionprofile-create-bp',
'GlobalInitFunction' => function (DeviceCallContext $context) {
$context->first = true;

if( $context->isAPI && $context->subSystem->isPanorama() )
derr( "API mode not implemented yet for Panorama" );

if( $context->subSystem->isPanorama() )
{
/*
$countDG = count( $context->subSystem->getDeviceGroups() );
if( $countDG == 0 )
{
#$dg = $context->subSystem->createDeviceGroup( "alert-only" );
derr( "NO DG available; please run 'pa_device-edit in=InputConfig.xml out=OutputConfig.xml actions=devicegroup-create:DG-NAME' first", null, false );
}
*/
}
},
'MainFunction' => function (DeviceCallContext $context)
{
Expand Down Expand Up @@ -1718,7 +1703,7 @@
$xmlRoot = $sharedStore->deviceConfiguration->network->xmlroot;
if( $xmlRoot === null )
{
$xmlRoot = DH::findFirstElementOrCreate('device', $sharedStore->deviceConfiguration->xmlroot);
$xmlRoot = DH::findFirstElementOrCreate('devices', $sharedStore->deviceConfiguration->xmlroot);

#$xmlRoot = DH::findFirstElementByNameAttrOrCreate( 'entry', 'localhost.localdomain', $xmlRoot, $sharedStore->deviceConfiguration->xmlroot->ownerDocument);
$xmlRoot = DH::findFirstElementOrCreate('entry', $xmlRoot);
Expand All @@ -1731,7 +1716,7 @@
$xmlRoot = $sharedStore->owner->network->xmlroot;
if( $xmlRoot === null )
{
$xmlRoot = DH::findFirstElementOrCreate('device', $sharedStore->owner->xmlroot);
$xmlRoot = DH::findFirstElementOrCreate('devices', $sharedStore->owner->xmlroot);

#$xmlRoot = DH::findFirstElementByNameAttrOrCreate( 'entry', 'localhost.localdomain', $xmlRoot, $sharedStore->owner->xmlroot->ownerDocument);
$xmlRoot = DH::findFirstElementOrCreate('entry', $xmlRoot);
Expand Down Expand Up @@ -1774,8 +1759,8 @@
else
mwarning( "ZoneProtectionProfile 'Recommended_Zone_Protection' already available. BestPractise ZoneProtectionProfile 'Recommended_Zone_Protection' not created", null, FALSE );


$context->first = false;
//create for all VSYS and all templates
#$context->first = false;
}
}
}
Expand Down

0 comments on commit 67777fa

Please sign in to comment.