NetXMS Support Forum

Development => General => Topic started by: moseszero on February 06, 2012, 10:46:51 AM

Title: create DCI with Java API
Post by: moseszero on February 06, 2012, 10:46:51 AM
HI,
I'm trying to create a DCI for a Node with Java API(version 1.1.6),and noticed that when create a DCI in Java console,after some DCI's parameter selected, its default information like data type,origin are also specialized dynamically,
how to get these default setting information with Java API or any other advice for creating DCI?

Best regards
Title: Re: create DCI with Java API
Post by: moseszero on February 07, 2012, 04:31:14 AM
 Is the list of all supported DCI to some Node  available using Java API?
Title: Re: create DCI with Java API
Post by: Victor Kirhenshtein on February 07, 2012, 03:01:23 PM
Hi!

Quote from: moseszero on February 07, 2012, 04:31:14 AM
Is the list of all supported DCI to some Node  available using Java API?

Yes, you can use Session.getSupportedParameters call. It accepts node object ID and returns list of parameters supported by that node.

Best regards,
Victor
Title: Re: create DCI with Java API
Post by: Victor Kirhenshtein on February 07, 2012, 03:05:37 PM
Quote from: moseszero on February 06, 2012, 10:46:51 AM
HI,
I'm trying to create a DCI for a Node with Java API(version 1.1.6),and noticed that when create a DCI in Java console,after some DCI's parameter selected, its default information like data type,origin are also specialized dynamically,
how to get these default setting information with Java API or any other advice for creating DCI?

When you use DataCollectionConfiguration.createItem call, new DCI is created with the following default parameters:

origin - agent
data type - integer
polling interval - 60 seconds
retention time - 30 days
status - ACTIVE
delta calculation - none

all other attributes are set to 0, null, or empty string, depending on attribute's type.

You should set all required attributes and call DataCollectionConfiguration.modifyItem.

Best regards,
Victor
Title: Re: create DCI with Java API
Post by: moseszero on February 08, 2012, 02:28:38 AM
Thank you very much!