Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete non-empty action-set; create it again - the GUI shows it empty; add the same action: although GUI shows action-set empty, trying to add the action to the action-set from API fails with message: action already exists on action-set #43

Open
andreireiand opened this issue Jan 13, 2020 · 0 comments

Comments

@andreireiand
Copy link

andreireiand commented Jan 13, 2020

`
mx.logout()

del mx

if 'mx' not in locals() or not mx.IsAuthenticated:
mx = impv.MxConnection(url, Port=443, Username=user, Password=passw)

mx.get_action_set(Name=gwActionSetName)
Out[311]: <imperva_sdk 'ActionSet' Object - 'GW-Sec-Events'>

mx.get_action(Name=gwActionName, ActionSet=gwActionSetName)

mx.create_action(Name=gwActionName,ActionType='GWSyslog',Protocol=gwSyslogProtocol,Port=gwSysLogSrvPort,Host=gwSysLogSrvIP,ActionSet=gwActionSetName,SyslogLogLevel='INFO',SyslogFacility='USER',Message=sysLogMessage,ActionInterface=actionInterface)
Out[313]: <imperva_sdk 'Action' Object - 'GWSyslog'>

mx.delete_action(Name=gwActionName,ActionSet=gwActionSetName)
Out[314]: True

mx.create_action(Name=gwActionName,ActionType='GWSyslog',Protocol=gwSyslogProtocol,Port=gwSysLogSrvPort,Host=gwSysLogSrvIP,ActionSet=gwActionSetName,SyslogLogLevel='INFO',SyslogFacility='USER',Message=sysLogMessage,ActionInterface=actionInterface)
Out[315]: <imperva_sdk 'Action' Object - 'GWSyslog'>

mx.delete_action_set(Name=gwActionSetName)
Out[316]: True

mx.create_action_set(Name=gwActionSetName, AsType='security',update=True)
Out[317]: <imperva_sdk 'ActionSet' Object - 'GW-Sec-Events'>

mx.create_action(Name=gwActionName,ActionType='GWSyslog',Protocol=gwSyslogProtocol,Port=gwSysLogSrvPort,Host=gwSysLogSrvIP,ActionSet=gwActionSetName,SyslogLogLevel='INFO',SyslogFacility='USER',Message=sysLogMessage,ActionInterface=actionInterface)
Traceback (most recent call last):

File "", line 3, in
mx.create_action(Name=gwActionName,ActionType='GWSyslog',Protocol=gwSyslogProtocol,Port=gwSysLogSrvPort,Host=gwSysLogSrvIP,ActionSet=gwActionSetName,SyslogLogLevel='INFO',SyslogFacility='USER',Message=sysLogMessage,ActionInterface=actionInterface)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 879, in create_action
return Action._create_action(connection=self, Name=Name, ActionSet=ActionSet, ActionType=ActionType, Protocol=Protocol, SyslogFacility=SyslogFacility, Host=Host, SyslogLogLevel=SyslogLogLevel, SecondaryPort=SecondaryPort, ActionInterface=ActionInterface, SecondaryHost=SecondaryHost, Message=Message, Port=Port, update=update)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/Action.py", line 194, in _create_action
raise MxException("Action '%s' already exists" % Name)

MxException: Action 'GWSyslog' already exists

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant