+def path_computation_request(requestid: str, servicename: str, serviceaend, servicezend,
+ hardconstraints=None, softconstraints=None, metric="hop-count", other_attr=None):
+ attr = {"service-name": servicename,
+ "resource-reserve": "true",
+ "service-handler-header": {"request-id": requestid},
+ "service-a-end": serviceaend,
+ "service-z-end": servicezend,
+ "pce-metric": metric}
+ if hardconstraints:
+ attr.update({"hard-constraints": hardconstraints})
+ if softconstraints:
+ attr.update({"soft-constraints": softconstraints})
+ if other_attr:
+ attr.update(other_attr)
+ return post_request(URL_PATH_COMPUTATION_REQUEST, {"input": attr})
+
+
+def tapi_create_connectivity_request(topologyidorname):
+ return post_request(URL_TAPI_CREATE_CONNECTIVITY, topologyidorname)
+
+
+def tapi_delete_connectivity_request(serviceidorname):
+ attr = {
+ "input": {
+ "service-id-or-name": serviceidorname}}
+ return post_request(URL_TAPI_DELETE_CONNECTIVITY, attr)
+
+
+def tapi_get_topology_details_request(topologyidorname):
+ attr = {
+ "input": {
+ "topology-id-or-name": topologyidorname}}
+ return post_request(URL_TAPI_TOPOLOGY_DETAILS, attr)
+
+
+def tapi_get_node_details_request(topologyidorname, nodeidorname):
+ attr = {
+ "input": {
+ "topology-id-or-name": topologyidorname,
+ "node-id-or-name": nodeidorname}}
+ return post_request(URL_TAPI_NODE_DETAILS, attr)
+
+
+def tapi_get_sip_details_request():
+ return post_request(URL_TAPI_SIP_LIST, "")
+
+
+def tapi_get_service_list_request():
+ return post_request(URL_TAPI_SERVICE_LIST, "")
+
+