Skip to content

Commit

Permalink
Fixed deprecated endpoints and removed missed trailing slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmikuska committed Feb 8, 2025
1 parent d8a3828 commit 87ef7fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions virl2_client/models/lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Lab:
"state": "labs/{lab_id}/state",
"wipe": "labs/{lab_id}/wipe",
"events": "labs/{lab_id}/events",
"build_configurations": "build_configurations?lab_id={lab_id}",
"bootstrap": "labs/{lab_id}/bootstrap",
"topology": "labs/{lab_id}/topology",
"pyats_testbed": "labs/{lab_id}/pyats_testbed",
"layer3_addresses": "labs/{lab_id}/layer3_addresses",
Expand Down Expand Up @@ -1357,7 +1357,7 @@ def build_configurations(self) -> None:
Build basic configurations for all nodes in the lab that do not
already have a configuration and support configuration building.
"""
url = self._url_for("build_configurations")
url = self._url_for("bootstrap")
self._session.get(url)
# sync to get the updated configs
self.sync_topology_if_outdated()
Expand Down
12 changes: 6 additions & 6 deletions virl2_client/models/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SystemManagement:
"compute_hosts": "system/compute_hosts",
"notices": "system/notices",
"external_connectors": "system/external_connectors",
"external_connector": "system/external_connectors/{connector_id}",
"web_session_timeout": "web_session_timeout/{timeout}",
"external_connector": "system/external_connectors",
"web_session_timeout": "web_session_timeout",
"host_configuration": "system/compute_hosts/configuration",
}

Expand Down Expand Up @@ -235,7 +235,7 @@ def update_external_connector(
:param data: The data to update.
:returns: The updated data.
"""
url = self._url_for("external_connector", connector_id=connector_id)
url = f"{self._url_for('external_connector')}/{connector_id}"
return self._session.patch(url, json=data).json()

def delete_external_connector(self, connector_id: str) -> None:
Expand All @@ -244,7 +244,7 @@ def delete_external_connector(self, connector_id: str) -> None:
:param connector_id: The ID of the connector to delete.
"""
url = self._url_for("external_connector", connector_id=connector_id)
url = f"{self._url_for('external_connector')}/{connector_id}"
self._session.delete(url)

def get_web_session_timeout(self) -> int:
Expand All @@ -253,7 +253,7 @@ def get_web_session_timeout(self) -> int:
:returns: The web session timeout.
"""
url = self._url_for("web_session_timeout", timeout="")
url = self._url_for("web_session_timeout")
return self._session.get(url).json()

def set_web_session_timeout(self, timeout: int) -> str:
Expand All @@ -263,7 +263,7 @@ def set_web_session_timeout(self, timeout: int) -> str:
:param timeout: The timeout value in seconds.
:returns: 'OK'
"""
url = self._url_for("web_session_timeout", timeout=timeout)
url = f"{self._url_for('web_session_timeout')}/{timeout}"
return self._session.patch(url).json()

def get_new_compute_host_state(self) -> str:
Expand Down

0 comments on commit 87ef7fb

Please sign in to comment.