Bug 787221 - Methods in Drift.js are not in CLI API Doc
Summary: Methods in Drift.js are not in CLI API Doc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: RHQ Project
Classification: Other
Component: Documentation
Version: 3.0.1
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Deon Ballard
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 751248
Blocks: jon30-sprint9 jon30-sprint8
TreeView+ depends on / blocked
 
Reported: 2012-02-03 15:36 UTC by Mike Foley
Modified: 2012-02-14 17:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 751248
Environment:
Last Closed: 2012-02-14 17:19:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike Foley 2012-02-03 15:36:24 UTC
+++ This bug was initially created as a clone of Bug #751248 +++  Methods in Drift.js are not in CLI API Doc.   Specifically:

DriftManager.getDriftFileAsByteArray
DriftManager.generateUnifiedDiff



The following are the steps to test the required CLI script. The needed script itself is mentioned in step 4) below:

1) Create a bundle containing an EAP instance
2) Provision that bundle to a platform
3) Setup drift to monitor that EAP instance
*4) Create a CLI script which redeploys the bundle from step 1, returning the EAP instance to its original state
5) Setup an alert to trigger when drift is detected, and have the script from step 4 be fired when the alert triggers
6) Update the EAP instance, thus triggering drift, and watch as the script reprovisions the EAP instance.

--- Additional comment from ian.springer on 2011-11-18 12:18:00 EST ---

1) Create an EAP 5.1.1 bundle using a script I wrote, which has been checked into master at etc/scripts/create-jbossas-bundle.sh. The script is run as follows:

create-jbossas-bundle.sh jboss-eap-5.1.1.zip

where jboss-eap-5.1.1.zip is the EAP 5.1.1 dist zipfile. This outputs a bundle distribution zipfile named jboss-eap-5.1.1-bundle.zip.

2) Use the bundle create wizard in the GUI to create a bundle from jboss-eap-5.1.1-bundle.zip. Create a compat group containing one or more platforms. Create a bundle destination containing the platforms group with a deploy dir of "/tmp/jboss-eap-5.1.". Deploy the bundle to this bundle destination. For each platform:

 a) uncomment the admin=admin line in /tmp/jboss-eap-5.1.1/server/production/conf/props/jmx-console-users.properties.
 b) start the EAP server: /tmp/jboss-eap-5.1.1/bin/run.sh -b 127.0.0.51 -c production
 c) wait for the EAP server to fully start, then run "discovery -f" at that platform's agent prompt to discover the new EAP server
 d) from the GUI, import the newly discovered EAP server resource

3) for each of the EAP server resources, create a drift definition based off the base files template (this def will monitor the bin, common, and lib dirs for drift)

4) Setup an alert on the EAP server resource that triggers when drift is detected. Add a notification of type 'CLI script' and upload the attached fix-bundle-deployment.js script.

5) Manually modify some file under the bin directory of one of the EAP servers (e.g. add the line "######## BLAH ########" to bin/classpath.sh). Select the drift definition for the corresponding EAP server resource and click the Detect Now button. Wait for the drift definition to report it is Out of Compliance (should only take a minute or so). Wait for the alert defined in step 4 to fire. Watch as the script reprovisions the EAP instance.

--- Additional comment from ian.springer on 2011-11-18 12:19:27 EST ---

Created attachment 534456 [details]
RHQ-server script that redeploys a bundle

--- Additional comment from ian.springer on 2011-11-18 12:22:10 EST ---

Note, for step 4, before you upload fix-bundle-deployment.js, you will need to edit the following two lines in that file and set them to the destination ID and bundle version ID corresponding to the destination and bundle version you created in step 2:

var destinationId = 10002;
var bundleVersionId = 10002;

--- Additional comment from mfoley on 2011-11-29 11:49:30 EST ---

changing priority to low ... sample script ... no impact on runtime

--- Additional comment from ccrouch on 2011-11-30 14:45:15 EST ---

It doesn't impact the run time, but I've asked Lukas to test it out and make it available under /downloads from the JON server, so that people who want it can grab it.

--- Additional comment from lkrejci on 2011-12-01 11:15:44 EST ---

The change is in master.

The script is downloadable from the server and the Administration/Downloads page was updated to contain it (more scripts are automatically picked up if placed in the same location).

I also slightly updated the script to contain more guiding documentation.

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=4ef245611000d6b7f72d2e6ed27b8211315d427b
Author: Lukas Krejci <lkrejci>
Date:   Thu Dec 1 14:50:06 2011 +0100

    [BZ 751248] - Make the sample CLI alert scripts downloadable from the server's /download/cli-alert-scripts location and from the Downloads section of the GUI.

--- Additional comment from lkrejci on 2011-12-02 11:12:49 EST ---

release_jon3.x contains only the script and makes it accessible for download. The UI changes were left out from the release. The location of the script is only to be mentioned in the documentation.

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=f6cd36125fe0805161caec0ac24b5b8c8a94ef17
Author: Lukas Krejci <lkrejci>
Date:   Fri Dec 2 17:01:58 2011 +0100

    [BZ 751248] - in JON 3.0.0 we are going to make the script downloadable but
    will provide no UI for accessing it. The script can be downloaded from
    http(s)://<JON_DOMAIN>:<JON_PORT>/downloads/cli-alert-scripts/fix-bundle-deployment.js

Comment 1 Deon Ballard 2012-02-14 17:19:26 UTC
DriftManager.generateUnifiedDiff is in the remote API here:
http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/100/html/API/remote-api/org/rhq/enterprise/server/drift/DriftManagerRemote.html

DriftManager.getDriftFileAsByteArray is missing, but the issue is covered in bug 786224.


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