cancel
Showing results for 
Search instead for 
Did you mean: 
Post a Question

Add targets to a policy using cli in r77.30

Hello,

Im working in a script and I need to add targets to a policy package using the cli in r77.30, so r80 api is not an option. 

Is this possible?

Thanks in advance!

0 Kudos
6 Replies
Admin
Admin

Re: Add targets to a policy using cli in r77.30

Have never seen anyone do it myself--will have to check with R&D to see if it's possible.

Is there a particular reason you can't upgrade to R80.x?

0 Kudos

Re: Add targets to a policy using cli in r77.30

Hi Marcos,

I don't know a procedure on R77.30 version, but on R80.x version you can perform it using mgmt_cli, using this command:

Example:

set access-rule layer "Network" rule-number 1 install-on.add Corporate-GW

Regards,

Alisson Lima

0 Kudos
Admin
Admin

Re: Add targets to a policy using cli in r77.30

He's looking for the policy installation targets for the Policy Package, which is different from setting the install-on for a specific rule.

0 Kudos

Re: Add targets to a policy using cli in r77.30

Hi,

Thank you for your answers, yes, I need to do it in r77.30 so I can't use the r80 api. Due of the requeriments of the enviroment of a migration I need to do it previously to upgrade r.80.10.

As I have to do it in with a lot of policy targets I would like to write a script to automatize this step and other ones that I need to do. I can get the policy targets to get the "export" info:

cpmiquerybin attr "" policies_collections "name='Standard'" -a __name__,installable_targets

But now I'm looking to assign targets to a policy package.

BR,

Marcos

0 Kudos
Employee
Employee

Re: Add targets to a policy using cli in r77.30

Hi Marcos,

Assuming the policy package name is 'Standard' and you want to add 'gw1' as target to entire policy, you can do it in following way:

dbedit> addelement policies_collections Standard installable_targets network_objects:gw1

dbedit> update_all
policies_collections::Standard Updated Successfully

BR,

Ofer

Re: Add targets to a policy using cli in r77.30

Checked in lab, it works, thank you very much to all!

BR,

Marcos