ensoft / entrance / EnTrance.Feature.Target.Netconf

Invoke Netconf operations.

This module presents two APIs, and you can pick whichever suits your app the best:

Functionality is identical across these two API options. Also, the decoder for reply notifications is decodeRequest either way.

Notifications are of type netconf and have a String success type.

Standalone API

get : String -> EnTrance.Request.Request

Standalone Netconf get

getConfig : String -> EnTrance.Request.Request

Standalone Netconf get config

editConfig : String -> EnTrance.Request.Request

Standalone Netconf edit config

validate : EnTrance.Request.Request

Standalone Netconf validate

commit : EnTrance.Request.Request

Standalone Netconf commit

Data type API


type Op
    = Get String
    | GetConfig String
    | EditConfig String
    | Validate
    | Commit

All possible Netconf operations.

request : Op -> EnTrance.Request.Request

Encode a Netconf Request

decodeRequest : (EnTrance.Types.RpcData String -> msg) -> Json.Decode.Decoder msg

Decode the reply from any Netconf operation. This always has String type, but for some operations, the success/failure bit is really all that's being communicated and the string will be empty. Takes a message constructor.

Feature start/stop

start : EnTrance.Types.MaybeSubscribe -> EnTrance.Request.Request

Start a Netconf feature instance. This represents the option to connect to one router. This is an async request - use the connection state notifications to track progress.

stop : EnTrance.Request.Request

Stop a Netconf feature instance. This is an async request.

decodeIsUp : (Basics.Bool -> msg) -> Json.Decode.Decoder msg

Decode an up/down notification requested by passing SubscribeToConState to start. Takes a message constructor.