Skip to content

1.2 pfdcm set get internal vars

janakitti edited this page Jan 26, 2021 · 4 revisions

pfdcm get/set internalvars

Abstract

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.

Preconditions

  • Make sure that pfcon has been started (see here for more info)
pfcon --forever --httpResponse

msg summary

The msg payload of the REST interaction with pfcon is:

'{  "action": "internalctl",
    "meta": {
                "var":          "storeAddress",
                "get":          "value"
            }
}'

get

pfurl calling syntax

Assuming satisfied preconditions, let's get some data in the internal tree dictionary of the process

pfurl   --verb POST                             \
        --raw                                   \
        --http ${HOST_IP}:4055/api/v1/cmd       \
        --jsonwrapper 'payload'                 \
        --msg '{  
            "action": "internalctl",
            "meta": {
                "var":     "/service",
                "get":      "value"
            }
        }'

set

pfurl calling syntax

Assuming satisfied preconditions, we can set an entire dictionary of values

pfurl   --verb POST                             \
        --raw                                   \
        --http ${HOST_IP}:4055/api/v1/cmd       \
        --jsonwrapper 'payload'                 \
        --msg '{  
            "action": "internalctl",
            "meta": {
                "var":     "/service,
                "set":     {
                     "test2": {
                                "IP": "192.168.1.2",
                                "aetitle": "aetitle",
                                "callaetitle": "callaetitle",
                                "port": "104"
                     }
                }          
            }
}'

return payload

--30--