Skip to content

Instantly share code, notes, and snippets.

@alienrobotwizard
Created December 1, 2014 16:49
Show Gist options
  • Save alienrobotwizard/59ef0717cbcfa440fbbc to your computer and use it in GitHub Desktop.
Save alienrobotwizard/59ef0717cbcfa440fbbc to your computer and use it in GitHub Desktop.
Lipstick java client usage from jruby
import 'com.netflix.lipstick.graph.Graph'
import 'com.netflix.lipstick.graph.Node'
import 'com.netflix.lipstick.graph.Edge'
import 'com.netflix.lipstick.graph.NodeGroup'
import 'com.netflix.lipstick.graph.Status'
import 'com.netflix.lipstick.template.Template'
import 'com.netflix.lipstick.client.Client'
lipstick = Client.new("http://localhost:9292")
graph = Graph.new('1', 'mygraph')
.node(Node.new('a').type('Plain').property('name','A'))
.node(Node.new('b').type('Plain').property('name','B'))
.node(Node.new('c').type('Plain').property('name','C'))
.node(Node.new('d').type('Plain').property('name','D'))
.node(Node.new('e').child('ng1'))
.edge(Edge.new('a','b').label('1'))
.edge(Edge.new('b','c').label('2'))
.edge(Edge.new('b','d').label('3'))
.nodeGroup(NodeGroup.new('ng1')
.url('http://www.netflix.com')
.child('c').child('d')
.status(Status.new().statusText('finished'))
)
template = Template.new('Plain')
.loadView('Plain.js')
.loadTemplate('Plain.mustache')
lipstick.save(graph)
lipstick.saveTemplate(template)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment