@name Client.createDomains

@description register a new domain in the rackspace domain manager

@param {Array}      domains     the array of domains to create
@param {Function}   callback    handles the callback of your api call
760004
function(domains, callback) {
        var self = this;

        var listOfDomains = [];
        _.each(domains, function(domain) {
            ['name', 'emailAddress'].forEach(function(required) {
                if (!domain[required]) throw new Error('details.' +
                    required + ' is a required argument.');
            });

            var newDomain = {
                name: domain.name,
                emailAddress: domain.emailAddress
            };

            if (domain.ttl && typeof(domain.ttl) === 'number' && domain.ttl >= 300) {
                newDomain.ttl = domain.ttl;
            }

            if (domain.comment) {
                newDomain.comment = domain.comment;
            }

            listOfDomains.push(newDomain);
        });


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

        self.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || res.statusCode !== 202) {
                callback(err ? err : body);
                return;
            }

            callback(err, new rackspace.Status(self, body));
        });
    }
993565
function init(domainManager) {
    if (!domainManager.hasDomain("FindInFiles")) {
        domainManager.registerDomain("FindInFiles", {major: 0, minor: 1});
    }
    _domainManager = domainManager;
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "doSearch",    // command name
        doSearch,   // command handler function
        false,          // this command is synchronous in Node
        "Searches in project files and returns matches",
        [{name: "searchObject", // parameters
            type: "object",
            description: "Object containing search data"}],
        [{name: "searchResults", // return values
            type: "object",
            description: "Object containing results of the search"}]
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "nextPage",    // command name
        getNextPage,   // command handler function
        false,          // this command is synchronous in Node
        "get the next page of reults",
        [],
        [{name: "searchResults", // return values
            type: "object",
            description: "Object containing results of the search"}]
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "getAllResults",    // command name
        getAllResults,   // command handler function
        false,          // this command is synchronous in Node
        "get the next page of reults",
        [],
        [{name: "searchResults", // return values
            type: "object",
            description: "Object containing all results of the search"}]
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "collapseResults",    // command name
        setCollapseResults,   // command handler function
        false,          // this command is synchronous in Node
        "get the next page of reults",
        [{name: "collapse", // return values
            type: "boolean",
            description: "true to collapse"}],
        []
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "filesChanged",    // command name
        addFilesToCache,   // command handler function
        false,          // this command is synchronous in Node
        "files in the project has been changed, update cache",
        [{name: "updateObject", // parameters
            type: "object",
            description: "Object containing list of changed files"}],
        []
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "documentChanged",    // command name
        documentChanged,   // command handler function
        false,          // this command is synchronous in Node
        "informs that the document changed and updates the cache",
        [{name: "updateObject", // parameters
            type: "object",
            description: "update with the contents of the object"}],
        []
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "filesRemoved",    // command name
        removeFilesFromCache,   // command handler function
        false,          // this command is synchronous in Node
        "Searches in project files and returns matches",
        [{name: "updateObject", // parameters
            type: "object",
            description: "Object containing list of removed files"}],
        []
    );
    domainManager.registerCommand(
        "FindInFiles",       // domain name
        "initCache",    // command name
        initCache,   // command handler function
        false,          // this command is synchronous in Node
        "Caches the project for find in files in node",
        [{name: "fileList", // parameters
            type: "Array",
            description: "List of all project files - Path only"}],
        []
    );
    domainManager.registerEvent(
        "FindInFiles",     // domain name
        "crawlComplete",   // event name
        [
            {
                name: "numFiles",
                type: "number",
                description: "number of files cached"
            },
            {
                name: "cacheSize",
                type: "number",
                description: "The size of the file cache epressesd as string length of files"
            }
        ]
    );
    setTimeout(fileCrawler, 5000);
}
1163158
function(zone, callback) {
    var self = this,
        zoneId = zone instanceof dns.Zone ? zone.id : zone;

    var requestOptions = {
      path: urlJoin(_urlPrefix, zoneId, 'subdomains'),
      method: 'GET'
    };

    self._request(requestOptions, function(err, body, res) {
      return err
        ? callback(err)
        : callback(null, body.domains.map(function (result) {
        return new dns.Zone(self, result);
      }), res);
    });
  }
249834
function setDomain()
    {
        $this->domains = func_get_args();
        $this->removeDNProp('id-at-commonName');
        $this->setDNProp('id-at-commonName', $this->domains[0]);
    }
648995
def create_authserver(self, domainid, data):
        """"""
        return self.api_call(
            ENDPOINTS['authservers']['new'],
            dict(domainid=domainid),
            body=data)
643527
function(cb) {
    let serverDomain = domain.create();
    serverDomain.on('error', function(err) {
      console.error('Server domain caught an exception: ' + err);
      if (err) {
        console.error(err.stack);
      }
    });

    let web = this;
    serverDomain.run(function() {

      // Initialize the express server and routes.
      web.initServer();
      let http = require('http');

      let alwaysSecure = null;
      if (web.conf.https && web.conf.https.enabled) {
        if (web.conf.https.letsEncrypt) {
          //must do this manuall - npm install --global letsencrypt-cli
          let https = require('https');
          

          let lex = web.getLetsEncryptLex();

          let httpsPort = web.conf.https.port || 443;
          https.createServer(lex.httpsOptions, lex.middleware(web.app))
          .listen(httpsPort, web.conf.ipAddress, function(err, result) {
            if (err) {
              console.error(err);
            }
            console.log('%s: Node https server started on %s:%d ...',
                        Date(Date.now()), web.conf.ipAddress, httpsPort);

            if (cb) {
              cb(err, result);
            }
          });



        } else {
          let https = require('https');
          let privateKey = fs.readFileSync(web.conf.https.privateKey, 'utf8');
          let certificate = fs.readFileSync(web.conf.https.certificate, 'utf8');
          let credentials = {key: privateKey, cert: certificate};
          let httpsServer = https.createServer(credentials, web.app);

          httpsServer.listen(web.conf.https.port, web.conf.ipAddress, function(err, result) {
            if (err) {
              console.error(err);
            }
            console.log('%s: Node https server started on %s:%d ...',
                        Date(Date.now()), web.conf.ipAddress, web.conf.https.port);

            if (cb) {
              cb(err, result);
            }
          });
        }

        alwaysSecure = web.conf.https.alwaysSecure;
      }
      
      if (alwaysSecure && alwaysSecure.enabled) {
        let httpRedirecter = http.createServer(function(req, res) {

          if (alwaysSecure.redirectHandler) {
            alwaysSecure.redirectHandler(req, res);
          } else {  
            let nonStandardPort = '';
            if (web.conf.https.port != 443) {
              nonStandardPort = ':' + web.conf.https.port;
            }
            res.writeHead(302, {'Location': 'https://' + req.headers.host.split(':')[0] + nonStandardPort + req.url});
            res.end();
          }
        });

        httpRedirecter.listen(web.conf.port, web.conf.ipAddress, function(err, result) {
           if (err) {
              console.error(err);
            }
            
            console.log('%s: http redirecter server started on %s:%d ...',
                        Date(Date.now()), web.conf.ipAddress, web.conf.port);

            if (cb) {
              cb(err, result);
            }
        });
      } else {
        let httpServer = http.createServer(web.app);
        //  Start the app on the specific interface (and port).
        httpServer.listen(web.conf.port, web.conf.ipAddress, function(err, result) {
           if (err) {
              console.error(err);
            }
            
            console.log('%s: Node server started on %s:%d ...',
                        Date(Date.now()), web.conf.ipAddress, web.conf.port);

            if (cb) {
              cb(err, result);
            }
        });
      }

    });
  }
124828
def create_domain_smarthost(self, domainid, data):
        """"""
        return self.api_call(
            ENDPOINTS['domainsmarthosts']['new'],
            dict(domainid=domainid),
            body=data)
362717
def keys_create(cls, fqdn, flag):
        """"""
        data = {
            "flags": flag,
        }
        meta = cls.get_fqdn_info(fqdn)
        url = meta['domain_keys_href']
        ret, headers = cls.json_post(url, data=json.dumps(data),
                                     return_header=True)
        return cls.json_get(headers['location'])
231060
protected function initCatalogForManyDomains($locale, $domains) {
		foreach ($domains as $domain) {
			$this->initCatalog($locale, $domain);
		}
	}
934093
function init(domainManager) {
    _domainManager = domainManager;
    if (!domainManager.hasDomain("nodeSocketTransport")) {
        domainManager.registerDomain("nodeSocketTransport", {major: 0, minor: 1});
    }
    domainManager.registerCommand(
        "nodeSocketTransport",      // domain name
        "start",       // command name
        _cmdStart,     // command handler function
        false,          // this command is synchronous in Node
        "Creates the WS server",
        []
    );
    domainManager.registerCommand(
        "nodeSocketTransport",      // domain name
        "send",         // command name
        _cmdSend,       // command handler function
        false,          // this command is synchronous in Node
        "Sends a message to a given client or list of clients",
        [
            {name: "idOrArray", type: "number|Array.<number>", description: "id or array of ids to send the message to"},
            {name: "message", type: "string", description: "JSON message to send"}
        ],
        []
    );
    domainManager.registerCommand(
        "nodeSocketTransport",      // domain name
        "close",         // command name
        _cmdClose,       // command handler function
        false,          // this command is synchronous in Node
        "Closes the connection to a given client",
        [
            {name: "id", type: "number", description: "id of connection to close"}
        ],
        []
    );
    domainManager.registerEvent(
        "nodeSocketTransport",
        "connect",
        [
            {name: "clientID", type: "number", description: "ID of live preview page connecting to live development"},
            {name: "url", type: "string", description: "URL of page that live preview is connecting from"}
        ]
    );
    domainManager.registerEvent(
        "nodeSocketTransport",
        "message",
        [
            {name: "clientID", type: "number", description: "ID of live preview page sending message"},
            {name: "msg", type: "string", description: "JSON message from client page"}
        ]
    );
    domainManager.registerEvent(
        "nodeSocketTransport",
        "close",
        [
            {name: "clientID", type: "number", description: "ID of live preview page being closed"}
        ]
    );
}
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);
        });
    }
999555
function(virtualIps) {

        if (!virtualIps) {
            return;
        }

        var self = this;

        self.virtualIps = [];

        _.each(virtualIps, function(virtualIp) {
            self.virtualIps.push(new rackspace.VirtualIp(virtualIp));
        });
    }
938754
function init(domainManager) {
    if (!domainManager.hasDomain("extensionManager")) {
        domainManager.registerDomain("extensionManager", {major: 0, minor: 1});
    }
    domainManager.registerCommand(
        "extensionManager",
        "validate",
        validate,
        true,
        "Verifies that the contents of the given ZIP file are a valid Brackets extension package",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the extension package"
        }, {
            name: "options",
            type: "{requirePackageJSON: ?boolean}",
            description: "options to control the behavior of the validator"
        }],
        [{
            name: "errors",
            type: "string|Array.<string>",
            description: "download error, if any; first string is error code (one of Errors.*); subsequent strings are additional info"
        }, {
            name: "metadata",
            type: "{name: string, version: string}",
            description: "all package.json metadata (null if there's no package.json)"
        }]
    );
    domainManager.registerCommand(
        "extensionManager",
        "install",
        _cmdInstall,
        true,
        "Installs the given Brackets extension if it is valid (runs validation command automatically)",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the extension package"
        }, {
            name: "destinationDirectory",
            type: "string",
            description: "absolute filesystem path where this extension should be installed"
        }, {
            name: "options",
            type: "{disabledDirectory: !string, apiVersion: !string, nameHint: ?string, systemExtensionDirectory: !string, proxy: ?string}",
            description: "installation options: disabledDirectory should be set so that extensions can be installed disabled."
        }],
        [{
            name: "errors",
            type: "string|Array.<string>",
            description: "download error, if any; first string is error code (one of Errors.*); subsequent strings are additional info"
        }, {
            name: "metadata",
            type: "{name: string, version: string}",
            description: "all package.json metadata (null if there's no package.json)"
        }, {
            name: "disabledReason",
            type: "string",
            description: "reason this extension was installed disabled (one of Errors.*), none if it was enabled"
        }, {
            name: "installationStatus",
            type: "string",
            description: "Current status of the installation (an extension can be valid but not installed because it's an update"
        }, {
            name: "installedTo",
            type: "string",
            description: "absolute path where the extension was installed to"
        }, {
            name: "commonPrefix",
            type: "string",
            description: "top level directory in the package zip which contains all of the files"
        }]
    );
    domainManager.registerCommand(
        "extensionManager",
        "update",
        _cmdUpdate,
        true,
        "Updates the given Brackets extension (for which install was generally previously attemped). Brackets must be quit after this.",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the extension package"
        }, {
            name: "destinationDirectory",
            type: "string",
            description: "absolute filesystem path where this extension should be installed"
        }, {
            name: "options",
            type: "{disabledDirectory: !string, apiVersion: !string, nameHint: ?string, systemExtensionDirectory: !string}",
            description: "installation options: disabledDirectory should be set so that extensions can be installed disabled."
        }],
        [{
            name: "errors",
            type: "string|Array.<string>",
            description: "download error, if any; first string is error code (one of Errors.*); subsequent strings are additional info"
        }, {
            name: "metadata",
            type: "{name: string, version: string}",
            description: "all package.json metadata (null if there's no package.json)"
        }, {
            name: "disabledReason",
            type: "string",
            description: "reason this extension was installed disabled (one of Errors.*), none if it was enabled"
        }, {
            name: "installationStatus",
            type: "string",
            description: "Current status of the installation (an extension can be valid but not installed because it's an update"
        }, {
            name: "installedTo",
            type: "string",
            description: "absolute path where the extension was installed to"
        }, {
            name: "commonPrefix",
            type: "string",
            description: "top level directory in the package zip which contains all of the files"
        }]
    );
    domainManager.registerCommand(
        "extensionManager",
        "remove",
        _cmdRemove,
        true,
        "Removes the Brackets extension at the given path.",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the installed extension folder"
        }],
        {}
    );
    domainManager.registerCommand(
        "extensionManager",
        "downloadFile",
        _cmdDownloadFile,
        true,
        "Downloads the file at the given URL, saving it to a temp location. Callback receives path to the downloaded file.",
        [{
            name: "downloadId",
            type: "string",
            description: "Unique identifier for this download 'session'"
        }, {
            name: "url",
            type: "string",
            description: "URL to download from"
        }, {
            name: "proxy",
            type: "string",
            description: "optional proxy URL"
        }],
        {
            type: "string",
            description: "Local path to the downloaded file"
        }
    );
    domainManager.registerCommand(
        "extensionManager",
        "abortDownload",
        _cmdAbortDownload,
        false,
        "Aborts any pending download with the given id. Ignored if no download pending (may be already complete).",
        [{
            name: "downloadId",
            type: "string",
            description: "Unique identifier for this download 'session', previously pased to downloadFile"
        }],
        {
            type: "boolean",
            description: "True if the download was pending and able to be canceled; false otherwise"
        }
    );
}
1259423
function(callback) {
        var self = this;

        var requestOptions = {
            uri: '/instances',
            endpoint: rackspace.Endpoints.CloudDatabases
        };

        this.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || !body.instances) {
                callback(err ? err : body);
                return;
            }

            var instances = [];

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

            callback(err, instances);
        });
    }
