def cloud_id_to_node_config()

in elasticsearch_serverless/_sync/client/utils.py [0:0]


def cloud_id_to_node_config(cloud_id: str) -> NodeConfig:
    """Transforms an Elastic Cloud ID into a NodeConfig"""
    es_addr = parse_cloud_id(cloud_id).es_address
    if es_addr is None or not all(es_addr):
        raise ValueError("Cloud ID missing host and port information for Elasticsearch")
    host, port = es_addr
    return NodeConfig(
        scheme="https",
        host=host,
        port=port,
        http_compress=True,
    )