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:
[x] Make sure to run pre-commit before committing changes
[x] Make sure all checks have passed
[x] PR description is clear and comprehensive
[x] Mentioned the issue that this PR solves (if applicable)
Pull Request summary:
Support device config items for 20.13
Description of changes:
/v1/feature-profile/sdwan/cli/full-config
/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:
Checklist: