Skip to content

login

login

login(
    clusters: list[str],
    disabled: dict[str, DisabledCluster] | None = None,
) -> list[Remote]

Create an SSH connection with the given clusters, reusing existing connections when possible.

Parameters:

Name Type Description Default
clusters list[str]

List of cluster hostnames to connect to. If empty, will attempt to connect to all clusters in the config that we don't already have an active connection to.

required
disabled dict[str, DisabledCluster] | None

Optional pre-fetched mapping of disabled clusters. When None (the default), the mapping is fetched from the cache and a warning is printed if any clusters are disabled. Pass an already-fetched dict (e.g. from :func:print_disabled_clusters) to suppress the duplicate warning when login is called from within another command.

None

Returns:

Type Description
list[Remote]

A list of Remote objects, one for each cluster.

get_remote_without_2fa_prompt

get_remote_without_2fa_prompt(
    cluster_hostname: str,
) -> Remote | None

Returns the Remote object for a given cluster if we already have a connection to it.

If we don't already have a connection, this will not block for 2FA, and will return None.