Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Trunk Status via Phyton

    Posted 19 hours ago

    I need check trunk state with 30 sec, if fail, shows a message on screen. Any suggestion?  Can I use python for it?


    #PlatformAPI

    ------------------------------
    Daniel Bernardi
    Network Designer Specialist-Cloud Applications
    ------------------------------


  • 2.  RE: Trunk Status via Phyton

    Posted 17 hours ago

    I've not done this specifically, but here are two Platform API endpoints that may be relevant:

    The first endpoint looks more useful, returning the properties below which you could derive the status from using the Python Platform API SDK.
    I'm not sure on the Python SDK call, specifically so created the pseudocode below:
    connected = trunk.connected_status.connected if trunk.connected_status else None
    
    if trunk.state != "active" or not connected or not trunk.in_service:
        print(
            f'[ALERT] Trunk "{trunk.name}" is DOWN: '
            f"state: {trunk.state}, "
            f"connected: {connected}, "
            f"inService: {trunk.in_service}"
        )



    ------------------------------
    Lucas Woodward
    Winner of Orchestrator of the Year, Developer (2025)

    LinkedIn - https://www.linkedin.com/in/lucas-woodward-the-dev
    Newsletter - https://makingchatbots.com
    ------------------------------