Bug 580243
| Summary: | RFE: Need a way for the CLI to perform Manual Addition of resources. | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | Jay Shaughnessy <jshaughn> |
| Component: | CLI | Assignee: | Jay Shaughnessy <jshaughn> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Sudhir D <sdharane> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 1.3pre | CC: | cwelton |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | 2.4 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-08-12 16:53:50 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 577047, 578348 | ||
|
Description
Jay Shaughnessy
2010-04-07 19:43:43 UTC
We need this to fully support the alerts firing a script use case, since people may need to inventory lots of existing scripts Added to Remote API, DiscoveryBossRemote:
Resource manuallyAddResource(Subject subject,
int resourceTypeId,
int parentResourceId,
Configuration pluginConfiguration)
throws Exception
Manually Add the resource of the specified type to inventory using the specified plugin configuration (i.e. connection properties). This will not only create a new resource, but it will also ensure the resource component is activated (and thus connects to the managed resource).
Parameters:
subject - the user making the request
resourceTypeId - the type of resource to be manually discovered
parentResourceId - the id of the resource that will be the parent of the manually discovered resource
pluginConfiguration - the properties that should be used to connect to the underlying managed resource
Returns:
The resource. Note that the resource may have existed already if given the provided pluginConfiguration leads to a previously defined resource.
Throws:
Exception - if connecting to the underlying managed resource failed due to invalid plugin configuration or if the manual discovery fails for any reason.
Pushing this old issue to ON_QA Script for testing:
- Requires at least one platform in inventory.
Manually adds a Script Server resource to a platform.
var c = new ResourceCriteria();
c.addFilterResourceCategory(ResourceCategory.PLATFORM);
platforms = ResourceManager.findResourcesByCriteria(c);
var parentId = platforms.get(0).getId();
var c = new ResourceTypeCriteria();
c.addFilterName("Script Server");
var types = ResourceTypeManager.findResourceTypesByCriteria(c);
var typeId = types.get(0).getId();
var config = new Configuration();
var property = new PropertySimple("executable", "/temp/fake.sh");
config.put( property );
var newResource = DiscoveryBoss.manuallyAddResource(typeId, parentId, config);
Assert.assertNotNull( newResource );
Assert.assertTrue( newResource.getId() > 0 );
QA Verified. I am sure we can do an in-depth check of methods that this function can call, but for now the call itself is there and seems usable. Mass-closure of verified bugs against JON. |