Question 4 of 28 from exam 300-835-CLAUTO: Automating Cisco Collaboration Solutions

Question 4 of 28 from exam 300-835-CLAUTO: Automating Cisco Collaboration Solutions

Question

DRAG DROP - An administrator is creating a script using the Python xAPI over WebSockets (pyxows) library.

The goal of the script is to capture an event generated by a UI Extensions action button (former In-Room Control Panel)

When the action button is clicked, the script displays an alert that says that the button ID was clicked.

Drag and drop the code snippets into the locations to complete the script: Select and Place:

Answer Area

import xows
import asyncio

async def start(ip, usr, pw):

async with xows.XoWSClient (ip,username-usr, password=pw) as client:
async def callback(data,id_):

await client.wait_until_closed()
async def task():

await client.xCommand([ ‘UserInterface’ , ‘Message’, ‘Alert’, ‘Display’], Title=panelid, Text= "Was clicked”)

panelid = data[ ‘Event’ ] [ ‘UserInterface’ ] [ ‘Extensions’ ] [ ‘Panel’ ] [ ‘Clicked’ ] [‘PanelId’]

await start(’10.10.10.1' ,/ admin’ ,/T357c45e’)

await client.subscribe([ ‘Event’ , ‘UserInterface’ , ‘Extensions’ , ‘Panel’ ,’Clicked’], callback, True)

‘asyneio. run (task())

Explanations

Answer Area

import xows
import asyncio

async def start(ip, usr, pw):

async with xows.XoWSClient (ip,username-usr, password=pw) as client:
async def callback(data,id_):

panelid = data[ ‘Event’ ] [ \UserInterface’ ] [ ‘Extensions’ ] [ ‘Panel’ ] [ ‘Clicked’ ] [‘PanelId’]

await client.xCommand([ ‘UserInterface’ , ‘Message’, ‘Alert’, ‘Display’], Title=panelid, Text= "Was clicked”)

await client.subscribe([ ‘Event’ , ‘UserInterface’ , ‘Extensions’ , ‘Panel’ ,/Clicked’], callback, True)

await client.wait_until_closed()
async def task():

await start(’10.10.10.1’ ,/ admin’ ,/T357c45e’)

await client.xCommand([ ‘UserInterface’ , ‘Message’, ‘Alert’, ‘Display’], Title=panelid, Text= "Was clicked”)

panelid = data[ ‘Event’ ] [ ‘UserInterface’ ] [ ‘Extensions’ ] [ ‘Panel’ ] [ ‘Clicked’ ] [‘PanelId’]

await start(’10.10.10.1' ,/ admin’ ,/T357c45e’)

await client.subscribe([ ‘Event’ , ‘UserInterface’ , ‘Extensions’ , ‘Panel’ ,’Clicked’], callback, True)

‘asyneio. run (task())