Exemplo n.º 1
0
def cr_id(service: str, instance: str) -> Mapping[str, str]:
    return dict(
        group="yelp.com",
        version="v1alpha1",
        namespace="paasta-monkrelays",
        plural="monkrelays",
        name=sanitised_cr_name(service, instance),
    )
Exemplo n.º 2
0
def cr_id(service: str, instance: str) -> Mapping[str, str]:
    return dict(
        group="yelp.com",
        version="v1alpha1",
        namespace=KUBERNETES_NAMESPACE,
        plural="cassandraclusters",
        name=sanitised_cr_name(service, instance),
    )
Exemplo n.º 3
0
def _dashboard_get(service: str, instance: str, cluster: str,
                   path: str) -> str:
    root = get_flink_ingress_url_root(cluster)
    name = sanitised_cr_name(service, instance)
    url = f"{root}{name}/{path}"
    response = requests.get(url, timeout=FLINK_DASHBOARD_TIMEOUT_SECONDS)
    response.raise_for_status()
    return response.text
Exemplo n.º 4
0
def get_dashboard_url(kind: str, service: str, instance: str,
                      cluster: str) -> Optional[str]:
    system_paasta_config = load_system_paasta_config()
    dashboard_links = system_paasta_config.get_dashboard_links()
    if kind.lower() == "flink":
        flink_link = dashboard_links.get(cluster, {}).get("Flink")
        if flink_link is None:
            flink_link = get_flink_ingress_url_root(cluster)
        if flink_link[-1:] != "/":
            flink_link += "/"
        flink_link += sanitised_cr_name(service, instance)
        return flink_link
    return None