Skip to content

Instantly share code, notes, and snippets.

@ranrubin
Created June 7, 2019 12:55
Show Gist options
  • Save ranrubin/873b19ca1f682b53a0cffff52a40f89a to your computer and use it in GitHub Desktop.
Save ranrubin/873b19ca1f682b53a0cffff52a40f89a to your computer and use it in GitHub Desktop.
package org.foo
def register(String path, String data){
return sh (script: "curl -X PUT -H 'Content-Type: application/json' ${path}/catalog/register -d \'$data\'", returnStdout: true)
}
def store(String path, String key_path, String data){
return sh (script: "curl -X PUT -H 'Content-Type: application/json' ${path}/${key_path} -d \'${data}\'", returnStdout: true)
}
def list_nodes(String path){
return sh (script: "curl -X GET ${path}/catalog/nodes", returnStdout: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment