Hi David,
I tried using the download manager REST API after a long time to create a new version and I get this error:
Exception: (500, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\n"http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n<title>JBoss Community</title>\n<style>\nbody
{\n\tmargin: 230px 0px 0px 0px;\n\ttext-align: center;\n font-family: \'Lucida Grande\', Geneva, Verdana, Arial, sans-serif;\n\tfont-size:15px;\n background: #e6e7e8 url(http://design.jboss.org/jbossorg/code/jbossorg_3_0/images/errorbkg.png) no-repeat top center;\n}\n.wrappper
{\n\twidth:600px;\n\tmargin: auto;\n\ttext-align: left;\n\tline-height: 20px;\n}\nh2
{\ncolor:#424242;\ndisplay:block;\nfont-family:Myriad Pro,Helvetica;\nfont-size:25px;\nfont-weight:normal;\nletter-spacing:-0.03em;\nmargin-top:5px;\n}\n\n.message
{\n\ttext-align: left;\n\tpadding-left: 60px;\n\tpadding-right: 60px;\n\tpadding-top: 10px;\n}\n</style>\n</head>\n<body>\n<div class="wrappper" >\n <h2>Internal Server Error</h2>\n <p>We seem to having a problem and cannot handle you request at the moment.</p>\n <p>Please try again in a while.</p>\n</div>\n</body>\n</html>\n\n')
This is the script I used:
#!/usr/bin/python
import requests
import json
import os
DRC_ENTRY_URI="https://origin-developers.redhat.com/download-manager/rest/admin"
access="os.environ['USER'],os.environ['pass']"
s = requests.Session()
s.auth = ('cmarulas',os.environ['pass'])
with open ('version.json', 'r') as v:
version=json.load(v)
r = s.put(DRC_ENTRY_URI + '/products/' + str(version['productId'])
+ '/versions',
json=version, verify=False)
if r.status_code != 201:
raise Exception(r.status_code, r.content)
else:
print r.content