Previous: , Up: Control API   [Contents][Index]


C.6 /environ

This URI is active when pies runs as init process (see Init Process). It manipulates the program initial environment, i.e. the environment that all programs inherit. See Init Environment.

Request: GET /environ/

Returns entire environment formatted as a JSON array of strings. On success, the 200 response is returned:

["RUNLEVEL=3", "CONSOLE=/dev/tty", ...]  
Request: GET /environ/var

Returns the value of the environment variable var, if such is defined. On success, the 200 response carries the object:

{ "status":"OK", "value":string }

If the variable var is not defined, a 404 response is returned. On error, a 403 response is returned. In both cases, the response body is the usual pies diagnostics object:

{ "status":"ER", "message":text }
Request: DELETE /environ/var

Deletes from the environment the variable var. On success, responds with HTTP 200:

{ "status":"OK" }

Error responses are the same as for ‘GET’.

Request: PUT /environ/name=value

Initializes environment variable name to value. See ‘GET’ for the possible responses.