Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 193504

Re: Create vCAC entity using vCAC plugin? Issue with LocalDateTime?

$
0
0

Hi,

 

from the provided code snippet, I cannot see the types of the input properties you're using, but according to the error message, you're trying to convert a string value to a date which the plug-in will not do automatically for you. The way this is designed to work is by using the Date type of vCO. Here's an example which is verified to work:

 

var modelName = 'ManagementModelEntities.svc';

var entitySetName = "UserLogs";

 

var links = null;

var headers = null;

var inputProperties = new Properties();

 

//one way of doing this is by constructing the Date by yourself, check the API for more details.

var date = new Date();

 

//another way is by using an input parameter of type Date (presentation or attribute), in this case 'inputParameterDate' is of type Date and is populated from the workflow presentation.

var date = inputParameterDate;

 

inputProperties.put("UserName", "user@vmware.com");

inputProperties.put("Message", "Some logs");

inputProperties.put("Type", 0);

inputProperties.put("Timestamp", date);

var rEntity = vCACEntityManager.createModelEntity(host.id, modelName, entitySetName, inputProperties, links, headers);

 

Hope that helps.


Viewing all articles
Browse latest Browse all 193504

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>