cancel
Showing results for 
Search instead for 
Did you mean: 
hatonis
Level 7

[Web Gateway] REST API for rules and rulesets

Jump to solution

Hello,

I am using the REST API of Web Gateway. I'm able to get all the rulesets with the following URL : https://XXXXXXXX/Konfigurator/REST/rulesets

Now, I'm trying to have the details of a ruleset but I can't get them with the following URL : https://XXXXXXXX/Konfigurator/REST/rulesets/rulegroups/$idRuleset

Here is an example of the command I'm using : curl -k -X GET -H "Cookie: JSESSIONID=FC5E77B855B19FAA38DE46AAA522ABD2" "https://XXXXXXXX/Konfigurator/REST/rulesets/rulegroups/$idRuleset"

For this query, I get the following response : Method Not Allowed.

I tried all methods but I still have the same answer.

Can you please tell me how to get the details of a ruleset? Or, at least, is it possible to get them with the REST API? If not possible, is it possible to have the rule attached to a specific list (ex: WhiteLists, BlackLists etc...)?

Thanks

0 Kudos
1 Solution

Accepted Solutions
McAfee Employee

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

Yes indeed, use POST.

I asked if you had a SR so I could send you the Beta REST API guide...

Best Regards,

Jon

0 Kudos
6 Replies
McAfee Employee

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

Hi hatonis!

To download the ruleset you must add "export" to the path:

/rulesets/rulegroups/$id/export

There is no GET allowed at that level, only deletes.

Did you have a service request open at all?

Best Regards,

Jon

0 Kudos
hatonis
Level 7

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

Hello,

Thank you for the answer. But, I'm still having the same answer : Method Not Allowed.

Is the following curl command correct for that : curl -k -X GET -H "Cookie: JSESSIONID=D7F5A2A2AA836A25DFFADB8A4EE01E18" "https://XXXXXX/Konfigurator/REST/rulesets/rulegroups/$id/export"


Can you give me an example of a correct call please?

No, I don't have a service request opened.

Regards

0 Kudos
eelsasser
Level 15

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

use the POST method:

curl -i -b cookies.txt -X POST "$REST/rulesets/rulegroups/98676/export"

0 Kudos
McAfee Employee

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

Yes indeed, use POST.

I asked if you had a SR so I could send you the Beta REST API guide...

Best Regards,

Jon

0 Kudos
feickholt
Level 10

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

I'm interested in the Beta REST API guide also :-)

0 Kudos
hatonis
Level 7

Re: [Web Gateway] REST API for rules and rulesets

Jump to solution

Thank you very much for your help Jon Scholten and eelsasser. It's working now.

We will open a Service Request from another account.

Thanks again.

0 Kudos