How to return 'show current-config all' using SEMP API

AllenW
AllenW Member Posts: 8 ✭✭

Trying to construct an API request for the 'show current-config all' CLI command but not sure if this is possible for the SEMP API. Does anyone know if this is possible?

Here is what I have tried with python.
```
requestBody = "<rpc><show><current-config><all/></current-config></show></rpc>"

requestResponseObject = requests.get('http://'+brokerDNS+':8080/SEMP', auth=(user,passw), verify=False, data=requestBody)
```
This has worked for show redundancy/config-sync ..etc but this one I've tried many different options with no luck.

I can't seem to find any other appropriate request body commands when looking at the schema API URL:
```
http://brokerDNS:8080/SEMP/v1/requestSchema.xsd
'''
I know this CLI command does take some time as it returns the entire config for the broker, so this could be the reason or SEMP simply doesn't allow it.

Any suggestions? Thanks

Comments

  • RonInglesby
    RonInglesby Member, Employee Posts: 9 Solace Employee
    edited August 2023 #2

    I could not find a way either with SEMP v1, so I used SEMP v2 (on my local broker):

    GET https://localhost:8080/SEMP/v2/config

    This returns part of the config but you need to follow the "links" in the response body to get everything.

    The GET above returns a response body with this links section:

    "links": {
    "aboutUri": "http://localhost:8080/SEMP/v2/config/about",
    "certAuthoritiesUri": "http://localhost:8080/SEMP/v2/config/certAuthorities",
    "clientCertAuthoritiesUri": "http://localhost:8080/SEMP/v2/config/clientCertAuthorities",
    "dmrClustersUri": "http://localhost:8080/SEMP/v2/config/dmrClusters",
    "domainCertAuthoritiesUri": "http://localhost:8080/SEMP/v2/config/domainCertAuthorities",
    "msgVpnsUri": "http://localhost:8080/SEMP/v2/config/msgVpns",
    "oauthProfilesUri": "http://localhost:8080/SEMP/v2/config/oauthProfiles",
    "systemInformationUri": "http://localhost:8080/SEMP/v2/config/systemInformation",
    "uri": "http://localhost:8080/SEMP/v2/config",
    "virtualHostnamesUri": "http://localhost:8080/SEMP/v2/config/virtualHostnames"
    }

    Follow any links in those response bodies to drill further down into the config. Keep drilling down until all links queried.

    For example:

    GET https://localhost:8080/SEMP/v2/config/msgVpns

    Returns response body with links section:

    "links": [
    {
    "aclProfilesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/aclProfiles",
    "authenticationOauthProfilesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/authenticationOauthProfiles",
    "authenticationOauthProvidersUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/authenticationOauthProviders",
    "authorizationGroupsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/authorizationGroups",
    "bridgesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/bridges",
    "certMatchingRulesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/certMatchingRules",
    "clientProfilesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/clientProfiles",
    "clientUsernamesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/clientUsernames",
    "distributedCachesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/distributedCaches",
    "dmrBridgesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/dmrBridges",
    "jndiConnectionFactoriesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/jndiConnectionFactories",
    "jndiQueuesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/jndiQueues",
    "jndiTopicsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/jndiTopics",
    "kafkaReceiversUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/kafkaReceivers",
    "kafkaSendersUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/kafkaSenders",
    "mqttRetainCachesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/mqttRetainCaches",
    "mqttSessionsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/mqttSessions",
    "proxiesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/proxies",
    "queueTemplatesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/queueTemplates",
    "queuesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/queues",
    "replayLogsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/replayLogs",
    "replicatedTopicsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/replicatedTopics",
    "restDeliveryPointsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/restDeliveryPoints",
    "sequencedTopicsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/sequencedTopics",
    "telemetryProfilesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/telemetryProfiles",
    "topicEndpointTemplatesUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/topicEndpointTemplates",
    "topicEndpointsUri": "http://localhost:8080/SEMP/v2/config/msgVpns/default/topicEndpoints",
    "uri": "http://localhost:8080/SEMP/v2/config/msgVpns/default"
    }
    ]