pyca/utils.py
def get_service(service_type):
    '''Get available service endpoints for a given service type from the
    Opencast ServiceRegistry.
    '''
    endpoint = '/services/available.json?serviceType=' + str(service_type)
    url = '%s%s' % (config()['server']['url'], endpoint)
    response = http_request(url).decode('utf-8')
    services = (json.loads(response).get('services') or {}).get('service', [])
    services = ensurelist(services)
    endpoints = [service['host'] + service['path'] for service in services
                 if service['online'] and service['active']]
    for endpoint in endpoints:
        logger.info(u'Endpoint for %s: %s', service_type, endpoint)
    return endpoints
def get_service(service_type):
    '''Get available service endpoints for a given service type from the
    Opencast ServiceRegistry.
    '''
    endpoint = '/services/available.json?serviceType=' + str(service_type)
    url = '%s%s' % (config()['server']['url'], endpoint)
    response = http_request(url).decode('utf-8')
    services = (json.loads(response).get('services') or {}).get('service', [])
    services = ensurelist(services)
    endpoints = [service['host'] + service['path'] for service in services
                 if service['online'] and service['active']]
    for endpoint in endpoints:
        logger.info(u'Endpoint for %s: %s', service_type, endpoint)
    return endpoints
def get_service ( service_type ) : endpoint = '/services/available.json?serviceType=' + str ( service_type ) url = '%s%s' % ( config ( ) [ 'server' ] [ 'url' ] , endpoint ) response = http_request ( url ) . decode ( 'utf-8' ) services = ( json . loads ( response ) . get ( 'services' ) or { } ) . get ( 'service' , [ ] ) services = ensurelist ( services ) endpoints = [ service [ 'host' ] + service [ 'path' ] for service in services if service [ 'online' ] and service [ 'active' ] ] for endpoint in endpoints : logger . info ( u'Endpoint for %s: %s' , service_type , endpoint ) return endpoints
Get available service endpoints for a given service type from the
    Opencast ServiceRegistry.
Get available service endpoints for a given service type from the Opencast ServiceRegistry .