metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From justinleet <>
Subject [GitHub] metron pull request #673: METRON-1069: Ambari MPack documentation around dev...
Date Thu, 27 Jul 2017 15:15:08 GMT
Github user justinleet commented on a diff in the pull request:
    --- Diff: metron-deployment/packaging/ambari/ ---
    @@ -0,0 +1,86 @@
    +# Ambari Management Pack Development
    +Typically, Ambari Management Pack development will be done in the Vagrant environments.
These instructions are specific to Vagrant, but can be adapted for other environemnts (e.g.
make sure to be on the correct nodes for server vs agent files)
    +# Adding a new property
    +1. Add the property to the appropriate `*-env.xml` file found in `METRON.CURRENT/configuration`.
    +  ```
    +    <property>
    +        <name>new_property</name>
    +        <description>New Property description</description>
    +        <value>Default Value</value>
    +        <display-name>New Property Pretty Name</display-name>
    +    </property>
    +  ```
    +2.  Reference the property in `METRON.CURRENT/package/scriptes/params/`,
unless it will be used in Ambari's status command.  It will be stored in a variable. The name
doesn't have to match, but it's preferred that it does.
    +Make sure to use replace `metron-env` the correct `*-env` file, as noted above.
    +  ```
    +  new_property = config['configurations']['metron-env']['new_property']
    +  ```
    +If this property will be used in the status command, instead make this change in `METRON.CURRENT/package/scriptes/params/`.
    +Afterwards, in ``, reference the new property:
    +  ```
    +  new_property = status_params.new_property
    +  ```
    +This behavior is because Ambari doesn't send all parameters to the status, so it needs
to be explicitly provided.
    +3. Ambari master services can then import the params as such
    +  ```
    +  from params import params
    +  env.set_params(params)
    +  ```
    +4. The `*` files receive the params as an input from the master services.
 Once this is done, they can be accessed via the variable we set above:
    +  ```
    +  self.__params.new_property
    +  ```
    +  Ambari also has a custom `format` function that can access properties when producing
strings as output:
    --- End diff --
    I completely forgot they existed.  I'll throw in some details around them.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message