Bug 835940 - [eap6] adding a network interface using CLI
[eap6] adding a network interface using CLI
Status: CLOSED NOTABUG
Product: RHQ Project
Classification: Other
Component: CLI, Plugins (Show other bugs)
4.4
Unspecified Unspecified
high Severity high (vote)
: ---
: JON 3.1.1
Assigned To: Simeon Pinder
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 11:12 EDT by Libor Zoubek
Modified: 2015-11-01 19:43 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-12 07:07:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Libor Zoubek 2012-06-27 11:12:14 EDT
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 06:57:51 EDT
Created attachment 597764 [details]
Updated script including res key.
Comment 2 Simeon Pinder 2012-07-12 07:07:28 EDT
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 11:18:05 EDT
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 11:19:20 EDT
(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.