Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Non-standard kwargs in Engine.vpn.vpn_client #42

Description

@stdedos

On a "properly configured" engine with VPN and 'VPN Client'-attaching enabled,

Engine('Name').vpn.vpn_client.update(windows_update=False, antivirus=False)

fails:

  File ".py", line 56, in main
    Engine('Name').vpn.vpn_client.update(windows_update=False, antivirus=False)
  File "/home/sntentos/Documents/Forcepoint/PycharmProjects/createMLConfiguration/venv/lib/python3.5/site-packages/smc/base/model.py", line 460, in update
    result = request.update()
  File "/home/sntentos/Documents/Forcepoint/PycharmProjects/createMLConfiguration/venv/lib/python3.5/site-packages/smc/api/common.py", line 72, in update
    return self._make_request(method='PUT')
  File "/home/sntentos/Documents/Forcepoint/PycharmProjects/createMLConfiguration/venv/lib/python3.5/site-packages/smc/api/common.py", line 101, in _make_request
    raise err
smc.api.exceptions.UpdateElementFailed: Invalid JSON format: At line 1 and column 1674, windows_update is not recognized as JSON attribute.

Key is windows-update, but you cannot set that like update(windows_update=False, antivirus=False)

Can we implement fuzzy key match for [_-], do something else from here, or talk to the SMC API team?


Workaround:

    kwargs = {'windows-update': False, 'antivirus': False}
    Engine('Name').vpn.vpn_client.update(**kwargs)

Remember to update: https://smc-python.readthedocs.io/en/latest/pages/reference.html?highlight=vpn%20client%20antivirus#smc.core.engine.InternalGateway

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions