MCPcopy Index your code
hub / github.com/kubernetes-client/python / get_websocket_url

Function get_websocket_url

kubernetes/base/stream/ws_client.py:489–506  ·  view source on GitHub ↗
(url, query_params=None)

Source from the content-addressed store, hash-verified

487
488
489def get_websocket_url(url, query_params=None):
490 parsed_url = urlparse(url)
491 parts = list(parsed_url)
492 if parsed_url.scheme == 'http':
493 parts[0] = 'ws'
494 elif parsed_url.scheme == 'https':
495 parts[0] = 'wss'
496 if query_params:
497 query = []
498 for key, value in query_params:
499 if key == 'command' and isinstance(value, list):
500 for command in value:
501 query.append((key, command))
502 else:
503 query.append((key, value))
504 if query:
505 parts[4] = urlencode(query)
506 return urlunparse(parts)
507
508
509def create_websocket(configuration, url, headers=None):

Callers 3

websocket_callFunction · 0.85
portforward_callFunction · 0.85
test_websocket_clientMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_websocket_clientMethod · 0.68