Update a role config group.

    @param name: Role config group name.
    @param apigroup: The updated role config group.
    @return: The updated ApiRoleConfigGroup object.
    @since: API v3
178233
def update_role_config_group(self, name, apigroup):
    
    return role_config_groups.update_role_config_group(
        self._get_resource_root(), self.name, name, apigroup,
        self._get_cluster_name())
581054
@RequestMapping(value = "api/servergroup/{id}", method = RequestMethod.POST)
    public
    @ResponseBody
    ServerGroup updateServerGroup(Model model,
                                  @PathVariable int id,
                                  @RequestParam(required = false) Integer profileId,
                                  @RequestParam(required = false) String name,
                                  @RequestParam(required = false) Boolean activate,
                                  @RequestParam(required = false) String clientUUID,
                                  @RequestParam(value = "profileIdentifier", required = false) String profileIdentifier) throws Exception {
        if (profileId == null && profileIdentifier == null) {
            throw new Exception("profileId required");
        }
        if (profileId == null) {
            profileId = ProfileService.getInstance().getIdFromName(profileIdentifier);
        }
        if (name != null) {
            ServerRedirectService.getInstance().setGroupName(name, id);
        }

        if (activate != null) {
            if (clientUUID == null) {
                throw new Exception("clientUUID required");
            }

            int clientId = ClientService.getInstance().findClient(clientUUID, profileId).getId();

            if (activate) {
                ServerRedirectService.getInstance().activateServerGroup(id, clientId);
            } else {
                ServerRedirectService.getInstance().activateServerGroup(0, clientId);
            }
        }

        return ServerRedirectService.getInstance().getServerGroup(id, profileId);
    }
1192025
def add_update_callback(self, group=None, name=None, cb=None):
        
        if not group and not name:
            self.all_update_callback.add_callback(cb)
        elif not name:
            if group not in self.group_update_callbacks:
                self.group_update_callbacks[group] = Caller()
            self.group_update_callbacks[group].add_callback(cb)
        else:
            paramname = '{}.{}'.format(group, name)
            if paramname not in self.param_update_callbacks:
                self.param_update_callbacks[paramname] = Caller()
            self.param_update_callbacks[paramname].add_callback(cb)
736111
public void addWorldGroup(String name) {
        if (!worldGroupExist(name)) {
            list.put(name, new WorldGroup(name));
        }
    }
458079
public function updateRole($projectId, $roleId, $user = null, $group = null)
    {
        $parameters = [];
        if ((is_null($user) && is_null($group)) || (!is_null($user) && !is_null($group))) {
            throw new EndpointParameterException('User or group should be given');
        } elseif (!is_null($user)) {
            $parameters['user'] = $user;
        } else {
            $parameters['group'] = $group;
        }

        return $this->apiClient->callEndpoint(
            sprintf('%s/%s/role/%s', self::ENDPOINT, $projectId, $roleId),
            $parameters,
            null,
            HttpMethod::REQUEST_PUT
        );
    }
1002426
public void updateFlowConfig(FlowConfig flowConfig)
      throws RemoteInvocationException {
    LOG.debug("updateFlowConfig with groupName " + flowConfig.getId().getFlowGroup() + " flowName " +
        flowConfig.getId().getFlowName());

    FlowId flowId = new FlowId().setFlowGroup(flowConfig.getId().getFlowGroup())
        .setFlowName(flowConfig.getId().getFlowName());

    UpdateRequest<FlowConfig> updateRequest =
        _flowconfigsRequestBuilders.update().id(new ComplexResourceKey<>(flowId, new EmptyRecord()))
            .input(flowConfig).build();

    ResponseFuture<EmptyRecord> response = _restClient.get().sendRequest(updateRequest);

    response.getResponse();
  }
