Connecting from a Terminal

One can connect to the Network Manager from a terminal, e.g., using openssl s_client, to manually send requests to the Network Manager. So that you do not have to enter a request in the very-specific JSON representation of the Client Format, the following syntax can be used instead.

Connecting from a terminal is only convenient when connecting as a Client. A Service must enter the full JSON representation of the Service Format when it sends a response.

Some tips for connecting as a Client:

  • To identify as a Client enter

    client
    
  • To identify as a Client with the name My Name enter

    client My Name
    
  • To request something from the Network Manager use the following format

    Manager <attribute> [<arguments>, [<keyword_arguments>]]
    

    For example, to request the identity of the Network Manager enter

    Manager identity
    

    or, as a shortcut for requesting the identity of the Manager, you only need to enter

    identity
    

    To check if a user with the name n.bohr exists in the database of registered users enter

    Manager users_table.is_user_registered n.bohr
    

    Note

    Most requests that are for the Network Manager to execute require that the request comes from a Client that is connected to the Network Manager as an administrator. Your login credentials will be checked (requested from you) before the Network Manager executes the request. See the user command in MSL-Network CLI Documentation for more details on how to become an administrator.

  • To request something from a Service use the following format

    <service> <attribute> [<arguments>, [<keyword_arguments>]]
    

    Attention

    Although you can send requests to a Service in the following manner there is no way to block the request if the Service has already met the restriction for the maximum number of Client's that can be linked with the Service to send requests to it. Therefore, you should only do the following if you are certain that the Service has not reached its maximum Client limit. To test if this Client limit has been reached enter link <service>, for example, link BasicMath and see if you get a PermissionError in the response before you proceed to send requests to the Service.

    For example, to request the addition of two numbers from the BasicMath Service enter

    BasicMath add 4 10
    

    or

    BasicMath add x=4 y=10
    

To request the concatenation of two strings from a ModifyString.concat(s1, s2) Service, but with the ModifyString Service being named String Editor on the Network Manager enter

"String Editor" concat s1="first string" s2="second string"
  • To disconnect from the Network Manager enter

    disconnect
    

    or

    exit