cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
974
Views
0
Helpful
0
Replies

Cisco Meeting Server and Python

PGE_JosephHiatt
Level 1
Level 1

I am trying to modify the entry/exit tone thresholds on Cisco Meeting Server.  I got the tones enabled and working using postman but I'm interested in making similar changes using python instead.  I was able to "GET" CMS status/info using python but cannot get "PUT" to work

.

-  -  - Code Derived from Code Generated by Python  -  -  -

import requests

 

def tonethreshold(joinThreshold, leaveThreshold):
    url = 'https://<servername:port>/api/v1/callLegProfiles/74e593c5-0ab8-4b71-8d9e-0572a8c32311'

 

    payload = 'joinToneParticipantThreshold='+joinThreshold+'&leaveToneParticipantThreshold='+leaveThreshold

 

    headers = {
        'Authorization': "<basic auth string>",
        'cache-control': "no-cache",
        'Postman-Token': "<postmanToken>"
    }

 

    response = requests.request("PUT", url, data=payload, headers=headers, verify='/scripts/python/certStore/ca-bundle.crt')

   

    print(response.text)

 

def main():
    joinThreshold = str(input('Conference participants to hear entry tone? (0 - 100; 0 = no tone): '))
    leaveThreshold = str(input('Conference participants to hear exit tone? (0 - 100; 0=no tone): '))
    tonethreshold(joinThreshold,leaveThreshold)

 

if __name__ == "__main__":
    main()

 

-  -  -  Error Output  -  -  -

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/api/v1/callLegProfiles/74e593c5-0ab8-4b71-8d9e-0572a8c32311">PUT&nbsp;/api/v1/callLegProfiles/74e593c5-0ab8-4b71-8d9e-0572a8c32311</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>

 

 

 

0 Replies 0
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: