Manage2 API Function - Group Update

Last modified: May 20, 2024


Description

This function associates a license or collection of licenses with a group.

Note:
  • We introduced this function in cPanel License (CPL) client library version 3.8.
  • You cannot use this function to associate a Group Limited user. To set a user’s group permissions, use Manage2’s Edit Users interface.

Examples

XML

https://manage2.cpanel.net/XMLgroupUpdate.cgi?ip=192.0.2.0&packageid=008&group=ExampleGroup

JSON

https://manage2.cpanel.net/XMLgroupUpdate.cgi?output=json&ip=192.0.2.0&packageid=008&group=ExampleGroup

YAML

https://manage2.cpanel.net/XMLgroupUpdate.cgi?output=yaml&ip=192.0.2.0&packageid=008&group=ExampleGroup

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("[email protected]", "123456luggage");

$response = (array)$cpl->updateGroup( array(
    "package"  => "008",
    "oldgroup" => "test",
    "group"    => "ExampleGroup",
    )
);

1
2
3
4
5
6
7
use cPanelLicensing;
my $licenseManager = new cPanelLicensing(user => 'username\@example.com', pass => '123456luggage');
my ($status, $reason) = $licenseManager->updateGroup(
    'package'  => '008',
    'oldgroup' => 'test',
    'group'    => 'ExampleGroup',
);

<XMLgroupUpdate groupid="8" reason="Updated 1 license to the &quot;ExampleGroup&quot; group." status="1" />

1
2
3
4
{
  "status": 1,
  "reason": "Updated 6 licenses to the \"ExampleGroup\" group.\n"
}

1
2
3
---
status: 1
reason: 'Updated 6 licenses to the \"ExampleGroup\" group.'

Parameters

Important:

This function requires one of the following parameters:

  • ip
  • package
  • packageid
  • oldgroup
  • oldgroupid

This function also requires either of the following parameters:

  • group
  • groupid

This function accepts the following parameters:

Parameter Type Description Example
ip string Required
The license’s IP address. The Manage2 List License Information function returns a list of possible values.
Note:
If both cPanel and CloudLinux™ licenses exist on the named IP, this function updates both licenses. To update a single license type, you must specify additional parameters.
192.0.2.0
package string The package’s name. ONE-YEAR
packageid integer The package’s ID number. The Manage2 List Package Information function returns a list of possible values. 008
oldgroup string The license’s current group name. The Manage2 Display Groups function returns a list of possible values. test
oldgroupid integer The license’s current group ID number. The Manage2 Display Groups function returns a list of possible values. 12345
group string The license’s new associated group. The Manage2 Display Groups function returns a list of possible values.
Note:
The group value that you pass must already exist.
ExampleGroup
groupid integer The license’s new associated group’s ID. The Manage2 Display Groups function returns a list of possible values.
Note:
The groupid value that you pass must already exist.
54321

Returns

This function returns the following values:

Return Type Description Example
reason string License activation information. Updated 1 license to the &quot;ExampleGroup&quot; group.
status Boolean Whether the system accepts the request as valid:
  • 1 — Valid.
  • 0 — Not valid.
1

Additional Documentation