cli to legacy semp for session-idle-timeout

jfg1306
jfg1306 Member Posts: 12
edited October 2021 in PubSub+ Event Broker #1

Hello Solace-Community,

new Solace user here :smile:

We are currently developing our own terraform solace provider and are now at a point where we want to be able to configure some broker settings through terraform.
For that we are using the semp v2 api whenever possible but have to fall back to the legacy semp from time to time. In this case we want to be able to configure the session-idle-timeout value for the semp service. We want to do that through the legacy semp.

When I type it into my cli I can use the following command:

pubsubplus-0(configure)# service semp session-idle-timeout 100

This works, no problem.
When I then try to use the cli-2-semp tool, to translate this command into a semp request I get the following error:

Unexpected parameter(s): 'session-idle-timeout 100' in command 'service semp session-idle-timeout 100'

When I try to use the command in a semp request

<rpc>
    <service>
        <semp>
            <session-idle-timeout>129</session-idle-timeout>
        </semp>
    </service>
</rpc>

I get the following response

<rpc-reply semp-version="soltr/9_11VMR">
  <parse-error>invalid message: schema validation error</parse-error>
</rpc-reply>

So it seems like I am doing something wrong, but I do not know what. If someone could help me in this case, would be great :smile:

I am using Solace PubSub+ Broker in Version 9.11.0.10 running on a on-premise openshift server.

Tagged:

Best Answer

  • ahabel
    ahabel Member Posts: 9 ✭✭
    #2 Answer ✓

    Hi @jfg1306 ,

    I guess you're looking for this command, however I totally agree that this ist not obvious. Also, cli2semp does not recognize the original cli command.

    <rpc>
        <service>
            <semp>
                <session-idle-timeout>
                  <value>123</value>
                </session-idle-timeout>            
            </semp>
        </service>
    </rpc>
    

Answers

  • TomF
    TomF Member, Employee Posts: 406 Solace Employee

    Hi @jfg1306,

    TL;DR:

    <rpc>
            <console>
                    <timeout>
                            <idle-timeout>129</idle-timeout>
                    </timeout>
            </console>
    </rpc>
    

    Long version:
    1. Get the current SEMP v1 schema file from the broker by doing a GET on http:///SEMP/v1/requestSchema.xsd
    2. Use an XML schema viewer to find the element of interest. I actually did a grep for "timeout", but I am very lazy and that actually cost me more time than doing it properly
    3. Write your xml
    4. Use xmllint or other xmlschema validator to validate what you've written against the schema
    5. Run the command.

  • ahabel
    ahabel Member Posts: 9 ✭✭
    #4 Answer ✓

    Hi @jfg1306 ,

    I guess you're looking for this command, however I totally agree that this ist not obvious. Also, cli2semp does not recognize the original cli command.

    <rpc>
        <service>
            <semp>
                <session-idle-timeout>
                  <value>123</value>
                </session-idle-timeout>            
            </semp>
        </service>
    </rpc>
    
  • jfg1306
    jfg1306 Member Posts: 12

    Hi @ahabel ,

    thank you. That was exactly what I was looking for and works perfect.