| from requests.auth import HTTPBasicAuth |
| print "usage: create-intent onos-node name ingressDevice ingressPort egressDevice egressPort" |
| ingressPort = sys.argv[4] |
| '"type": "PointToPointIntent",' + \ |
| '"appId": "org.onosproject.cli",' + \ |
| intentJson = intentJsonTemplate.format(ingress, ingressPort, egress, egressPort) |
| intentRequest = requests.post('http://' + node + ':8181/onos/v1/intents/', |
| auth=HTTPBasicAuth('onos', 'rocks'), |
| if intentRequest.status_code != 201: |
| location = intentRequest.headers["location"] |
| print "@stc " + name + "Location=" + location |