Changes the name of a node group.

    @type group: string
    @param group: Node group name
    @type new_name: string
    @param new_name: New node group name

    @rtype: int
    @return: job id
16036
def RenameGroup(r, group, new_name):
    

    body = {
        "new_name": new_name,
    }

    return r.request("put", "/2/groups/%s/rename" % group, content=body)
542993
def add_group(self, name, desc, status):
        

        existing_group = get_session().query(ResourceGroup).filter(ResourceGroup.name==name, ResourceGroup.network_id==self.id).first()
        if existing_group is not None:
            raise HydraError("A resource group with name %s is already in network %s"%(name, self.id))

        group_i             = ResourceGroup()
        group_i.name        = name
        group_i.description = desc
        group_i.status      = status

        get_session().add(group_i)

        self.resourcegroups.append(group_i)


        return group_i
956939
def create_group(self, name):
        
        parameters = {
            'name': name
        }

        url = self.TEAM_GROUPS_URL

        connection = Connection(self.token)
        connection.set_url(self.production, url)
        connection.add_params(parameters)

        return connection.post_request()
632950
public void rename(String newName) {
        URL url = FOLDER_INFO_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");

        JsonObject updateInfo = new JsonObject();
        updateInfo.add("name", newName);

        request.setBody(updateInfo.toString());
        BoxJSONResponse response = (BoxJSONResponse) request.send();
        response.getJSON();
    }
1296556
def xgroup_setid(self, name, groupname, id):
        
        return self.execute_command('XGROUP SETID', name, groupname, id)
1292256
def rename(self, new_name):
    
    update = copy.copy(self)
    update.name = new_name
    return self._do_update(update)
1095650
private void addGroupName(int maxlength)
    {
        int maxisolength = 0;
        char offsets[] = new char[LINES_PER_GROUP_ + 2];
        char lengths[] = new char[LINES_PER_GROUP_ + 2];
        byte tokenlengths[] = new byte[m_tokentable_.length];

        // enumerate all groups
        // for (int i = m_groupcount_ - 1; i >= 0; i --) {
        for (int i = 0; i < m_groupcount_ ; i ++) {
            int offset = getGroupLengths(i, offsets, lengths);
            // enumerate all lines in each group
            // for (int linenumber = LINES_PER_GROUP_ - 1; linenumber >= 0;
            //    linenumber --) {
            for (int linenumber = 0; linenumber < LINES_PER_GROUP_;
                linenumber ++) {
                int lineoffset = offset + offsets[linenumber];
                int length = lengths[linenumber];
                if (length == 0) {
                    continue;
                }

                // read regular name
                int parsed[] = addGroupName(lineoffset, length, tokenlengths,
                                            m_nameSet_);
                if (parsed[0] > maxlength) {
                    // 0 for name length
                    maxlength = parsed[0];
                }
                lineoffset += parsed[1];
                if (parsed[1] >= length) {
                    // 1 for parsed group string length
                    continue;
                }
                length -= parsed[1];
                // read Unicode 1.0 name
                parsed = addGroupName(lineoffset, length, tokenlengths,
                                      m_nameSet_);
                if (parsed[0] > maxlength) {
                    // 0 for name length
                    maxlength = parsed[0];
                }
                lineoffset += parsed[1];
                if (parsed[1] >= length) {
                    // 1 for parsed group string length
                    continue;
                }
                length -= parsed[1];
                // read ISO comment
                parsed = addGroupName(lineoffset, length, tokenlengths,
                                      m_ISOCommentSet_);
                if (parsed[1] > maxisolength) {
                    maxisolength = length;
                }
            }
        }

        // set gMax... - name length last for threading
        m_maxISOCommentLength_ = maxisolength;
        m_maxNameLength_ = maxlength;
    }
644275
def xgroup_create(self, name, groupname, id='$', mkstream=False):
        
        pieces = ['XGROUP CREATE', name, groupname, id]
        if mkstream:
            pieces.append(Token.get_token('MKSTREAM'))
        return self.execute_command(*pieces)
