Code Review
/
integration
/
test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Adapt netconf device configuration in Netconf CSIT
[integration/test.git]
/
csit
/
libraries
/
SettingsLibrary.py
diff --git
a/csit/libraries/SettingsLibrary.py
b/csit/libraries/SettingsLibrary.py
index e47c420707a3fc9c6feed7a99273fce5dded08ec..c0325d334f40ec611abae63847b935bc46da5fd6 100644
(file)
--- a/
csit/libraries/SettingsLibrary.py
+++ b/
csit/libraries/SettingsLibrary.py
@@
-1,14
+1,15
@@
-__author__ = "Basheeruddin Ahmed"
-__copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
-__license__ = "New-style BSD"
-__email__ = "syedbahm@cisco.com"
-
from string import Template
# helps in taking the hostname entered by the user
# global hostname
# global port
from string import Template
# helps in taking the hostname entered by the user
# global hostname
# global port
+__author__ = "Basheeruddin Ahmed"
+__copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
+__license__ = "New-style BSD"
+__email__ = "syedbahm@cisco.com"
+
+
# def setHostname(host):
# hostname=host
# def setHostname(host):
# hostname=host
@@
-18,54
+19,62
@@
from string import Template
def getCarsUrl(hostname, port):
"""Cars resource URL for GET"""
def getCarsUrl(hostname, port):
"""Cars resource URL for GET"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
/car:cars"
+ return "http://" + hostname + ":" + port + "/rest
s/data
/car:cars"
def getPersonsUrl(hostname, port):
"""People resouce URL for GET"""
def getPersonsUrl(hostname, port):
"""People resouce URL for GET"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
/people:people"
+ return "http://" + hostname + ":" + port + "/rest
s/data
/people:people"
def getCarPersonUrl(hostname, port):
"""GET cars persons mapping resource URL"""
def getCarPersonUrl(hostname, port):
"""GET cars persons mapping resource URL"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
/car-people:car-people"
+ return "http://" + hostname + ":" + port + "/rest
s/data
/car-people:car-people"
def getAddCarInitUrl(hostname, port):
"""POST or DELETE URL"""
def getAddCarInitUrl(hostname, port):
"""POST or DELETE URL"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
"
+ return "http://" + hostname + ":" + port + "/rest
s/data
"
def getAddCarUrl(hostname, port):
"""POST or DELETE URL"""
def getAddCarUrl(hostname, port):
"""POST or DELETE URL"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
/car:cars"
+ return "http://" + hostname + ":" + port + "/rest
s/data
/car:cars"
def getAddPersonUrl(hostname, port):
"""POST or DELETE URL"""
def getAddPersonUrl(hostname, port):
"""POST or DELETE URL"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
"
+ return "http://" + hostname + ":" + port + "/rest
s/data
"
def getAddPersonRpcUrl(hostname, port):
"""POST URL -using rpc"""
def getAddPersonRpcUrl(hostname, port):
"""POST URL -using rpc"""
- return "http://" + hostname + ":" + port + "/rest
conf
/operations/people:add-person"
+ return "http://" + hostname + ":" + port + "/rest
s
/operations/people:add-person"
def getAddCarPersonUrl(hostname, port):
"""POST URL for car person mapping"""
def getAddCarPersonUrl(hostname, port):
"""POST URL for car person mapping"""
- return "http://" + hostname + ":" + port + "/rest
conf/config
"
+ return "http://" + hostname + ":" + port + "/rest
s/data
"
def getBuyCarRpcUrl(hostname, port):
"""POST URL for buy car rpc"""
def getBuyCarRpcUrl(hostname, port):
"""POST URL for buy car rpc"""
- return "http://" + hostname + ":" + port + "/rest
conf
/operations/car-purchase:buy-car"
+ return "http://" + hostname + ":" + port + "/rest
s
/operations/car-purchase:buy-car"
def getJolokiaURL(hostname, port, shardIndex, shardName):
"""GET URL for jolokia"""
def getJolokiaURL(hostname, port, shardIndex, shardName):
"""GET URL for jolokia"""
- return "http://" + hostname + ":" + port + \
- "/jolokia/read/org.opendaylight.controller:Category=Shards,name=member-" + \
- shardIndex + "-" + shardName + ",type=DistributedConfigDatastore"
+ return (
+ "http://"
+ + hostname
+ + ":"
+ + port
+ + "/jolokia/read/org.opendaylight.controller:Category=Shards,name=member-"
+ + shardIndex
+ + "-"
+ + shardName
+ + ",type=DistributedConfigDatastore"
+ )
# Template for Car init resource payload
# Template for Car init resource payload
@@
-82,7
+91,8
@@
add_car_init_payload_template = Template(
}
]
}}
}
]
}}
- """)
+ """
+)
# Template for Car resource payload
add_car_payload_template = Template(
# Template for Car resource payload
add_car_payload_template = Template(
@@
-97,7
+107,8
@@
add_car_payload_template = Template(
}
]
}
}
]
}
- """)
+ """
+)
# Template for Person resource payload
add_person_payload_template = Template(
# Template for Person resource payload
add_person_payload_template = Template(
@@
-113,7
+124,8
@@
add_person_payload_template = Template(
}
]
}}
}
]
}}
- """)
+ """
+)
# Template for Car Person mapping payload
add_car_person_template = Template(
# Template for Car Person mapping payload
add_car_person_template = Template(
@@
-126,7
+138,8
@@
add_car_person_template = Template(
}
]
}}
}
]
}}
- """)
+ """
+)
# Template for adding person using RPC
add_person_rpc_payload_template = Template(
# Template for adding person using RPC
add_person_rpc_payload_template = Template(
@@
-141,7
+154,8
@@
add_person_rpc_payload_template = Template(
"people:age":"$age"
}
}
"people:age":"$age"
}
}
- """)
+ """
+)
# Template for buing car rpc
buy_car_rpc_template = Template(
# Template for buing car rpc
buy_car_rpc_template = Template(
@@
-154,4
+168,5
@@
buy_car_rpc_template = Template(
"car-purchase:car-id" : "$carId"
}
}
"car-purchase:car-id" : "$carId"
}
}
- """)
+ """
+)