[rudder-dev] Relay API

Nicolas Charles nicolas.charles at normation.com
Fri Nov 18 10:17:54 CET 2016


Hello Benoit,

Thank you for the details, I simply have one question, inline

Le 04/11/2016 à 17:38, Benoit Peccatte a écrit :
>
> Hello,
>
> One of Rudder 4.1 new features will be relay APIs. This is the first 
> attempt to describe it.
>
> There are currently 2 API entries we want to add: remote-run and 
> share-files.
> They will both be under /rudder/relay-api itself under 
> https://<server>:<port>/ like the current api is.
> /rudder is the common root for all rudder service
> /relay-api is different from existing api to avoid conflicts with them 
> when it will be installed on the server
>
>
> 1. Remote-run:
>
> The goal is to make a given relay call "rudder remote run" on one of 
> its attached node
> The API will be under /rudder/relay-api/remote-run
> GET remote-run/node/<node-uuid>
> GET remote-run/all
> GET remote-run/nodes
>
> Parameters:
> - output = keep / discard : to keep the output of the remote-run call 
> or discard its content
> - async = yes / no : yes to ignore the return code of the call and 
> return immediately, no to wait until the end of the call and get the 
> return code
> - classes = XXX : list of cfengine classes to set during the remote call
> - nodes = uuid,... : list of uuid to call in the "/nodes" case
>
> Behavior:
> - Loop on all nodes
> - Find its hostname from its uuid in a matching file created by 
> promise generation on the server
> - The call is descending, so we don't care about host that do not exist
> - The call is descending, so we will only accept calls from the policy 
> server
> - Call rudder remote
> - prefix the remote output lines with <uuid>: to make sure the caller 
> can parse output during async call on multiple nodes
> - surround the output with json format lines and include return code, 
> duration and stderr (-> we should escape the output for use within a 
> json string)
>
Will it won't be able to traverse several relays, or am I not 
understanding correctly how it works? most notably, for one node only, 
what is the logic to reach the proper relay and sub-relays for the node ?

Nicolas


More information about the rudder-dev mailing list