-
Notifications
You must be signed in to change notification settings - Fork 89
[BROOKLYN-177] wip: drag and drop support for yaml editor #930
base: master
Are you sure you want to change the base?
Conversation
|
The following known issues:
is: services: [{ type: org.apache.brooklyn.entity.brooklynnode.BrooklynEntityMirror }]should be: - type: org.apache.brooklyn.entity.brooklynnode.BrooklynEntityMirroror even: services:
- type: org.apache.brooklyn.entity.brooklynnode.BrooklynEntityMirrorTo make the drop event context dependent (exists or not the services:), then, a javascript yaml (blueprint) parser should be created (like [1]). It should understand CAMP syntax. References: |
|
btw Brooklyn already has a YAML parser included - https://github.com/nodeca/js-yaml, see
|
|
What I meant, is a Brooklyn Blueprint parser, based on js-yaml. The context belongs to CAMP semantics. What is your thought? |
|
It's in the context of your reference to http://www.json2yaml.com/, js-yaml can do the conversion from json to yaml. |
|
@morganbrooke can you take a look at this, please? |
|
some more example how it should happen when you do drop ... # Please add your blueprint here
services:
- type: org.apache.brooklyn.entity.database.mariadb.MariaDbNode
# broklyn.config:
# - activemq.brokerName: localhost
# activemq.install.mirror.url: http://www.mirrorservice.org/sites/ftp.apache.org/activemq
# activemq.jetty.port: 8161
# activemq.templateConfigurationUrl: config/activemq.xmlor even: # Please add your blueprint here
services:
- type: org.apache.brooklyn.entity.database.mariadb.MariaDbNode
broklyn.config:
- activemq.brokerName: localhost
activemq.install.mirror.url: http://www.mirrorservice.org/sites/ftp.apache.org/activemq
activemq.jetty.port: 8161
activemq.templateConfigurationUrl: config/activemq.xmlThe rest API returns the weird text in the Any of your thoughts? |
|
So if I'm understanding this correctly, I think you just need to use JSON.parse method and then stringify the YAML in the JavaScript. |
|
npm install json2yaml is a package manager that allows this fairly easily it looks like: |
|
Please take a look at the String you want to parse, stringify. It needs to be a valid JSON first. Either we modify the REST or we fix it in javascript. Any ideas? |
|
I see what you're saying, let me check out a few options. |
which will spit out: Both of them are YAML, the latter one being idiomatic. But the
|
|
Wow, great work @neykov! |
|
@azbarcea any update on this? |



No description provided.