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

Add Rule By Section Title

Jump to solution

Im looking at add-access-rule and am a little confused on some of the documentation around position.

For position it states I can do an integer, string, or Object. Integer and string make sense as it provides examples but what is the format for Object?

Am I able to specify a section title and a position within the section?

What i'm used to:

{

  "layer" : "Network",

  "position" : "1",

  "name" : "my rule",

  "action" : "Accept",

  "source" : "User_Networks",

  "destination" : "Vendor_Networks",

  "service" : "https"

}

1 Solution

Accepted Solutions
Highlighted
Employee+
Employee+

Re: Add Rule By Section Title

Jump to solution

Hi Joshua,

Yes, you can specify the name of the rule or the section you want to add your rule relatively to. Relative position options they are: top, above, below, bottom.

Example:

{

  "position": {

    "bottom": "My section title or uid"

  }

}

Adding rule to a section specifying the number position withing the section is not supported for now.

PS Public documentation link https://sc1.checkpoint.com/documents/R80/APIs/index.html#web/add-access-rule

3 Replies
Highlighted
Employee+
Employee+

Re: Add Rule By Section Title

Jump to solution

Hi Joshua,

Yes, you can specify the name of the rule or the section you want to add your rule relatively to. Relative position options they are: top, above, below, bottom.

Example:

{

  "position": {

    "bottom": "My section title or uid"

  }

}

Adding rule to a section specifying the number position withing the section is not supported for now.

PS Public documentation link https://sc1.checkpoint.com/documents/R80/APIs/index.html#web/add-access-rule

Re: Add Rule By Section Title

Jump to solution

Hi Eugene,

Thanks for clarifying. I looked at the doc and that format was not very clear to me.

-Josh

0 Kudos

Re: Add Rule By Section Title

Jump to solution

By trial and error I have also figured out what is the syntax for the CLI:

mgmt add access-rule layer Network position.bottom "testsection 1"

Unfortunately the documentation lacks description how to work with lists and "sub-parameters" (like "position.bottom") in the CLI.

Edit:

Later I found that

position.bottom "testsection 1"

is just a systematic representation of this JSON code excerpt:

"position": {

    "bottom": "testsection 1"

}

This representation also handles more deeply nested structures and lists. See a useful example here: https://community.checkpoint.com/thread/4966#comment-5749

I think that this should be described in the API documentation.

0 Kudos