🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

Is that possible to get Broker information into json format with SEMPv1/curl?

akiralt
akiralt Member Posts: 5 ✭✭

Hi all, good morning

I'm trying to query such information using the commands below, and I would like to know if I can get the output into json format?

curl -u "user:pwd" "https://solace-broker-IP:443/SEMP" -d '<rpc><show><hardware><details></details></hardware></show></rpc>'
curl -u "user:pwd" "https://solace-broker-IP:443/SEMP" -d '<rpc><show><environment></environment></show></rpc>'

Tagged:

Answers

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 644 admin

    Hi @akiralt . Not directly from the broker, I'm afraid. SEMPv1 is all XML. SEMPv2 is natively in JSON, but show hardware and other system-level commands are not available yet.

    You could do something like:

    pip install yq
    curl -u admin:admin http://192.168.42.11/SEMP -d '<rpc><show><hardware/></show></rpc>' | xq
    
    {
    "rpc-reply": {
    "@semp-version": "soltr/9_13_1",
    "rpc": {
    "show": {
    "hardware": {
    "platform": "Solace PubSub+ 3260",
    "chassis-product-number": "CHS-3260AC-01-B",
    "mainboard": {
    "chassis-revision": "1.2",
    "chassis-serial": "S009000022"
    },
    "power-redundancy": {
    "power-redundancy-config": "2+2",
    "operational-power-supplies": "2"
    },
    "system-type": "topic-routing",
    "supported-blade-configuration": "true",
    "disks": {
    "disk": [
    {
    "disk-number": "1",
    "device-model": "INTEL SSDSA2CW080G3", <SNIP>