brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svetoslav Neykov <svetoslav.ney...@cloudsoftcorp.com>
Subject [Proposal] Passing complex objects in shell.env
Date Mon, 20 Jun 2016 13:14:29 GMT
Working on YAML-only blueprints I've hit a restriction where the only possible configuration
type that users can pass to my blueprint is a string. Anything more complex gets its "toString()"
method called and thus is impossible to reconstruct cleanly on the bash side.

I suggest that we serialize complex objects to JSON before passing them as environment variables
to scripts. This will allow for blueprints like the following:

brooklyn.catalog:
  id: mapping-entity
  item:
    type: VanillaSoftwareProcess
    env:
      MAPPINGS: $brooklyn:config("mappings")

---

services:
- type:  mapping-entity
  brooklyn.config:
    mappings:
      key1: val1
      key2: val2


---

On the bash side this results in an environment variable MAPPINGS={"key1":"val1","key2":"val2"}
which is easily manipulated with jq binary.


I've implemented the change in https://github.com/apache/brooklyn-server/pull/208 <https://github.com/apache/brooklyn-server/pull/208>.

Svet.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message