AnsweredAssumed Answered

argument type mismatch in class model.RequestBody6

Question asked by Johnny Koen on Apr 17, 2017
Latest reply on Apr 19, 2017 by Kota Saito

Hi All,

 

In my attempt to create a GAD provisioning service template using CM Rest JavaScript plug I’m getting an error which I’m not sure how to resolve.

 

The error I’m getting is marked in bold below line 87:

9932 2017/04/14 15:53:56.153     Automation       2BA45490 0D9489EE KNAE08274-E      ER   An unexpected error occurred while running the specified JavaScript code.(details: Wrapped java.lang.IllegalArgumentException: argument type mismatch (scriptBody#87)) The specified JavaScript code was reviewed, but an unexpected error occurred during the execution. Revise the javascript code specified in the body of the script, and then run the service again.

 

Actual Code snippit

###########################################

//Delete Virtual LdevID

  var delVirtLdevReqBody = new model.RequestBody6();

  var delVirtLdevParam = new model.LDEVREQUESTVIRTUALLDEVIDUNASSIGNACTION();

  delVirtLdevParam.setVirtualLdevId(parseInt(ldevID));

  print("[Debug] " + logID + " > Delete Virtual LDEVID: " + " PoolID: " + poolID + ", Ldev ID: " + ldevID + ", ByteFormatCapacity: " + byteFormatCapacity);

  print("[Debug] " + logID + delVirtLdevReqBody);

  print("[Debug] " + logID + delVirtLdevParam);

  delVirtLdevReqBody.setParameters(delVirtLdevParam);   /*######### This is scriptBody#87 ############*/

  var delVirtLdevRet = client.v1.objects.storages.storageDeviceID.ldevs.ldevId.actions.unassignVirtualLdevid.invoke.put(storageDeviceID,ldevID,delVirtLdevReqBody,null,"Completed");

  jobStatus(delVirtLdevRet,"Delete Virtual LdevID");

###########################################

 

 

The part of code which I’m unsure about and also found no documentation for is:

  var delVirtLdevReqBody = new model. RequestBody6 ();

I see there are many RequestBody classes. I have used  RequestBody6() class with expanding a virtual ldev. In the expanding of a virtual ldev the class LDEVREQUESTLDEVEXPANDACTION requires a String

//Expand LDEV code which is working

var req = new model.RequestBody6();

var param = new model.LDEVREQUESTLDEVEXPANDACTION();

param.setAdditionalByteFormatCapacity("10G");

req.setParameters(param);

 

//This is the code for Delete virtual ldevID which is not working

//In the deleting of the virtual ldev ID the class LDEVREQUESTVIRTUALLDEVIDUNASSIGNACTION requires a Integer

var req = new model.RequestBody6();

var param = new model.LDEVREQUESTVIRTUALLDEVIDUNASSIGNACTION();

param.setVirtualLdevId(parseInt(4097));

req.setParameters(param);  /*This is where it fails with argument type mismatch as mentioned above. My assumption is that its due to RequestBody6 class I'm using */

 

Any help would be greatly appreciated

 

Kind Regards

Johnny Koen

Outcomes