Skip to content
Snippets Groups Projects
Commit 07431a56 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

update change link parameter

parent 7f95da7e
No related branches found
No related tags found
No related merge requests found
......@@ -224,6 +224,21 @@ class GNS3Manager:
print(f"Error duplicate_node: {response.status_code}")
return node_id
@staticmethod
def set_link_filter(link_id, packet_lost):
global PROJECT_ID, username, password
url = f"http://localhost:3080/v2/projects/{PROJECT_ID}/links"
data = {"filters": {"packet_lost": [packet_lost]}}
response = requests.post(url, json=data, auth=(username, password))
if response.status_code == 201:
json_data = response.json()
return json_data["link_id"]
else:
print(f"Error set_link_filter: {response.status_code}")
@staticmethod
def get_links():
global PROJECT_ID, username, password
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment