import requests
import logging


def get_server_config(project_id: str, location: str, token: str) -> dict:
    """Gets configutation about GKE Server.

    Args:
        project_id: GCP project ID.
        location: Google Compute Engine zone.
        token: Access token from the Google Authorization Server.

    Returns:
        A dict containing the response body.
    """
    host = "https://container.googleapis.com"
    url = f"{host}/v1beta1/projects/{project_id}/locations/{location}/serverConfig"
    resp = requests.get(url, headers={
        "Authorization": f"Bearer {token}",
    })
    try:
        resp.raise_for_status()
    except requests.exceptions.HTTPError as err:
        logging.error(err.response.text)
        raise err
    return resp.json()