@name Client.getDomains

@description getDomains retrieves your list of domains

@param {Object|Function}     details     provides filters on your domains request
@param {Function}            callback    handles the callback of your api call
555539
function(details, callback) {
        var self = this;

        if (typeof(details) === 'function') {
            callback = details;
            details = {};
        }

        var requestOptions = {
            uri: '/domains',
            endpoint: rackspace.Endpoints.CloudDns
        };

        requestOptions.qs = _.pick(details,
            'name');

        self.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || !body.domains) {
                callback(err);
                return;
            }

            var domains = [];

            for (var i = 0; i < body.domains.length; i++) {
                domains.push(new rackspace.Domain(self, body.domains[i]));
            }

            callback(err, domains);
        });
    }
914071
function setDomains(newDomains) {
    if (!isObject(newDomains)) {
        throw new InvalidException('newDomains should be an object', newDomains);
    }
    domainsMap = domainsMap.merge(newDomains);
}
564190
function _getReplyDetails (details, markup) {
	let $ = cheerio.load(markup);

	$('div.reply_options').find('b').each((i, element) => {
		let infoType = $(element).text().trim();

		// set contact name
		if (/contact\sname/i.test(infoType)) {
			$(element).next().find('li').each((i, li) => {
				details.contactName = $(li).text().trim();
			});

			return;
		}

		// set phone number and email
		if (/call/i.test(infoType)) {
			$(element).parent().find('li').each((i, li) => {
				let value = $(li).text().trim();

				// check for phone value (based on the emoji)
				if (/\u260E/.test(value)) {
					details.phoneNumber = value.substring(value.indexOf('('));
					return;
				}

				// check for email value (based on the @ symbol)
				if (/\@/.test(value)) {
					details.email = value;
				}
			});

			return;
		}
	});
}
1176189
function(details, callback) {
        var self = this;

        if (typeof(details) === 'function') {
            callback = details;
            details = {};
        }

        var requestOptions = {
            uri: '/flavors/detail'
        };

        requestOptions.qs = _.pick(details,
            'minDisk',
            'minRam',
            'marker',
            'limit');

        self.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || !body.flavors) {
                callback(err);
                return;
            }

            var flavors = [];

            for (var i = 0; i < body.flavors.length; i++) {
                flavors.push(new rackspace.Flavor(self, body.flavors[i]));
            }

            callback(err, flavors);
        });
    }
1185633
@Override
    public List<CallDetailRecord> getCallDetailRecords(CallDetailRecordFilter filter) {

        final SqlSession session = sessions.openSession();

        try {
            final List<Map<String, Object>> results = session.selectList(namespace + "getCallDetailRecordByUsingFilters",
                    filter);
            final List<CallDetailRecord> cdrs = new ArrayList<CallDetailRecord>();

            if (results != null && !results.isEmpty()) {
                for (final Map<String, Object> result : results) {
                    cdrs.add(toCallDetailRecord(result));
                }
            }
            return cdrs;
        } finally {
            session.close();
        }
    }
1227590
function(details) {
        var self = this;

        this.id = details.id;
        this.name = details.name;
        this.port = details.port;
        this.protocol = details.protocol;
        this.nodeCount = details.nodeCount;
        this.algorithm = details.algorithm;
        this.status = details.status;
        this.timeout = details.timeout;
        this.cluster = details.cluster;
        this.created = details.created;
        this.updated = details.updated;
        this.connectionLogging = details.connectionLogging;
        this.sourceAddresses = details.sourceAddresses;
        this.connectionThrottle = details.connectionThrottle;
        this.sessionPersistence = details.sessionPersistence;

        self._populateNodes(details.nodes);
        self._populateVirtualIps(details.virtualIps);
    }
241091
function (domain) {
        var pluralForms = [];
        var normalizedDomain = gt._normalizeDomain(domain, true);
        var poPluralsInfo = plurals[normalizedDomain];
        if (typeof poPluralsInfo === 'undefined') {
            // default to 'en' in this case
            normalizedDomain = 'en';
            poPluralsInfo = plurals['en'];
        }
        var icuPluralsFunction = IntlMessageFormat.prototype._findPluralRuleFunction(normalizedDomain);

        poPluralsInfo.examples.forEach(function (plural) {
            pluralForms.push({
                icuPlural: icuPluralsFunction(plural.sample),
                poPlural: plural.plural});
        });
        return pluralForms;
    }
