Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

dev: support device config items for 20.13 #841

Merged
merged 20 commits into from
Oct 27, 2024
Merged

Conversation

sbasan
Copy link
Contributor

@sbasan sbasan commented Oct 15, 2024

Pull Request summary:

Support device config items for 20.13

Description of changes:

  1. CLI Config Group
    • /v1/feature-profile/sdwan/cli/full-config
  2. Unified Communications
    • /v1/feature-profile/sdwan/uc-voice/dsp-farm
    • /v1/feature-profile/sdwan/uc-voice/media-profile
    • /v1/feature-profile/sdwan/uc-voice/trunk-group
    • /template/policy/list/faxprotocol
    • /template/policy/list/mediaprofile
    • /template/policy/list/modempassthrough
    • /template/policy/list/supervisorydisc
    • /template/policy/list/translationprofile
    • /template/policy/list/translationrules
    • /template/policy/list/trunkgroup
    • /template/policy/definition/dialpeer
    • /template/policy/definition/fxsport
    • /template/policy/definition/fxoport
    • /template/policy/definition/fxsdidport
    • /template/policy/definition/priisdnport
    • /template/policy/definition/srstphoneprofile
    • /template/policy/voice

Usage example:

from catalystwan.models.policy.definition.dial_peer import DialPeerPolicy
from catalystwan.models.policy.definition.fxo_port import FxoPortPolicy
from catalystwan.models.policy.definition.fxs_port import FxsPortPolicy
from catalystwan.models.policy.definition.fxs_did_port import FxsDidPortPolicy
from catalystwan.models.policy.definition.pri_isdn_port import PriIsdnPortPolicy
from catalystwan.models.policy.definition.srst_phone_profile import SrstPhoneProfilePolicy
from catalystwan.models.policy.list.fax_protocol import FaxProtocolList
from catalystwan.models.policy.list.media_profile import MediaProfileList
from catalystwan.models.policy.list.modem_pass_through import ModemPassThroughList
from catalystwan.models.policy.list.supervisory_disconnect import SupervisoryDisconnectList
from catalystwan.models.policy.list.translation_profile import TranslationProfileList
from catalystwan.models.policy.list.translation_rules import TranslationRulesList
from catalystwan.models.policy.list.trunkgroup import TrunkGroupList
from catalystwan.session import create_manager_session

with create_manager_session(**login) as session:
    lapi = session.api.policy.lists
    dapi = session.api.policy.definitions
    vapi = session.api.policy.voice
    # get lists
    la = lapi.get_all()
    fp = lapi.get(FaxProtocolList)
    mp = lapi.get(MediaProfileList)
    mpt = lapi.get(ModemPassThroughList)
    sd = lapi.get(SupervisoryDisconnectList)
    tg = lapi.get(TrunkGroupList)
    tp = lapi.get(TranslationProfileList)
    tr = lapi.get(TranslationRulesList)
    # get definitions
    da = dapi.get_all()
    fxo = [dapi.get(FxoPortPolicy, i.definition_id) for i in dapi.get(FxoPortPolicy)]
    fxs = [dapi.get(FxsPortPolicy, i.definition_id) for i in dapi.get(FxsPortPolicy)]
    fxsd = [dapi.get(FxsDidPortPolicy, i.definition_id) for i in dapi.get(FxsDidPortPolicy)]
    dp = [dapi.get(DialPeerPolicy, i.definition_id) for i in dapi.get(DialPeerPolicy)]
    pi = [dapi.get(PriIsdnPortPolicy, i.definition_id) for i in dapi.get(PriIsdnPortPolicy)]
    sp = [dapi.get(SrstPhoneProfilePolicy, i.definition_id) for i in dapi.get(SrstPhoneProfilePolicy)]
    # voice api
    va = vapi.get()
    vp = [vapi.get(i.policy_id) for i in va]

Checklist:

  • Make sure to run pre-commit before committing changes
  • Make sure all checks have passed
  • PR description is clear and comprehensive
  • Mentioned the issue that this PR solves (if applicable)
  • Make sure you test the changes

@sbasan sbasan changed the base branch from main to dev October 15, 2024 15:19
@sbasan sbasan marked this pull request as ready for review October 27, 2024 13:17
@sbasan sbasan requested a review from jpkrajewski October 27, 2024 13:17
def preview_policy_definition_by_id(self, id: UUID) -> PolicyDefinitionPreview:
...

def save_policy_definition_in_bulk(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to leave some route handling?

  • save_policy_definition_in_bulk,
  • edit_multiple_policy_definition,
  • save_policy_definition_in_bulk
  • ect..

Copy link
Contributor Author

@sbasan sbasan Oct 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, these are common method found in apidocs for all /template/policy/definition/...
Never implemented/tested in SDK though.

@jpkrajewski jpkrajewski merged commit becd81a into dev Oct 27, 2024
11 checks passed
@jpkrajewski jpkrajewski deleted the sbasan/device-config-20-13 branch October 27, 2024 19:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants