Change the domain of this server

 Raises an ArgumentError if the new domain is nil or empty
 no further validation is done on the domain name
182642
def set_domain!(new_domain)
      raise ArgumentError, "The new hostname cannot be nil" unless new_domain
      raise ArgumentError, "The new hostname cannot be empty" if new_domain.empty?

      edit_template = {
        "domain" => new_domain
      }

      self.service.editObject(edit_template)
      self.refresh_details()
    end
999754
def domain_create(args)
      raise ArgumentError, "You can't create a domain with ns records, you must do an update afterwards" if args.key?(:ns)
      raise ArgumentError, "You can't create a domain with ds or key records, you must do an update afterwards" if args.key?(:dsData) || args.key?(:keyData)
      super
    end
976517
def server_update(s_name, s_ip, **connection_args):
    '''
    
    '''
    altered = False
    cur_server = _server_get(s_name, **connection_args)
    if cur_server is None:
        return False
    alt_server = NSServer()
    alt_server.set_name(s_name)
    if cur_server.get_ipaddress() != s_ip:
        alt_server.set_ipaddress(s_ip)
        altered = True
    # Nothing to update, the server is already idem
    if altered is False:
        return False
    # Perform the update
    nitro = _connect(**connection_args)
    if nitro is None:
        return False
    ret = True
    try:
        NSServer.update(nitro, alt_server)
    except NSNitroError as error:
        log.debug('netscaler module error - NSServer.update() failed: %s', error)
        ret = False
    _disconnect(nitro)
    return ret
548564
def rename(args):
    """"""
    old_name, new_name = args.names
    add_tags(resources.ec2.Instance(resolve_instance_id(old_name)), Name=new_name, dry_run=args.dry_run)
535505
def update_domainalias(self, domainid, aliasid, data):
        """"""
        return self.api_call(
            ENDPOINTS['domainaliases']['update'],
            dict(domainid=domainid, aliasid=aliasid),
            body=data)
1367901
def _domain_event_balloon_change_cb(conn, domain, actual, opaque):
    '''
    
    '''
    _salt_send_domain_event(opaque, conn, domain, opaque['event'], {
        'actual': actual
    })
916652
function setDomain(domain) {
    checkIsObject('domain', domain);
    checkIsString('doamin.name', domain.name);
    //test domain, domain.name
    domainsMap = domainsMap.set(domain.name, domain);
}
1012960
def hostname=(new_hostname)
      if new_hostname &&
          (new_hostname.respond_to?(:ipv4?) || new_hostname.respond_to?(:ipv6?))
        new_hostname = new_hostname.to_s
      elsif new_hostname && !new_hostname.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_hostname.class} into String."
      end
      v = new_hostname ? new_hostname.to_str : nil
      v = "[#{v}]" if /\A\[.*\]\z/ !~ v && /:/ =~ v
      self.host = v
    end
795315
def append_domain():
    '''
    
    '''

    grain = {}

    if salt.utils.platform.is_proxy():
        return grain

    if 'append_domain' in __opts__:
        grain['append_domain'] = __opts__['append_domain']
    return grain
154718
function (args, callback) {
        if (ternserver) {
          ternserver.request({
              query: {
                type: "rename",  //$NON-NLS-1$
                file: args.meta.location,
                end: args.params.offset,
                newName: args.newname
              },
              files: args.files
            },
            function (error, changes) {
              if (error) {
                callback({
                  request: 'rename',
                  error: typeof error === 'string' ? error : error.message,
                  message: Messages['failedRenameTern']
                }); //$NON-NLS-1$
              } else if (changes && Array.isArray(changes.changes)) {
                callback({request: 'rename', changes: changes}); //$NON-NLS-1$
              } else {
                callback({request: 'rename', changes: []}); //$NON-NLS-1$
              }
            });
        } else {
          callback({request: 'rename', message: Messages['failedRenameNoServer']}); //$NON-NLS-1$
        }
      }
493792
def update_domain(self, domain, emailAddress=None, ttl=None, comment=None):
        
        if not any((emailAddress, ttl, comment)):
            raise exc.MissingDNSSettings(
                    "No settings provided to update_domain().")
        uri = "/domains/%s" % utils.get_id(domain)
        body = {"comment": comment,
                "ttl": ttl,
                "emailAddress": emailAddress,
                }
        none_keys = [key for key, val in body.items()
                if val is None]
        for none_key in none_keys:
            body.pop(none_key)
        resp, resp_body = self._async_call(uri, method="PUT", body=body,
                error_class=exc.DomainUpdateFailed, has_response=False)
        return resp_body
134665
def set_as400_service(domain = nil, username = nil, password = nil)
      self.domain    = domain
      self.user_name = username
      self.password  = password
      self.service   = Credential::Service::AS400
    end
921399
def update(domain):
    
    translations_dir = _get_translations_dir()
    domain = _get_translations_domain(domain)
    pot = os.path.join(translations_dir, f'{domain}.pot')
    return _run(f'update -i {pot} -d {translations_dir} --domain={domain}')
1300894
def raise_on_nil_instance_vars(object, vars)
    nil_vars = nil_instance_vars(object, vars)
    unless nil_vars.empty?
      raise ObjectValidationError.new("The following instance variables were nil: #{nil_vars.join(', ')}.")
    end
  end
426364
def _validate_domains(domains):
        """"""
        missing = set(settings.TRANSLATION_DOMAINS.keys()) - set(domains.keys())
        if missing:
            print('The following domains have been set in the configuration, '
                  'but their sources were not provided, use the `--source` '
                  'option to specify their sources: {domains}'.format(domains=', '.join(missing)))
            sys.exit(1)
1187281
def index
      validate_arguments!
      domains = api.get_domains_v3_domain_cname(app)

      styled_header("#{app} Heroku Domain")
      heroku_domain = domains.detect { |d| d['kind'] == 'heroku' || d['kind'] == 'default' } # TODO: remove 'default' after API change
      if heroku_domain
        display heroku_domain['hostname']
      else
        output_with_bang "Not found"
      end

      display

      styled_header("#{app} Custom Domains")
      custom_domains = domains.select{ |d| d['kind'] == 'custom' }
      if custom_domains.length > 0
        display_table(custom_domains, ['hostname', 'cname'], ['Domain Name', 'DNS Target'])
      else
        display("#{app} has no custom domains.")
        display("Use `heroku domains:add DOMAIN` to add one.")
      end
    end
495800
def rename(self, dn: str, new_rdn: str, new_base_dn: Optional[str] = None) -> None:
        

        return self._do_with_retry(
            lambda obj: obj.rename_s(dn, new_rdn, new_base_dn))