-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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.BrooklynEntityMirror or even: services:
- type: org.apache.brooklyn.entity.brooklynnode.BrooklynEntityMirror To 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.xml or 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.xml The 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.