Skip to content

Commit

Permalink
fix delete
Browse files Browse the repository at this point in the history
  • Loading branch information
jfullerton44 committed Jan 29, 2024
1 parent 76d1ffa commit d37deb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rs/src/connections/relay_tunnel_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl RelayTunnelHost {
self.mgmt
.delete_tunnel_endpoints(
&self.locator,
&self.host_id.to_string(),
Some(format!("{}-{}", &self.host_id.to_string(), "relay")),
None,
NO_REQUEST_OPTIONS,
)
Expand Down Expand Up @@ -390,7 +390,7 @@ impl RelayTunnelHost {
&self.locator,
&TunnelRelayTunnelEndpoint {
base: TunnelEndpoint {
id: Some(uuid::Uuid::new_v4().to_string()),
id: format!("{}-{}",self.host_id.to_string(), relay),
connection_mode: TunnelConnectionMode::TunnelRelay,
host_id: self.host_id.to_string(),
host_public_keys: vec![],
Expand Down
13 changes: 5 additions & 8 deletions rs/src/management/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,11 @@ impl TunnelManagementClient {
let url = self.build_tunnel_uri(
locator,
Some(&format!(
"{}/{}/{}",
ENDPOINTS_API_SUB_PATH, endpoint.host_id, endpoint.connection_mode
"{}/{}",
ENDPOINTS_API_SUB_PATH, endpoint.base.id
)),
);
url.query_pairs_mut().append_pair("connectionMode", &endpoint.base.connection_mode.to_string());
let mut request = self.make_tunnel_request(Method::PUT, url, options).await?;
json_body(&mut request, endpoint);
self.execute_json("update_tunnel_endpoints", request).await
Expand Down Expand Up @@ -198,15 +199,11 @@ impl TunnelManagementClient {
pub async fn delete_tunnel_endpoints(
&self,
locator: &TunnelLocator,
host_id: &str,
id: &str,
connection_mode: Option<TunnelConnectionMode>,
options: &TunnelRequestOptions,
) -> HttpResult<bool> {
let path = if let Some(cm) = connection_mode {
format!("{}/{}/{}", ENDPOINTS_API_SUB_PATH, host_id, cm)
} else {
format!("{}/{}", ENDPOINTS_API_SUB_PATH, host_id)
};
let path = format!("{}/{}", ENDPOINTS_API_SUB_PATH, id);

let url = self.build_tunnel_uri(locator, Some(&path));
let request = self
Expand Down

0 comments on commit d37deb6

Please sign in to comment.