def deletePolicy(tenantName, policyName): print "Deleting policy {0}:{1}".format(tenantName, policyName) # Delete Policy deleteUrl = 'http://localhost:9999/api/policys/' + tenantName + ':' + policyName + '/' response = http.httpDelete(deleteUrl) if response == "Error": errorExit("Policy create failure")
def deleteTenant(tenantName): print "Deleting tenant {0}".format(tenantName) # Delete tenant deleteUrl = 'http://localhost:9999/api/tenants/' + tenantName + '/' response = http.httpDelete(deleteUrl) # Check for error if response == "Error": errorExit("Tenant delete failure")
def deleteNet(tenantName, networkName): print "Deleting network {0}:{1}".format(tenantName, networkName) # Delete network deleteUrl = 'http://localhost:9999/api/networks/' + tenantName + ':' + networkName + '/' response = http.httpDelete(deleteUrl) # Check for error if response == "Error": errorExit("Network delete failure")
def deleteEpg(tenantName, networkName, groupName): print "Deleting endpoint group {0}:{1}:{2}".format(tenantName, networkName, groupName) # Delete EPG deleteUrl = 'http://localhost:9999/api/endpointGroups/' + tenantName + ':' + networkName + ':' + groupName + '/' response = http.httpDelete(deleteUrl) # Check for error if response == "Error": errorExit("Epg delete failure")
def deleteRule(tenantName, policyName, ruleId): print "Deleting rule {0}:{1}:{2}".format(tenantName, policyName, ruleId) # Delete Rule deleteUrl = 'http://localhost:9999/api/rules/' + tenantName + ':' + policyName + ':' + ruleId + '/' response = http.httpDelete(deleteUrl) # Check for error if response == "Error": errorExit("rule delete failure")