386420
function registerHandlersAndDomains(ws, port) {
            // Called if we succeed at the final setup
            function success() {
                self._ws.onclose = function () {
                    if (self._autoReconnect) {
                        var $promise = self.connect(true);
                        self.trigger("close", $promise);
                    } else {
                        self._cleanup();
                        self.trigger("close");
                    }
                };
                deferred.resolve();
            }
            // Called if we fail at the final setup
            function fail(err) {
                self._cleanup();
                deferred.reject(err);
            }

            self._ws = ws;
            self._port = port;
            self._ws.onmessage = self._receive.bind(self);

            // refresh the current domains, then re-register any
            // "autoregister" modules
            self._refreshInterface().then(
                function () {
                    if (self._registeredModules.length > 0) {
                        self.loadDomains(self._registeredModules, false).then(
                            success,
                            fail
                        );
                    } else {
                        success();
                    }
                },
                fail
            );
        }
3243
function init(domainManager) {
    if (!domainManager.hasDomain("fileWatcher")) {
        domainManager.registerDomain("fileWatcher", {major: 0, minor: 1});
    }

    domainManager.registerCommand(
        "fileWatcher",
        "watchPath",
        watcherManager.watchPath,
        false,
        "Start watching a file or directory",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the file or directory to watch"
        }, {
            name: "ignored",
            type: "array",
            description: "list of path to ignore"
        }]
    );
    domainManager.registerCommand(
        "fileWatcher",
        "unwatchPath",
        watcherManager.unwatchPath,
        false,
        "Stop watching a single file or a directory and it's descendants",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the file or directory to unwatch"
        }]
    );
    domainManager.registerCommand(
        "fileWatcher",
        "unwatchAll",
        watcherManager.unwatchAll,
        false,
        "Stop watching all files and directories"
    );
    domainManager.registerEvent(
        "fileWatcher",
        "change",
        [
            {name: "event", type: "string"},
            {name: "parentDirPath", type: "string"},
            {name: "entryName", type: "string"},
            {name: "statsObj", type: "object"}
        ]
    );

    watcherManager.setDomainManager(domainManager);
    watcherManager.setWatcherImpl(watcherImpl);

}
817210
func (api *Client) CreateDomain(data *CreateDomainData) (string, error) {
	_, headers, err := api.makeRequest(http.MethodPost, api.concatUserPath(domainsPath), nil, data)
	if err != nil {
		return "", err
	}
	return getIDFromLocationHeader(headers), nil
}