Allocate Command Devices with Email Notification

Document created by Hidenori Akatoki on Aug 22, 2016Last modified by Hidenori Akatoki on Aug 22, 2016
Version 4Show Document
  • View in full screen mode

Overview

Use this service template to allocate command devices. Who likes allocating cmd devices?

Service TemplateDescription
Allocate Command Devices with Email NotificationAllocates command devices and notifies by email

 

Download

VersionFile (With Link)DescriptionVendor IDHAD versionCreated date
01.20.40DownloadAllocates command devices and notifies by emailHDSV8.2.1-00Dec 9, 2015

 

How to use

Import.

Create Service.

 

Detailed Information

 

Configure Service


Create Request

 

 

Javascript Plug-in parseDeviceID.js

(function(serviceProperties, pluginProperties, arg0, arg1, arg2)
{
var obj = new Object();
print("[Debug] Function begin.");
obj.mem1 = arg0;
if (arg0 == "" ) {
pluginProperties["notify"] = 999;
pluginProperties["out1"] = "Not enough arguments"
} else {
var count = 0;
var i;
var s = "";
var allocated = [];
for (var i in arg0["values"]) {
  if (arg0["values"][i].hasOwnProperty("deviceId")) {
   count++;
   s = s + arg0["values"][i]["deviceId"] + ",";
   allocated.push(arg0["values"][i]["deviceId"]);
   pluginProperties["out1"] = arg0["values"][i]["storageSystemType"];
   pluginProperties["out2"] = arg0["values"][i]["storageSystemSerialNumber"]
  }
}
count = count.toFixed(0);
s = s.replace(/,\s*$/, "");
pluginProperties["out0"] = s;
pluginProperties["out3"] = count;
pluginProperties["out4"] = allocated;
obj.status = "success";
}
print("[Debug] Function end.");
return obj;
})
      

Outcomes