-
Notifications
You must be signed in to change notification settings - Fork 26
pfcon get set internalvars
Rudolph Pienaar edited this page Feb 2, 2018
·
15 revisions
This page describes how to directly set/get internal variables in pfcon
. These variables are typically settings such as host service names, IP addresses, etc.
- Make sure that
pfcon
has been started (see here for more info)
pfcon --forever --httpResponse
The msg
payload of the REST interaction with pfcon
is:
'{ "action": "internalctl",
"meta": {
"var": "storeAddress",
"get": "value"
}
}'
Assuming satisfied preconditions, let's get some data in the internal tree dictionary of the process
./pfurl --verb POST --raw --http ${HOST_IP}:5015/api/v1/cmd --httpResponseBodyParse --jsonwrapper 'payload' --msg \
'{ "action": "internalctl",
"meta": {
"var": "/service",
"get": "value"
}
}'
Assuming satisfied preconditions, we can set an entire dictionary of values
./pfurl --verb POST --raw --http ${HOST_IP}:5015/api/v1/cmd --httpResponseBodyParse --jsonwrapper 'payload' --msg \
'{ "action": "internalctl",
"meta": {
"var": "/service/megaldon",
"set": {
"compute": {
"addr": "10.195.149.43",
"baseURLpath": "api/v1/cmd/",
"status": "undefined"
},
"data": {
"addr": "10.195.149.43",
"baseURLpath": "api/v1/cmd/",
"status": "undefined"
}
}
}'
--30--