'.. http:put:: /channels/discovered
Create your own new channel. The passed mode and descriptions are optional.
Valid modes include: \'open\', \'semi-open\' or \'closed\'. By default, the mode of the new channel is \'closed\'.
**Example request**:
.. sourcecode:: none
curl -X PUT http://localhost:8085/channels/discovered
--data "name=fancy name&description=fancy description&mode=open"
**Example response**:
.. sourcecode:: javascript
"added": 23
:statuscode 500: if a channel with the specified name already exists.'

def render_PUT(self, request):

    parameters = http.parse_qs(request.content.read(), 1)
    if (('name' not in parameters) or (len(parameters['name']) == 0) or (len(parameters['name'][0]) == 0)):
        request.setResponseCode(http.BAD_REQUEST)
        return json.dumps({'error': 'channel    name    cannot    be    empty'})
    if (('description' not in parameters) or (len(parameters['description']) == 0)):
        description = u''
    else:
        description = unicode(parameters['description'][0], 'utf-8')
    if (('mode' not in parameters) or (len(parameters['mode']) == 0)):
        mode = u'closed'
    else:
        mode = unicode(parameters['mode'][0], 'utf-8')
    try:
        channel_id = self.session.create_channel(unicode(parameters['name'][0], 'utf-8'), description, mode)
    except DuplicateChannelNameError as ex:
        return BaseChannelsEndpoint.return_500(self, request, ex)
    return json.dumps({'added': channel_id})
