Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Reference/Common/Library/device_rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function _device_create ($customer_id, $device_name, $manufacturer_id,
'mailAlerting' => $mail_alerting,
'reporting' => $reporting,
'managementAddress' => $management_address,
'managementPort' => $managementPort,
'externalReference' => $device_external_reference,
'snmpCommunity' => $snmp_community,
'hostname' => $hostname,
Expand Down Expand Up @@ -165,9 +166,8 @@ function _device_read_by_reference ($device_reference) {
* @param $device_id
*/
function _device_get_hostname_by_id ($device_id) {
//$msa_rest_api = "device/v1/hostname/{$device_id}";
$msa_rest_api = "device/v2/{$device_id}";

$msa_rest_api = "device/v1/hostname/{$device_id}";

$curl_cmd = create_msa_operation_request(OP_GET, $msa_rest_api);
$response = perform_curl_operation($curl_cmd, "READ DEVICE HOSTNAME BY ID");
$response = json_decode($response, true);
Expand All @@ -188,7 +188,6 @@ function _device_get_hostname_by_id ($device_id) {
*/
function _device_set_hostname_by_id ($device_id, $hostname) {
$msa_rest_api = "device/v1/{$device_id}/hostname/{$hostname}";

$curl_cmd = create_msa_operation_request(OP_PUT, $msa_rest_api);
$response = perform_curl_operation($curl_cmd, "SET DEVICE HOSTNAME BY ID");
return $response;
Expand Down