Skip to content

Add a method to PUT a raw flow in JSON format. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions odl/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,6 @@ def get_flow_by_clean_id(self, clean_id):
if flow.clean_id == clean_id:
return flow

# Try to get in operational flows
flows = self.get_operational_flows()
for flow in flows.values():
print flow.clean_id, clean_id
if flow.clean_id == clean_id:
return flow

def get_config_flows_by_name(self, name):
"""
Return a list of config flows based on name.
Expand All @@ -184,6 +177,16 @@ def get_config_flows_by_name(self, name):

return result

def put_flow_from_data_json(self, data, flow):
"""
Insert a flow in this table (config endpoint) based on raw json data.
"""
odl_instance = self.node.odl_instance
endpoint = self.config_endpoint + 'flow/' + str(flow)
return odl_instance.put(endpoint,
data=data,
content="application/yang.data+json")

def put_flow_from_data(self, data, flow):
"""
Insert a flow in this table (config endpoint) based on raw xml data.
Expand Down