598747
private void setName(String newName)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setName", newName);

        this._name = newName;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setName");
    }
865247
public static base_response rename(nitro_service client, servicegroup resource, String new_servicegroupname) throws Exception {
		servicegroup renameresource = new servicegroup();
		renameresource.servicegroupname = resource.servicegroupname;
		return renameresource.rename_resource(client,new_servicegroupname);
	}
1046151
def workgroup(name):
    '''
    
    '''
    ret = {'name': name.upper(), 'result': False, 'changes': {}, 'comment': ''}

    # Grab the current domain/workgroup
    out = __salt__['system.get_domain_workgroup']()
    current_workgroup = out['Domain'] if 'Domain' in out else out['Workgroup'] if 'Workgroup' in out else ''

    # Notify the user if the requested workgroup is the same
    if current_workgroup.upper() == name.upper():
        ret['result'] = True
        ret['comment'] = "Workgroup is already set to '{0}'".format(name.upper())
        return ret

    # If being run in test-mode, inform the user what is supposed to happen
    if __opts__['test']:
        ret['result'] = None
        ret['changes'] = {}
        ret['comment'] = 'Computer will be joined to workgroup \'{0}\''.format(name)
        return ret

    # Set our new workgroup, and then immediately ask the machine what it
    # is again to validate the change
    res = __salt__['system.set_domain_workgroup'](name.upper())
    out = __salt__['system.get_domain_workgroup']()
    changed_workgroup = out['Domain'] if 'Domain' in out else out['Workgroup'] if 'Workgroup' in out else ''

    # Return our results based on the changes
    ret = {}
    if res and current_workgroup.upper() == changed_workgroup.upper():
        ret['result'] = True
        ret['comment'] = "The new workgroup '{0}' is the same as '{1}'".format(current_workgroup.upper(), changed_workgroup.upper())
    elif res:
        ret['result'] = True
        ret['comment'] = "The workgroup has been changed from '{0}' to '{1}'".format(current_workgroup.upper(), changed_workgroup.upper())
        ret['changes'] = {'old': current_workgroup.upper(), 'new': changed_workgroup.upper()}
    else:
        ret['result'] = False
        ret['comment'] = "Unable to join the requested workgroup '{0}'".format(changed_workgroup.upper())

    return ret
442534
public void setJobGroup (final String jobGroup)
  {
    if (jobGroup != null && jobGroup.trim ().length () == 0)
      throw new IllegalArgumentException ("Group name cannot be null or empty.");

    if (jobGroup == null)
      m_sJobGroup = IScheduler.DEFAULT_GROUP;
    else
      m_sJobGroup = jobGroup;
  }
436844
def create_group(self, group_name, path='/'):
        
        params = {'GroupName' : group_name,
                  'Path' : path}
        return self.get_response('CreateGroup', params)
303719
def get_group(self, name, default=NoGroupError):
        '''
        
        '''

        if name in self.groups:
            return self.groups[name]

        if default is NoGroupError:
            raise NoGroupError('No such group: {0}'.format(name))

        return default
433064
private void configureUserName(JobConf job) throws IOException {
    UnixUserGroupInformation ugi = getUGI(job);
   // Set the user's name, group and working directory
    job.setUser(ugi.getUserName());
    if (ugi.getGroupNames() != null && ugi.getGroupNames().length > 0) {
      job.set("group.name", ugi.getGroupNames()[0]);
    }
    if (job.getWorkingDirectory() == null) {
      job.setWorkingDirectory(fs.getWorkingDirectory());
    }
  }
949905
def renames(self, new):
        
        os.renames(self, new)
        return self._next_class(new)
981618
public void setGroup (final String group)
  {
    if (group != null && group.trim ().length () == 0)
      throw new IllegalArgumentException ("Group name cannot be an empty string.");

    if (group == null)
      m_sGroup = IScheduler.DEFAULT_GROUP;
    else
      m_sGroup = group;
    m_aKey = null;
  }