function listDomains (request, response, appData)
{
    var domains = {'domains': []};
    var domainsURL = '/domains';
    var config = configUtils.getConfig();
    var isDomainListFromApiServer = config.getDomainsFromApiServer;
    if (null == isDomainListFromApiServer) {
        isDomainListFromApiServer = true;
    }
    if (('v2.0' == request.session.authApiVersion) ||
        (null == request.session.authApiVersion)) {
        domains.domains.push({uuid: defaultDomainId,
            fq_name: [defaultDomainName]});
        commonUtils.handleJSONResponse(null, response, domains);
        return;
    }
    if (true == isDomainListFromApiServer) {
        configServerUtils.getDomainsFromApiServer(appData, function(error, data) {
            commonUtils.handleJSONResponse(error, response, data);
        });
    } else {
        var domainObj =
            commonUtils.getValueByJsonPath(request,
                                           'session;last_token_used;project;domain',
                                           null, false);
        var domains = {};
        if ((null != domainObj) && (null != domainObj.id)) {
            if(domainObj.id === defaultDomainId) {
                domains =
                {   domains: [{
                        uuid: domainObj.id,
                        fq_name: [defaultDomainName]
                    }]
                }
            } else {
                domains =
                {   domains: [{
                        uuid: commonUtils.convertUUIDToString(domainObj.id),
                        fq_name: [domainObj.name]
                    }]
                }
            }
        }
        commonUtils.handleJSONResponse(null, response, domains);
    }
}
/**
 * @listDomains
 * public function
 * 1. URL /api/tenants/config/domains
 * 2. Gets list of domains for the user, domain support
 *    to be added
 * 3. Keystone doesn't support domains as of now so we
 *    pick up domain from api server
 */
@listDomains
public function
1. URL /api/tenants/config/domains
2. Gets list of domains for the user, domain support
to be added
3. Keystone doesn't support domains as of now so we
pick up domain from api server
@listDomains public function 1 . URL / api / tenants / config / domains 2 . Gets list of domains for the user domain support to be added 3 . Keystone doesn ' t support domains as of now so we pick up domain from api server
function listDomains (request, response, appData)
{
    var domains = {'domains': []};
    var domainsURL = '/domains';
    var config = configUtils.getConfig();
    var isDomainListFromApiServer = config.getDomainsFromApiServer;
    if (null == isDomainListFromApiServer) {
        isDomainListFromApiServer = true;
    }
    if (('v2.0' == request.session.authApiVersion) ||
        (null == request.session.authApiVersion)) {
        domains.domains.push({uuid: defaultDomainId,
            fq_name: [defaultDomainName]});
        commonUtils.handleJSONResponse(null, response, domains);
        return;
    }
    if (true == isDomainListFromApiServer) {
        configServerUtils.getDomainsFromApiServer(appData, function(error, data) {
            commonUtils.handleJSONResponse(error, response, data);
        });
    } else {
        var domainObj =
            commonUtils.getValueByJsonPath(request,
                                           'session;last_token_used;project;domain',
                                           null, false);
        var domains = {};
        if ((null != domainObj) && (null != domainObj.id)) {
            if(domainObj.id === defaultDomainId) {
                domains =
                {   domains: [{
                        uuid: domainObj.id,
                        fq_name: [defaultDomainName]
                    }]
                }
            } else {
                domains =
                {   domains: [{
                        uuid: commonUtils.convertUUIDToString(domainObj.id),
                        fq_name: [domainObj.name]
                    }]
                }
            }
        }
        commonUtils.handleJSONResponse(null, response, domains);
    }
}
function listDomains ( request , response , appData ) { var domains = { 'domains' : [ ] } ; var domainsURL = '/domains' ; var config = configUtils . getConfig ( ) ; var isDomainListFromApiServer = config . getDomainsFromApiServer ; if ( null == isDomainListFromApiServer ) { isDomainListFromApiServer = true ; } if ( ( 'v2.0' == request . session . authApiVersion ) || ( null == request . session . authApiVersion ) ) { domains . domains . push ( { uuid : defaultDomainId , fq_name : [ defaultDomainName ] } ) ; commonUtils . handleJSONResponse ( null , response , domains ) ; return ; } if ( true == isDomainListFromApiServer ) { configServerUtils . getDomainsFromApiServer ( appData , function ( error , data ) { commonUtils . handleJSONResponse ( error , response , data ) ; } ) ; } else { var domainObj = commonUtils . getValueByJsonPath ( request , 'session;last_token_used;project;domain' , null , false ) ; var domains = { } ; if ( ( null != domainObj ) && ( null != domainObj . id ) ) { if ( domainObj . id === defaultDomainId ) { domains = { domains : [ { uuid : domainObj . id , fq_name : [ defaultDomainName ] } ] } } else { domains = { domains : [ { uuid : commonUtils . convertUUIDToString ( domainObj . id ) , fq_name : [ domainObj . name ] } ] } } } commonUtils . handleJSONResponse ( null , response , domains ) ; } }
@listDomains
 public function
 1.
@listDomains public function 1 .