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 /api/v1/callLegProfiles/74e593c5-0ab8-4b71-8d9e-0572a8c32311</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>