Created attachment 594813 [details] sample JS creating network interface Description of problem: I cannot succeed with adding a Network Interface child resource using CLI. This is probably not an AS7 plugin bug, I'd rather need help with CLI. Version-Release number of selected component (if applicable): RHQ 4.5.0-master How reproducible:always Steps to Reproduce: execute attached JS Actual results: Operation <Operation{operation='add', address=Address{path: =testinterface}, additionalProperties={any-address=true}}> returned unparsable JSON, <"JBAS014701: Invalid resource address element '=testinterface'. The key '' is not valid for an element in a resource address.">., rolled-back=false Expected results: resource gets created. Additional info: I am probably using a bad way to retrieve default configuration for a new resource, thatswhy the request on agent looks awful.
Created attachment 597764 [details] Updated script including res key.
For eap6/as7 the plugin configuration needs to have the 'path' element set to the resource key. The script needed to additionally set the 'path' property in the plugin configuration. If you diff the updated attachment you'll see how that property is added. Closing this issue as not a bug. Will discuss this with heiko and stefan to see if there aren't some things that we can do for plugin and resource configurations across the board for as7 components to make things easier for cli scripting.
Actually the fix is even simpler than my last attachment. The root issue here is that line 47 of the original attachment was not right: plugConfiguration = template.configuration; should be replaced with resType.pluginConfigurationDefinition.defaultTemplate.createConfiguration();
(In reply to comment #3) > Actually the fix is even simpler than my last attachment. The root issue > here is that line 47 of the original attachment was not right: > > plugConfiguration = template.configuration; > > should be replaced with > > > resType.pluginConfigurationDefinition.defaultTemplate.createConfiguration(); plugConfiguration = resType.pluginConfigurationDefinition.defaultTemplate.createConfiguration();