Bug 835940 - [eap6] adding a network interface using CLI
Summary: [eap6] adding a network interface using CLI
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI, Plugins
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: JON 3.1.1
Assignee: Simeon Pinder
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-27 15:12 UTC by Libor Zoubek
Modified: 2015-11-02 00:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-12 11:07:28 UTC
Embargoed:


Attachments (Terms of Use)
sample JS creating network interface (2.83 KB, application/x-javascript)
2012-06-27 15:12 UTC, Libor Zoubek
no flags Details
Updated script including res key. (3.01 KB, application/x-javascript)
2012-07-12 10:57 UTC, Simeon Pinder
no flags Details

Description Libor Zoubek 2012-06-27 15:12:14 UTC
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.

Comment 1 Simeon Pinder 2012-07-12 10:57:51 UTC
Created attachment 597764 [details]
Updated script including res key.

Comment 2 Simeon Pinder 2012-07-12 11:07:28 UTC
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.

Comment 3 Simeon Pinder 2012-07-12 15:18:05 UTC
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();

Comment 4 Simeon Pinder 2012-07-12 15:19:20 UTC
(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();


Note You need to log in before you can comment on or make changes to this bug.