Child pages
  • Manage2 API Functions - Group Update
Skip to end of metadata
Go to start of metadata

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.


Examples


 Browser-based Calls
XML
https://manage2.cpanel.net/XMLgroupUpdate.cgi?ip=127.0.0.1&packageid=008&group=foo
JSON
https://manage2.cpanel.net/XMLgroupUpdate.cgi?output=json&ip=127.0.0.1&packageid=008&group=foo
YAML
https://manage2.cpanel.net/XMLgroupUpdate.cgi?output=yaml&ip=127.0.0.1&packageid=008&group=foo
 cPanel Licensing PHP Class
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("barney@example.com", "12345luggage");

$response = (array)$cpl->updateGroup( array(
	"package"  => "008",
	"oldgroup" => "foobar",
	"group"    => "foo",
	)
);
 cPanel Licensing Perl Module
use cPanelLicensing;
my $licenseManager = new cPanelLicensing(user => 'barney\@example.com', pass => '12345luggage');
my ($status, $reason) = $licenseManager->updateGroup(
	'package'  => '008',
	'oldgroup' => 'foobar', 
	'group'    => 'foo', 
);
 Output (XML)
<XMLgroupUpdate groupid="8" reason="Updated 1 license to the &quot;FOO&quot; group." status="1" />
 Output (JSON)
{"status":1,"reason":"Updated 6 licenses to the \"foo\" group.\n"}
 Output (YAML)
---
reason: "Updated 6 licenses to the \"foo\" group.\n"
status: 1

Parameters

This function requires one of the following parameters:

  • ip
  • package
  • packageid
  • oldgroup
  • oldgroupid

This function also requires either of the following parameters:

  • group
  • groupid
ParameterTypeDescriptionPossible valuesExample
ipstring

The license's IP address.

Notes:

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.

A valid IP address.

Note:

The List License Information function returns a list of possible values.

127.0.0.1
packagestringThe package's name.A valid package name.
ONE-YEAR
packageidinteger

The package's ID number.

A valid package ID.

Note:

The List Package Information function returns a list of possible values.

008
oldgroupstring

The license's current group name.

A valid group name.

foobar
oldgroupidinteger

The license's current group ID number.

A valid group ID.

Note:

The Display Groups function returns a list of possible values.

12345
groupstring

The license's new associated group.

Important:

The group value that you pass must already exist.

A valid group name.foo
groupidinteger

The license's new associated group.

Important:

The groupid value that you pass must already exist.

 A valid group ID.54321 

Returns

ReturnTypeDescriptionPossible valuesExample
reasonstring

License activation information.

A string value.Updated 1 license to the &quot;foo&quot; group.
statusBooleanWhether the system accepts the request as valid.
  • 1 — Valid.

  • 0Not valid.
1