1143324
protected void internalUpdateRoleGroup(CmsDbContext dbc, String groupName, CmsRole role)
    throws CmsDataAccessException {

        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(Messages.LOG_DBG_UPDATE_ROLEGROUP_2, role.getRoleName(), groupName));
        }

        CmsGroup group = readGroup(dbc, groupName);
        if ((CmsRole.valueOf(group) == null) || !CmsRole.valueOf(group).equals(role)) {
            CmsGroup roleGroup = readGroup(dbc, role.getGroupName());

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_DBG_UPDATE_ROLEGROUP_1, roleGroup));
            }

            // copy all users from the group to the role
            Iterator<CmsUser> it;
            try {
                // read all users, also indirect assigned
                it = m_driverManager.getUsersOfGroup(dbc, groupName, false, false, false).iterator();
            } catch (CmsException e) {
                // should never happen
                LOG.error(e.getLocalizedMessage(), e);
                // read only direct assigned users
                it = readUsersOfGroup(dbc, groupName, false).iterator();
            }
            while (it.hasNext()) {
                CmsUser user = it.next();

                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_DBG_UPDATE_ROLEGROUP_USER_1, user));
                }
                createUserInGroup(dbc, user.getId(), roleGroup.getId());
            }
            // set the right flags
            group.setFlags(role.getVirtualGroupFlags());
            try {
                writeGroup(dbc, group);
            } catch (Exception e) {
                LOG.error("Could not write group flags in internalUpdateRoleGroup: " + e.getLocalizedMessage(), e);
            }
        }
    }
634436
def update_role(id, name)
      current_path = "/api/v1/roles/#{id}/update"
      payload = { 'new_name' => name }.to_json
      @conn.put(current_path, payload)
    end
719502
@POST
    @Path("{group}/{id}")
    @Consumes(MediaType.APPLICATION_JSON)
    public Response createRole(@PathParam("group") String group, @PathParam("id") String id, EmoRole role,
                                      final @Authenticated Subject subject) {
        checkArgument(role.getId().equals(new EmoRoleKey(group, id)),
                "Body contains conflicting role identifier");
        return createRoleFromUpdateRequest(group, id,
                new CreateEmoRoleRequest()
                        .setName(role.getName())
                        .setDescription(role.getDescription())
                        .setPermissions(role.getPermissions()),
                subject);
    }
346590
public Response updateGroup(GroupEntity group) {
		return restClient.put("groups/" + group.getName(), group, new HashMap<String, String>());
	}
781504
def get_all_role_config_groups(resource_root, service_name,
    cluster_name="default"):
  
  return call(resource_root.get,
      _get_role_config_groups_path(cluster_name, service_name),
      ApiRoleConfigGroup, True, api_version=3)
435920
@Patch("/metadata/{projectName}/tokens/{appId}")
    @Consumes("application/json-patch+json")
    public CompletableFuture<Revision> updateTokenRole(@Param("projectName") String projectName,
                                                       @Param("appId") String appId,
                                                       JsonPatch jsonPatch,
                                                       Author author) {
        final ReplaceOperation operation = ensureSingleReplaceOperation(jsonPatch, "/role");
        final ProjectRole role = ProjectRole.of(operation.value());
        return mds.findTokenByAppId(appId)
                  .thenCompose(token -> mds.updateTokenRole(author, projectName, token, role));
    }
345724
def create_group(self, name):
        
        url = 'rest/api/2/group'
        data = {'name': name}

        return self.post(url, data=data)
1285546
public static authorizationpolicy_aaagroup_binding[] get(nitro_service service, String name) throws Exception{
		authorizationpolicy_aaagroup_binding obj = new authorizationpolicy_aaagroup_binding();
		obj.set_name(name);
		authorizationpolicy_aaagroup_binding response[] = (authorizationpolicy_aaagroup_binding[]) obj.get_resources(service);
		return response;
	}
532644
public static BoxGroup.Info createGroup(BoxAPIConnection api, String name) {
        return createGroup(api, name, null, null, null, null, null);
    }
705202
public static base_response update(nitro_service client, clusternodegroup resource) throws Exception {
		clusternodegroup updateresource = new clusternodegroup();
		updateresource.name = resource.name;
		updateresource.strict = resource.strict;
		return updateresource.update_resource(client);
	}
240979
@RunAsSystem
  public Group getGroup(String groupName) {
    Fetch roleFetch = new Fetch().field(RoleMetadata.NAME).field(RoleMetadata.LABEL);
    Fetch fetch =
        new Fetch()
            .field(GroupMetadata.ROLES, roleFetch)
            .field(GroupMetadata.NAME)
            .field(GroupMetadata.LABEL)
            .field(GroupMetadata.DESCRIPTION)
            .field(GroupMetadata.ID)
            .field(GroupMetadata.PUBLIC)
            .field(GroupMetadata.ROOT_PACKAGE);

    Group group =
        dataService
            .query(GroupMetadata.GROUP, Group.class)
            .eq(GroupMetadata.NAME, groupName)
            .fetch(fetch)
            .findOne();
    if (group == null) {
      throw new UnknownEntityException(
          groupMetadata, groupMetadata.getAttribute(GroupMetadata.NAME), groupName);
    }
    return group;
  }