modules/orionode/lib/cf/domains.js
function getCFdomains(appTarget, UserId, targetUrl, domainName, defaultDomainMode) {
	var domainArray = [];
	var waitFor;
	if (!defaultDomainMode){
		waitFor = target.cfRequest("GET", UserId, targetUrl + appTarget.Org.entity.private_domains_url, 
				domainName ? {"q": "name:" + api.encodeURIComponent(domainName)}: null, null, null, null, appTarget);
	}else{
		waitFor = Promise.resolve();
	}
	return waitFor
	.then(function(result) {
		if (defaultDomainMode || !domainName || result.total_results < 1) {
			var qs = domainName ? {
				"q": "name:" + api.encodeURIComponent(domainName)
			} : {
				"page": "1",
				"results-per-page": "1"
			};
			return target.cfRequest("GET", UserId, targetUrl + "/v2/shared_domains", qs, null, null, null, appTarget)
			.then(function(result){
				return result;
			});
		}
		return result;
	}).then(function(result) {
		var domainResources = result.resources;
		for (var k = 0; k < domainResources.length; k++) {
			var domainJson = {
				"Guid": domainResources[k].metadata.guid,
				"DomainName": domainResources[k].entity.name,
				"Type": "Domain"
			};
			domainArray.push(domainJson);
		}
		return domainArray;
	});
}
function getCFdomains(appTarget, UserId, targetUrl, domainName, defaultDomainMode) {
	var domainArray = [];
	var waitFor;
	if (!defaultDomainMode){
		waitFor = target.cfRequest("GET", UserId, targetUrl + appTarget.Org.entity.private_domains_url, 
				domainName ? {"q": "name:" + api.encodeURIComponent(domainName)}: null, null, null, null, appTarget);
	}else{
		waitFor = Promise.resolve();
	}
	return waitFor
	.then(function(result) {
		if (defaultDomainMode || !domainName || result.total_results < 1) {
			var qs = domainName ? {
				"q": "name:" + api.encodeURIComponent(domainName)
			} : {
				"page": "1",
				"results-per-page": "1"
			};
			return target.cfRequest("GET", UserId, targetUrl + "/v2/shared_domains", qs, null, null, null, appTarget)
			.then(function(result){
				return result;
			});
		}
		return result;
	}).then(function(result) {
		var domainResources = result.resources;
		for (var k = 0; k < domainResources.length; k++) {
			var domainJson = {
				"Guid": domainResources[k].metadata.guid,
				"DomainName": domainResources[k].entity.name,
				"Type": "Domain"
			};
			domainArray.push(domainJson);
		}
		return domainArray;
	});
}
function getCFdomains ( appTarget , UserId , targetUrl , domainName , defaultDomainMode ) { var domainArray = [ ] ; var waitFor ; if ( ! defaultDomainMode ) { waitFor = target . cfRequest ( "GET" , UserId , targetUrl + appTarget . Org . entity . private_domains_url , domainName ? { "q" : "name:" + api . encodeURIComponent ( domainName ) } : null , null , null , null , appTarget ) ; } else { waitFor = Promise . resolve ( ) ; } return waitFor . then ( function ( result ) { if ( defaultDomainMode || ! domainName || result . total_results < 1 ) { var qs = domainName ? { "q" : "name:" + api . encodeURIComponent ( domainName ) } : { "page" : "1" , "results-per-page" : "1" } ; return target . cfRequest ( "GET" , UserId , targetUrl + "/v2/shared_domains" , qs , null , null , null , appTarget ) . then ( function ( result ) { return result ; } ) ; } return result ; } ) . then ( function ( result ) { var domainResources = result . resources ; for ( var k = 0 ; k < domainResources . length ; k ++ ) { var domainJson = { "Guid" : domainResources [ k ] . metadata . guid , "DomainName" : domainResources [ k ] . entity . name , "Type" : "Domain" } ; domainArray . push ( domainJson ) ; } return domainArray ; } ) ; }
This method can not accept req, because the req something has a body instead of a query.
This method can not accept req because the req something has a body instead of a query .