568873
function(callback){
    var options = this.options,
        cache = this.options.cache,
        logger =  this.options.logger;
    
    if(this.apiInterface){
      logger.info('fetch data from api: ' + this.apiInterface.name);
    
      var sgn = this.profile.identity.sgn || '',
          self = this;

      try
      {
        this.apiInterface.getProfile(this.url, sgn, options, function(hCard){
          if(hCard){
            self.profile.hCards = [hCard];
          }
          self.status = "fetched";
          callback();
        });
      }
      catch(err)
      {
        logger.warn('error getting api data with plugin for: ' + self.domain + ' - ' + err);
        self.error = err;
        self.status = "errored";
        callback();
      }
    }


  }
861219
def list_domains(self):
        
        self.connect()
        results = self.server.list_domains(self.session_id)
        return {i['domain']: i['subdomains'] for i in results}
1073974
func (c *Schema) GetDomains() ([]*SchemaDomain, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Schema.getDomains"})
	if err != nil {
		return nil, err
	}

	var chromeData struct {
		Result struct {
			Domains []*SchemaDomain
		}
	}

	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}

	return chromeData.Result.Domains, nil
}
241781
function listDomains($count = 100, $offset = 0) {

		$query = array();
		$query['count'] = $count;
		$query['offset'] = $offset;

		return new DynamicResponseModel($this->processRestRequest('GET', '/domains/', $query));
	}
1151706
def domains(self):
        
        json = self.request('/domains', method='GET')
        status = json.get('status')
        if status == 'OK':
            domains_json = json.get('domains', [])
            domains = [Domain.from_json(domain) for domain in domains_json]
            return domains
        else:
            message = json.get('message')
            raise DOPException('[%s]: %s' % (status, message))
1321393
function(callback) {
                var deviceId;

                var params = {
                    url: SERVICE_ADDRESSES.SSO_ADDRESS + SERVICES_PATH.SSO_DEVICES,
                    method: 'GET',
                    headers: {
                        'Authorization': 'Bearer ' + token
                    }
                };

                httpRequest(params, function(result) {
                    if (!result.hasError) {
                        var devices = JSON.parse(result.result.responseText).devices;
                        if (devices && devices.length > 0) {
                            for (var i = 0; i < devices.length; i++) {
                                if (devices[i].current) {
                                    deviceId = devices[i].uid;
                                    break;
                                }
                            }

                            if (!deviceId) {
                                fireEvent('error', {
                                    code: 6000,
                                    message: CHAT_ERRORS[6000],
                                    error: null
                                });
                            }
                            else {
                                callback(deviceId);
                            }
                        }
                        else {
                            fireEvent('error', {
                                code: 6001,
                                message: CHAT_ERRORS[6001],
                                error: null
                            });
                        }
                    }
                    else {
                        fireEvent('error', {
                            code: result.errorCode,
                            message: result.errorMessage,
                            error: result
                        });
                    }
                });
            }
1264480
function getJavaScriptCallbackParameterListSimple(parameters) {
    var result = []

    parameters.forEach(function(parameter){
        if (!parameter.out) return
        result.push("/*" + getIdlType(parameter.type) + "*/ "+ parameter.name)
    })

    return result.join(", ")
}
1225583
function handler (eventDetails){
  var Alert = models.getModels().Alert;
  logger.logger.trace(loggerPrefix +'Processing Alerts for Event: ', eventDetails);

  Alert.queryAlerts(eventDetails.uid, eventDetails.env, eventDetails.domain, function(err, alerts){
    if(err) {
      logger.logger.warn({ error:err }, loggerPrefix +'Failed to query Alerts for uid and env', uid, env);
    } else {
      if(alerts && alerts.length > 0){
        logger.logger.trace(loggerPrefix +'Found ['+ alerts.length +'] Alerts. Matching and send emails', alerts);
        matchAndIssueAlertEmails(eventDetails, alerts);
      } else {
        logger.logger.trace(loggerPrefix +'No Alerts for event. No emails to send.');
      }
    }
  });
}
157958
function(dnsaddr) {
  var domain = getAddressDomain(dnsaddr);
  if(domain !== undefined && clients[domain] !== undefined)
    return clients[domain];
}
470312
function listEvents(req, res, next){
  var logger = log.logger;
  var EventModel = models.getModels().Event;
  var listReq = RequestTranslator.parseListEventsRequest(req);
  if(! listReq.uid || ! listReq.env || ! listReq.domain){
    return next({"error":"invalid params missing uid env or domain","code":400});
  }
  EventModel.queryEvents(listReq.uid, listReq.env, listReq.domain, function(err, events){
    if(err) {
      logger.error(loggerPrefix + 'Events Query Error: ', err);
      return next(err);
    } else {
      req.resultData =  ResponseTranslator.mapEventsToResponse(events);
      next();
    }
  });
}