Bug 787221 - Methods in Drift.js are not in CLI API Doc
Methods in Drift.js are not in CLI API Doc
Product: RHQ Project
Classification: Other
Component: Documentation (Show other bugs)
Unspecified Unspecified
high Severity medium (vote)
: ---
: ---
Assigned To: Deon Ballard
Mike Foley
: Improvement
Depends On: 751248
Blocks: jon30-sprint9 jon30-sprint8
  Show dependency treegraph
Reported: 2012-02-03 10:36 EST by Mike Foley
Modified: 2012-02-14 12:19 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 751248
Last Closed: 2012-02-14 12:19:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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


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@redhat.com 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 -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@redhat.com on 2011-11-18 12:19:27 EST ---

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

--- Additional comment from ian.springer@redhat.com 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@redhat.com on 2011-11-29 11:49:30 EST ---

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

--- Additional comment from ccrouch@redhat.com 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@redhat.com 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.

Author: Lukas Krejci <lkrejci@redhat.com>
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@redhat.com 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.

Author: Lukas Krejci <lkrejci@redhat.com>
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
Comment 1 Deon Ballard 2012-02-14 12:19:26 EST
DriftManager.generateUnifiedDiff is in the remote API here:

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.