Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks Manjit. It worked after adding commit ID in the request body. I am sharing my code.

url = "<your Control Hub url>/topology/rest/v1/topologies/exportTopologies"
body = "[\"topology-commit-id\"]"
headers = {
    'content-type': "application/json",
    'x-ss-rest-call': "true",
    'x-ss-user-auth-token': "session-id-from-login-request",
    'x-requested-by': "SCH"
    }

response = requests.request("POST", url, data=body, headers=headers)

if response.status_code == 200:
    if response.headers.get('Content-Disposition'):
        print("Writing file to topology.zip")
        open("topology.zip", 'wb').write(response.content)