Forked from VinceMacBuche/a-guide-to-ncf-api.txt
Last active
September 11, 2015 12:53
-
-
Save frbayart/2aa9e5fe2423232e32ab to your computer and use it in GitHub Desktop.
Api ncf-builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to get techniques from a ncf api | |
You actually need the jsessionid cookie from your navigator (log in to Rudder and inspect your cookie), I will add authentication via rudder api token very soon | |
curl 'https://server.rudder/ncf/api/techniques?path=/var/rudder/configuration-repository/ncf' -k --cookie "JSESSIONID=Valueofyourcookie" | |
To send a technique to a server (see file api.json for exact content): | |
curl -X PUT 'https://server.rudder/ncf/api/techniques' -k --cookie "JSESSIONID=cookie" -d @api.json -v -H "Content-Type: application/json" | |
Here is a json extract of a technique: | |
"Install_Tomcat": { | |
"bundle_args": [], | |
"bundle_name": "Install_Tomcat", | |
"description": "Allows to install Tomcat from the main site", | |
"method_calls": [ | |
{ | |
"args": [ | |
"http://mirrors.ircam.fr/pub/apache/tomcat/tomcat-7/v7.0.63/bin/apache-tomcat-7.0.63.tar.gz", | |
"/var/tomcat/apache-tomcat-7.0.63.tar.gz" | |
], | |
"class_context": "any", | |
"method_name": "http_download" | |
}, | |
{ | |
"args": [ | |
"/var/tomcat/apache-tomcat-7.0.63" | |
], | |
"class_context": "any", | |
"method_name": "file_check_exists" | |
}, | |
{ | |
"args": [ | |
"/bin/tar xzf /var/tomcat/apache-tomcat-7.0.63.tar.gz -C /var/tomcat" | |
], | |
"class_context": "file_check_exists__var_tomcat_apache_tomcat_7_0_63_error|http_download_http___mirrors_ircam_fr_pub_apache_tomcat_tomcat_7_v7_0_63_bin_apache_tomcat_7_0_63_tar_gz_repaired", | |
"method_name": "command_execution" | |
}, | |
{ | |
"args": [ | |
"tomcat" | |
], | |
"class_context": "any", | |
"method_name": "service_check_running_ps" | |
}, | |
{ | |
"args": [ | |
"/var/tomcat/apache-tomcat-7.0.63/bin/catalina.sh start" | |
], | |
"class_context": "service_check_running_tomcat_error|command_execution__bin_tar_xzf__var_tomcat_apache_tomcat_7_0_63_tar_gz_repaired", | |
"method_name": "command_execution" | |
} | |
], | |
"name": "Install Tomcat", | |
"version": "1.0" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"path" : "/var/rudder/configuration-repository/ncf" | |
, "technique": { | |
"bundle_args": [], | |
"bundle_name": "Install_Tomcat", | |
"description": "Allows to install Tomcat from the main site", | |
"method_calls": [ | |
{ | |
"args": [ | |
"http://mirrors.ircam.fr/pub/apache/tomcat/tomcat-7/v7.0.63/bin/apache-tomcat-7.0.63.tar.gz", | |
"/var/tomcat/apache-tomcat-7.0.63.tar.gz" | |
], | |
"class_context": "any", | |
"method_name": "http_download" | |
}, | |
{ | |
"args": [ | |
"/var/tomcat/apache-tomcat-7.0.63" | |
], | |
"class_context": "any", | |
"method_name": "file_check_exists" | |
}, | |
{ | |
"args": [ | |
"/bin/tar xzf /var/tomcat/apache-tomcat-7.0.63.tar.gz -C /var/tomcat" | |
], | |
"class_context": "file_check_exists__var_tomcat_apache_tomcat_7_0_63_error|http_download_http___mirrors_ircam_fr_pub_apache_tomcat_tomcat_7_v7_0_63_bin_apache_tomcat_7_0_63_tar_gz_repaired", | |
"method_name": "command_execution" | |
}, | |
{ | |
"args": [ | |
"tomcat" | |
], | |
"class_context": "any", | |
"method_name": "service_check_running_ps" | |
}, | |
{ | |
"args": [ | |
"/var/tomcat/apache-tomcat-7.0.63/bin/catalina.sh start" | |
], | |
"class_context": "service_check_running_tomcat_error|command_execution__bin_tar_xzf__var_tomcat_apache_tomcat_7_0_63_tar_gz_repaired", | |
"method_name": "command_execution" | |
} | |
], | |
"name": "Install Tomcat", | |
"version": "1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment