|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.event.feed.AbstractFeed
brooklyn.entity.chef.ChefAttributeFeed
public class ChefAttributeFeed extends AbstractFeed
A sensor feed that retrieves attributes from Chef server and converts selected attributes to sensors.
To use this feed, you must provide the entity, the name of the node as it is known to Chef, and a collection of attribute sensors. The attribute sensors must follow the naming convention of starting with the string chef.attribute. followed by a period-separated path through the Chef attribute hierarchy. For example, an attribute sensor named chef.attribute.sql_server.instance_name would cause the feed to search for a Chef attribute called sql_server, and within that an attribute instance_name, and set the sensor to the value of this attribute.
This feed uses the knife tool to query all the attributes on a named node. It then iterates over the configured list of attribute sensors, using the sensor name to locate an equivalent Chef attribute. The sensor is then set to the value of the Chef attribute.
Example:
@Override protected void connectSensors() { nodeAttributesFeed = ChefAttributeFeed.newFeed(this, nodeName, new AttributeSensor[]{ SqlServerNode.CHEF_ATTRIBUTE_NODE_NAME, SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_INSTANCE_NAME, SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_PORT, SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_SA_PASSWORD ); } }Nested Class Summary | |
---|---|
static class |
ChefAttributeFeed.Builder
|
Field Summary | |
---|---|
static java.lang.String |
CHEF_ATTRIBUTE_PREFIX
Prefix for attribute sensor names. |
Fields inherited from class AbstractFeed | |
---|---|
entity, poller |
Method Summary | |
---|---|
protected java.lang.Object
|
ChefAttributeFeed(ChefAttributeFeed.Builder builder)
|
static ChefAttributeFeed.Builder
|
builder()
|
protected void
|
preStart()
|
Methods inherited from class AbstractFeed | |
---|---|
getEntity, isActivated, isActive, isConnected, postStop, preStart, preStop, resume, start, stop, suspend |
Field Detail |
---|
public static final java.lang.String CHEF_ATTRIBUTE_PREFIX
Method Detail |
---|
protected java.lang.Object ChefAttributeFeed(ChefAttributeFeed.Builder builder)
public static ChefAttributeFeed.Builder builder()
@Override protected void preStart()
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.