Configure logging retention through SEMP v1

jfg1306
jfg1306 Member Posts: 14 ✭✭
edited January 2022 in PubSub+ Event Broker #1

Hello everyone,

I am back with a(nother) question about the SEMP v1. We are trying to set the logging retention for X amount of days through SEMP v1 in our terraform provider.

So I checked which CLI command is needed

logging - retention - days - 30

Then I try to add this command into the cli2semp to get the according SEMP v1 request but get hit with:

"Unexpected parameter(s): 'retention' in command 'logging retention'"

right away.

So I checked the XSD (GET https://<mybroker>/SEMP/v1/requestSchema.xsd) for the correct command and it also states that "retention" is a subelement from "logging". Just like "command", "debug","event" and "no" are. And all of those work through cli2semp - except for "retention".

                <xs:element name="logging">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:choice minOccurs="0">
                                <xs:element name="command">
                                [...]
                                </xs:element>
                                <!-- name="command" -->
                                <xs:element name="debug">
                                [...]
                                </xs:element>
                                <!-- name="debug" -->
                                <xs:element name="event">
                                [...]
                                </xs:element>
                                <!-- name="event" -->
                                <xs:element name="retention">
                                [...]
                                </xs:element>
                                 <!-- name="retention" -->
                                <xs:element name="no">
                                [...]
                                </xs:element>
                                 <!-- name="no" -->


I added two pictures with a working example and the none working example.



So my question would be if someone knows the correct command to define the logging retention time to e.g. max 30 days through the SEMP v1 API.

Thank you in advance.

Many Greetings,

Filip

Best Answer

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

    Hi Filip,

    after diving into the XSD and testing a bit, this might be what you're looking for:

    <rpc>
        <logging>
          <retention>
              <days></days>
              <max-num-days>30</max-num-days>
          </retention>  
        </logging>
    </rpc>
    

    Greetings,

    Andreas

Answers

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

    Hi Filip,

    after diving into the XSD and testing a bit, this might be what you're looking for:

    <rpc>
        <logging>
          <retention>
              <days></days>
              <max-num-days>30</max-num-days>
          </retention>  
        </logging>
    </rpc>
    

    Greetings,

    Andreas