'Login to GoDocker and return the token
Create Login model schema of GoDocker and call the http_post_request method.'

def login(self, apikey, login, server, noCert=False):

    log.debug('LOGIN    TASK    TO    BE    EXECUTED    \n')
    log.debug(('GODOCKER    LOGIN:    ' + str(login)))
    data = json.dumps({'user': login, 'apikey': apikey})
    g_auth = Godocker(server, login, apikey, noCert)
    auth = g_auth.http_post_request('/api/1.0/authenticate', data, {'Content-type': 'application/json', 'Accept': 'application/json'})
    if (not auth):
        log.error('GoDocker    authentication    Error.')
    else:
        log.debug('GoDocker    authentication    successful.')
        token = auth.json()['token']
        g_auth.setToken(token)
    return g_auth
