Hi Brooklyn experts
I'm trying to create a cluster where each instance has a unique id that I
can feed to the process during the customize and launch stages, so I
thought of using the entity's own ID. I've tried many ways to get the id
just before customize, but none of them work. The entity in question is
of type VanillaJavaApp
Here's one example
This one fails giving "Cannot coerce type
org.apache.brooklyn.core.sensor.BasicAttributeSensor to java.lang.String
(Sensor: entity.id (java.lang.String)): no adapter known" which I think
means that the sensor isn't avalable at the moment it is evaluated. Ok
that makes sense, but see the other examples I've tried below.....
name: htsuite
description: testserver
location: localhost
services:
- id: client_cluster
type: org.apache.brooklyn.entity.group.DynamicCluster
brooklyn.config:
cluster.initial.size: 2
dynamiccluster.memberspec:
$brooklyn:entitySpec:
type: htclienttemplate:1.4
name: client
customize.command: |
sudo mkdir
$brooklyn:formatString("/Users/peterabramowitsch/manhattan/%s",
*$brooklyn:sensor("entity.id
<http://entity.id>") *)
brooklyn.config:
clientname: *$brooklyn:sensor("entity.id <http://entity.id>") *
rundir:
$brooklyn:formatString:
- /Users/peterabramowitsch/manhattan/%s
- *$brooklyn:sensor("entity.id <http://entity.id>")*
resturl:
$brooklyn:formatString:
-
http://127.0.0.1:8081/v1/applications/infocommons-composed/entities/%s/sensors
- *$brooklyn:sensor("entity.id <http://entity.id>")*
I have also tried
*$brooklyn:component("this","id")*
* $brooklyn:component("this").attributeWhenReady("id")*
* $brooklyn.id <http://brooklyn.id>*
* $brooklyn:config("id")*
* id*