MCPcopy Create free account
hub / github.com/cloudflare/cloudflared / get_tunnel_connector_id

Function get_tunnel_connector_id

component-tests/util.py:211–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209
210
211def get_tunnel_connector_id():
212 url = f'http://localhost:{METRICS_PORT}/ready'
213
214 try:
215 resp = requests.get(url, timeout=1)
216 return resp.json()["connectorId"]
217 # cloudflared might already terminated
218 except requests.exceptions.ConnectionError as e:
219 LOGGER.warning(f"Failed to connect to {url}, error: {e}")
220
221
222# In some cases we don't need to check response status, such as when sending batch requests to generate logs

Callers 3

get_management_urlMethod · 0.90
get_management_wsurlMethod · 0.90

Calls 1

getMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…