|
@@ -57,9 +57,10 @@ EOT
|
|
|
$webservice = $this->getContainer()->get('webservice');
|
|
|
// consulto si hay un DHCP Host para la mac y traigo el HostType
|
|
|
$host = null;
|
|
|
- $hostJSON = $webservice->makeGetRequest($input->getOption('url-get'), HttpRequestInterface::METHOD_GET, [
|
|
|
+ $url = $webservice->buildUrl($input->getOption('url-get'), [
|
|
|
'mac' => $mac,
|
|
|
- ], $credentials);
|
|
|
+ ]);
|
|
|
+ $hostJSON = $webservice->makeGetRequest($url, HttpRequestInterface::METHOD_GET, [], $credentials);
|
|
|
if ($hostJSON != '') {
|
|
|
$host = current(json_decode($hostJSON, true));
|
|
|
}
|
|
@@ -68,9 +69,10 @@ EOT
|
|
|
if (isset($host['hostType'])) {
|
|
|
$hostType = $host['hostType']['id'];
|
|
|
} else {
|
|
|
- $hostTypeJSON = $webservice->makeGetRequest($this->getUrlParameterHostType(), HttpRequestInterface::METHOD_GET, [
|
|
|
+ $url = $webservice->buildUrl($this->getUrlParameterHostType(), [
|
|
|
'name' => 'Cablemodem',
|
|
|
- ], $credentials);
|
|
|
+ ]);
|
|
|
+ $hostTypeJSON = $webservice->makeGetRequest($url, HttpRequestInterface::METHOD_GET, [], $credentials);
|
|
|
if ($hostTypeJSON != '') {
|
|
|
$hostType = current(json_decode($hostTypeJSON, true))['id'];
|
|
|
}
|
|
@@ -86,6 +88,7 @@ EOT
|
|
|
$data = [
|
|
|
'mac' => $mac,
|
|
|
'hostType' => $hostType,
|
|
|
+ 'state' => 'active',
|
|
|
];
|
|
|
|
|
|
$dhcpOptions = $cablemodem->getDHCPOptions();
|